...

Source file src/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go

Documentation: cloud.google.com/go/monitoring/apiv3/v2

     1  // Copyright 2024 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     https://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go_gapic. DO NOT EDIT.
    16  
    17  package monitoring
    18  
    19  import (
    20  	"context"
    21  	"fmt"
    22  	"math"
    23  	"net/url"
    24  	"time"
    25  
    26  	monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
    27  	gax "github.com/googleapis/gax-go/v2"
    28  	"google.golang.org/api/iterator"
    29  	"google.golang.org/api/option"
    30  	"google.golang.org/api/option/internaloption"
    31  	gtransport "google.golang.org/api/transport/grpc"
    32  	"google.golang.org/grpc"
    33  	"google.golang.org/grpc/codes"
    34  	"google.golang.org/protobuf/proto"
    35  )
    36  
    37  var newUptimeCheckClientHook clientHook
    38  
    39  // UptimeCheckCallOptions contains the retry settings for each method of UptimeCheckClient.
    40  type UptimeCheckCallOptions struct {
    41  	ListUptimeCheckConfigs  []gax.CallOption
    42  	GetUptimeCheckConfig    []gax.CallOption
    43  	CreateUptimeCheckConfig []gax.CallOption
    44  	UpdateUptimeCheckConfig []gax.CallOption
    45  	DeleteUptimeCheckConfig []gax.CallOption
    46  	ListUptimeCheckIps      []gax.CallOption
    47  }
    48  
    49  func defaultUptimeCheckGRPCClientOptions() []option.ClientOption {
    50  	return []option.ClientOption{
    51  		internaloption.WithDefaultEndpoint("monitoring.googleapis.com:443"),
    52  		internaloption.WithDefaultEndpointTemplate("monitoring.UNIVERSE_DOMAIN:443"),
    53  		internaloption.WithDefaultMTLSEndpoint("monitoring.mtls.googleapis.com:443"),
    54  		internaloption.WithDefaultUniverseDomain("googleapis.com"),
    55  		internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
    56  		internaloption.WithDefaultScopes(DefaultAuthScopes()...),
    57  		internaloption.EnableJwtWithScope(),
    58  		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
    59  			grpc.MaxCallRecvMsgSize(math.MaxInt32))),
    60  	}
    61  }
    62  
    63  func defaultUptimeCheckCallOptions() *UptimeCheckCallOptions {
    64  	return &UptimeCheckCallOptions{
    65  		ListUptimeCheckConfigs: []gax.CallOption{
    66  			gax.WithTimeout(30000 * time.Millisecond),
    67  			gax.WithRetry(func() gax.Retryer {
    68  				return gax.OnCodes([]codes.Code{
    69  					codes.Unavailable,
    70  				}, gax.Backoff{
    71  					Initial:    100 * time.Millisecond,
    72  					Max:        30000 * time.Millisecond,
    73  					Multiplier: 1.30,
    74  				})
    75  			}),
    76  		},
    77  		GetUptimeCheckConfig: []gax.CallOption{
    78  			gax.WithTimeout(30000 * time.Millisecond),
    79  			gax.WithRetry(func() gax.Retryer {
    80  				return gax.OnCodes([]codes.Code{
    81  					codes.Unavailable,
    82  				}, gax.Backoff{
    83  					Initial:    100 * time.Millisecond,
    84  					Max:        30000 * time.Millisecond,
    85  					Multiplier: 1.30,
    86  				})
    87  			}),
    88  		},
    89  		CreateUptimeCheckConfig: []gax.CallOption{
    90  			gax.WithTimeout(30000 * time.Millisecond),
    91  		},
    92  		UpdateUptimeCheckConfig: []gax.CallOption{
    93  			gax.WithTimeout(30000 * time.Millisecond),
    94  		},
    95  		DeleteUptimeCheckConfig: []gax.CallOption{
    96  			gax.WithTimeout(30000 * time.Millisecond),
    97  			gax.WithRetry(func() gax.Retryer {
    98  				return gax.OnCodes([]codes.Code{
    99  					codes.Unavailable,
   100  				}, gax.Backoff{
   101  					Initial:    100 * time.Millisecond,
   102  					Max:        30000 * time.Millisecond,
   103  					Multiplier: 1.30,
   104  				})
   105  			}),
   106  		},
   107  		ListUptimeCheckIps: []gax.CallOption{
   108  			gax.WithTimeout(30000 * time.Millisecond),
   109  			gax.WithRetry(func() gax.Retryer {
   110  				return gax.OnCodes([]codes.Code{
   111  					codes.Unavailable,
   112  				}, gax.Backoff{
   113  					Initial:    100 * time.Millisecond,
   114  					Max:        30000 * time.Millisecond,
   115  					Multiplier: 1.30,
   116  				})
   117  			}),
   118  		},
   119  	}
   120  }
   121  
   122  // internalUptimeCheckClient is an interface that defines the methods available from Cloud Monitoring API.
   123  type internalUptimeCheckClient interface {
   124  	Close() error
   125  	setGoogleClientInfo(...string)
   126  	Connection() *grpc.ClientConn
   127  	ListUptimeCheckConfigs(context.Context, *monitoringpb.ListUptimeCheckConfigsRequest, ...gax.CallOption) *UptimeCheckConfigIterator
   128  	GetUptimeCheckConfig(context.Context, *monitoringpb.GetUptimeCheckConfigRequest, ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)
   129  	CreateUptimeCheckConfig(context.Context, *monitoringpb.CreateUptimeCheckConfigRequest, ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)
   130  	UpdateUptimeCheckConfig(context.Context, *monitoringpb.UpdateUptimeCheckConfigRequest, ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)
   131  	DeleteUptimeCheckConfig(context.Context, *monitoringpb.DeleteUptimeCheckConfigRequest, ...gax.CallOption) error
   132  	ListUptimeCheckIps(context.Context, *monitoringpb.ListUptimeCheckIpsRequest, ...gax.CallOption) *UptimeCheckIpIterator
   133  }
   134  
   135  // UptimeCheckClient is a client for interacting with Cloud Monitoring API.
   136  // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
   137  //
   138  // The UptimeCheckService API is used to manage (list, create, delete, edit)
   139  // Uptime check configurations in the Cloud Monitoring product. An Uptime
   140  // check is a piece of configuration that determines which resources and
   141  // services to monitor for availability. These configurations can also be
   142  // configured interactively by navigating to the [Cloud console]
   143  // (https://console.cloud.google.com (at https://console.cloud.google.com)), selecting the appropriate project,
   144  // clicking on “Monitoring” on the left-hand side to navigate to Cloud
   145  // Monitoring, and then clicking on “Uptime”.
   146  type UptimeCheckClient struct {
   147  	// The internal transport-dependent client.
   148  	internalClient internalUptimeCheckClient
   149  
   150  	// The call options for this service.
   151  	CallOptions *UptimeCheckCallOptions
   152  }
   153  
   154  // Wrapper methods routed to the internal client.
   155  
   156  // Close closes the connection to the API service. The user should invoke this when
   157  // the client is no longer required.
   158  func (c *UptimeCheckClient) Close() error {
   159  	return c.internalClient.Close()
   160  }
   161  
   162  // setGoogleClientInfo sets the name and version of the application in
   163  // the `x-goog-api-client` header passed on each request. Intended for
   164  // use by Google-written clients.
   165  func (c *UptimeCheckClient) setGoogleClientInfo(keyval ...string) {
   166  	c.internalClient.setGoogleClientInfo(keyval...)
   167  }
   168  
   169  // Connection returns a connection to the API service.
   170  //
   171  // Deprecated: Connections are now pooled so this method does not always
   172  // return the same resource.
   173  func (c *UptimeCheckClient) Connection() *grpc.ClientConn {
   174  	return c.internalClient.Connection()
   175  }
   176  
   177  // ListUptimeCheckConfigs lists the existing valid Uptime check configurations for the project
   178  // (leaving out any invalid configurations).
   179  func (c *UptimeCheckClient) ListUptimeCheckConfigs(ctx context.Context, req *monitoringpb.ListUptimeCheckConfigsRequest, opts ...gax.CallOption) *UptimeCheckConfigIterator {
   180  	return c.internalClient.ListUptimeCheckConfigs(ctx, req, opts...)
   181  }
   182  
   183  // GetUptimeCheckConfig gets a single Uptime check configuration.
   184  func (c *UptimeCheckClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   185  	return c.internalClient.GetUptimeCheckConfig(ctx, req, opts...)
   186  }
   187  
   188  // CreateUptimeCheckConfig creates a new Uptime check configuration.
   189  func (c *UptimeCheckClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   190  	return c.internalClient.CreateUptimeCheckConfig(ctx, req, opts...)
   191  }
   192  
   193  // UpdateUptimeCheckConfig updates an Uptime check configuration. You can either replace the entire
   194  // configuration with a new one or replace only certain fields in the current
   195  // configuration by specifying the fields to be updated via updateMask.
   196  // Returns the updated configuration.
   197  func (c *UptimeCheckClient) UpdateUptimeCheckConfig(ctx context.Context, req *monitoringpb.UpdateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   198  	return c.internalClient.UpdateUptimeCheckConfig(ctx, req, opts...)
   199  }
   200  
   201  // DeleteUptimeCheckConfig deletes an Uptime check configuration. Note that this method will fail
   202  // if the Uptime check configuration is referenced by an alert policy or
   203  // other dependent configs that would be rendered invalid by the deletion.
   204  func (c *UptimeCheckClient) DeleteUptimeCheckConfig(ctx context.Context, req *monitoringpb.DeleteUptimeCheckConfigRequest, opts ...gax.CallOption) error {
   205  	return c.internalClient.DeleteUptimeCheckConfig(ctx, req, opts...)
   206  }
   207  
   208  // ListUptimeCheckIps returns the list of IP addresses that checkers run from
   209  func (c *UptimeCheckClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator {
   210  	return c.internalClient.ListUptimeCheckIps(ctx, req, opts...)
   211  }
   212  
   213  // uptimeCheckGRPCClient is a client for interacting with Cloud Monitoring API over gRPC transport.
   214  //
   215  // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
   216  type uptimeCheckGRPCClient struct {
   217  	// Connection pool of gRPC connections to the service.
   218  	connPool gtransport.ConnPool
   219  
   220  	// Points back to the CallOptions field of the containing UptimeCheckClient
   221  	CallOptions **UptimeCheckCallOptions
   222  
   223  	// The gRPC API client.
   224  	uptimeCheckClient monitoringpb.UptimeCheckServiceClient
   225  
   226  	// The x-goog-* metadata to be sent with each request.
   227  	xGoogHeaders []string
   228  }
   229  
   230  // NewUptimeCheckClient creates a new uptime check service client based on gRPC.
   231  // The returned client must be Closed when it is done being used to clean up its underlying connections.
   232  //
   233  // The UptimeCheckService API is used to manage (list, create, delete, edit)
   234  // Uptime check configurations in the Cloud Monitoring product. An Uptime
   235  // check is a piece of configuration that determines which resources and
   236  // services to monitor for availability. These configurations can also be
   237  // configured interactively by navigating to the [Cloud console]
   238  // (https://console.cloud.google.com (at https://console.cloud.google.com)), selecting the appropriate project,
   239  // clicking on “Monitoring” on the left-hand side to navigate to Cloud
   240  // Monitoring, and then clicking on “Uptime”.
   241  func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*UptimeCheckClient, error) {
   242  	clientOpts := defaultUptimeCheckGRPCClientOptions()
   243  	if newUptimeCheckClientHook != nil {
   244  		hookOpts, err := newUptimeCheckClientHook(ctx, clientHookParams{})
   245  		if err != nil {
   246  			return nil, err
   247  		}
   248  		clientOpts = append(clientOpts, hookOpts...)
   249  	}
   250  
   251  	connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
   252  	if err != nil {
   253  		return nil, err
   254  	}
   255  	client := UptimeCheckClient{CallOptions: defaultUptimeCheckCallOptions()}
   256  
   257  	c := &uptimeCheckGRPCClient{
   258  		connPool:          connPool,
   259  		uptimeCheckClient: monitoringpb.NewUptimeCheckServiceClient(connPool),
   260  		CallOptions:       &client.CallOptions,
   261  	}
   262  	c.setGoogleClientInfo()
   263  
   264  	client.internalClient = c
   265  
   266  	return &client, nil
   267  }
   268  
   269  // Connection returns a connection to the API service.
   270  //
   271  // Deprecated: Connections are now pooled so this method does not always
   272  // return the same resource.
   273  func (c *uptimeCheckGRPCClient) Connection() *grpc.ClientConn {
   274  	return c.connPool.Conn()
   275  }
   276  
   277  // setGoogleClientInfo sets the name and version of the application in
   278  // the `x-goog-api-client` header passed on each request. Intended for
   279  // use by Google-written clients.
   280  func (c *uptimeCheckGRPCClient) setGoogleClientInfo(keyval ...string) {
   281  	kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
   282  	kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
   283  	c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
   284  }
   285  
   286  // Close closes the connection to the API service. The user should invoke this when
   287  // the client is no longer required.
   288  func (c *uptimeCheckGRPCClient) Close() error {
   289  	return c.connPool.Close()
   290  }
   291  
   292  func (c *uptimeCheckGRPCClient) ListUptimeCheckConfigs(ctx context.Context, req *monitoringpb.ListUptimeCheckConfigsRequest, opts ...gax.CallOption) *UptimeCheckConfigIterator {
   293  	hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
   294  
   295  	hds = append(c.xGoogHeaders, hds...)
   296  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
   297  	opts = append((*c.CallOptions).ListUptimeCheckConfigs[0:len((*c.CallOptions).ListUptimeCheckConfigs):len((*c.CallOptions).ListUptimeCheckConfigs)], opts...)
   298  	it := &UptimeCheckConfigIterator{}
   299  	req = proto.Clone(req).(*monitoringpb.ListUptimeCheckConfigsRequest)
   300  	it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckConfig, string, error) {
   301  		resp := &monitoringpb.ListUptimeCheckConfigsResponse{}
   302  		if pageToken != "" {
   303  			req.PageToken = pageToken
   304  		}
   305  		if pageSize > math.MaxInt32 {
   306  			req.PageSize = math.MaxInt32
   307  		} else if pageSize != 0 {
   308  			req.PageSize = int32(pageSize)
   309  		}
   310  		err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   311  			var err error
   312  			resp, err = c.uptimeCheckClient.ListUptimeCheckConfigs(ctx, req, settings.GRPC...)
   313  			return err
   314  		}, opts...)
   315  		if err != nil {
   316  			return nil, "", err
   317  		}
   318  
   319  		it.Response = resp
   320  		return resp.GetUptimeCheckConfigs(), resp.GetNextPageToken(), nil
   321  	}
   322  	fetch := func(pageSize int, pageToken string) (string, error) {
   323  		items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
   324  		if err != nil {
   325  			return "", err
   326  		}
   327  		it.items = append(it.items, items...)
   328  		return nextPageToken, nil
   329  	}
   330  
   331  	it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
   332  	it.pageInfo.MaxSize = int(req.GetPageSize())
   333  	it.pageInfo.Token = req.GetPageToken()
   334  
   335  	return it
   336  }
   337  
   338  func (c *uptimeCheckGRPCClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   339  	hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
   340  
   341  	hds = append(c.xGoogHeaders, hds...)
   342  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
   343  	opts = append((*c.CallOptions).GetUptimeCheckConfig[0:len((*c.CallOptions).GetUptimeCheckConfig):len((*c.CallOptions).GetUptimeCheckConfig)], opts...)
   344  	var resp *monitoringpb.UptimeCheckConfig
   345  	err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   346  		var err error
   347  		resp, err = c.uptimeCheckClient.GetUptimeCheckConfig(ctx, req, settings.GRPC...)
   348  		return err
   349  	}, opts...)
   350  	if err != nil {
   351  		return nil, err
   352  	}
   353  	return resp, nil
   354  }
   355  
   356  func (c *uptimeCheckGRPCClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   357  	hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
   358  
   359  	hds = append(c.xGoogHeaders, hds...)
   360  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
   361  	opts = append((*c.CallOptions).CreateUptimeCheckConfig[0:len((*c.CallOptions).CreateUptimeCheckConfig):len((*c.CallOptions).CreateUptimeCheckConfig)], opts...)
   362  	var resp *monitoringpb.UptimeCheckConfig
   363  	err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   364  		var err error
   365  		resp, err = c.uptimeCheckClient.CreateUptimeCheckConfig(ctx, req, settings.GRPC...)
   366  		return err
   367  	}, opts...)
   368  	if err != nil {
   369  		return nil, err
   370  	}
   371  	return resp, nil
   372  }
   373  
   374  func (c *uptimeCheckGRPCClient) UpdateUptimeCheckConfig(ctx context.Context, req *monitoringpb.UpdateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
   375  	hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "uptime_check_config.name", url.QueryEscape(req.GetUptimeCheckConfig().GetName()))}
   376  
   377  	hds = append(c.xGoogHeaders, hds...)
   378  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
   379  	opts = append((*c.CallOptions).UpdateUptimeCheckConfig[0:len((*c.CallOptions).UpdateUptimeCheckConfig):len((*c.CallOptions).UpdateUptimeCheckConfig)], opts...)
   380  	var resp *monitoringpb.UptimeCheckConfig
   381  	err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   382  		var err error
   383  		resp, err = c.uptimeCheckClient.UpdateUptimeCheckConfig(ctx, req, settings.GRPC...)
   384  		return err
   385  	}, opts...)
   386  	if err != nil {
   387  		return nil, err
   388  	}
   389  	return resp, nil
   390  }
   391  
   392  func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req *monitoringpb.DeleteUptimeCheckConfigRequest, opts ...gax.CallOption) error {
   393  	hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
   394  
   395  	hds = append(c.xGoogHeaders, hds...)
   396  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
   397  	opts = append((*c.CallOptions).DeleteUptimeCheckConfig[0:len((*c.CallOptions).DeleteUptimeCheckConfig):len((*c.CallOptions).DeleteUptimeCheckConfig)], opts...)
   398  	err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   399  		var err error
   400  		_, err = c.uptimeCheckClient.DeleteUptimeCheckConfig(ctx, req, settings.GRPC...)
   401  		return err
   402  	}, opts...)
   403  	return err
   404  }
   405  
   406  func (c *uptimeCheckGRPCClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator {
   407  	ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
   408  	opts = append((*c.CallOptions).ListUptimeCheckIps[0:len((*c.CallOptions).ListUptimeCheckIps):len((*c.CallOptions).ListUptimeCheckIps)], opts...)
   409  	it := &UptimeCheckIpIterator{}
   410  	req = proto.Clone(req).(*monitoringpb.ListUptimeCheckIpsRequest)
   411  	it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckIp, string, error) {
   412  		resp := &monitoringpb.ListUptimeCheckIpsResponse{}
   413  		if pageToken != "" {
   414  			req.PageToken = pageToken
   415  		}
   416  		if pageSize > math.MaxInt32 {
   417  			req.PageSize = math.MaxInt32
   418  		} else if pageSize != 0 {
   419  			req.PageSize = int32(pageSize)
   420  		}
   421  		err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
   422  			var err error
   423  			resp, err = c.uptimeCheckClient.ListUptimeCheckIps(ctx, req, settings.GRPC...)
   424  			return err
   425  		}, opts...)
   426  		if err != nil {
   427  			return nil, "", err
   428  		}
   429  
   430  		it.Response = resp
   431  		return resp.GetUptimeCheckIps(), resp.GetNextPageToken(), nil
   432  	}
   433  	fetch := func(pageSize int, pageToken string) (string, error) {
   434  		items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
   435  		if err != nil {
   436  			return "", err
   437  		}
   438  		it.items = append(it.items, items...)
   439  		return nextPageToken, nil
   440  	}
   441  
   442  	it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
   443  	it.pageInfo.MaxSize = int(req.GetPageSize())
   444  	it.pageInfo.Token = req.GetPageToken()
   445  
   446  	return it
   447  }
   448  

View as plain text