logging - ActiveState ActiveGo 1.8
...

Package logging

import "cloud.google.com/go/logging/apiv2"
Overview
Index
Examples

Overview ▾

Package logging is an experimental, auto-generated package for the logging API.

The Stackdriver Logging API lets you write log entries and manage your logs, log sinks and logs-based metrics.

Use the client at cloud.google.com/go/logging in preference to this.

Index ▾

func ConfigProjectPath(project string) string
func ConfigSinkPath(project, sink string) string
func DefaultAuthScopes() []string
func LoggingLogPath(project, log string) string
func LoggingProjectPath(project string) string
func MetricsMetricPath(project, metric string) string
func MetricsProjectPath(project string) string
type CallOptions
type Client
    func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
    func (c *Client) Close() error
    func (c *Client) Connection() *grpc.ClientConn
    func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error
    func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest, opts ...gax.CallOption) *LogEntryIterator
    func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator
    func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator
    func (c *Client) SetGoogleClientInfo(keyval ...string)
    func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest, opts ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error)
type ConfigCallOptions
type ConfigClient
    func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error)
    func (c *ConfigClient) Close() error
    func (c *ConfigClient) Connection() *grpc.ClientConn
    func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)
    func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error
    func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)
    func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator
    func (c *ConfigClient) SetGoogleClientInfo(keyval ...string)
    func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)
type LogEntryIterator
    func (it *LogEntryIterator) Next() (*loggingpb.LogEntry, error)
    func (it *LogEntryIterator) PageInfo() *iterator.PageInfo
type LogMetricIterator
    func (it *LogMetricIterator) Next() (*loggingpb.LogMetric, error)
    func (it *LogMetricIterator) PageInfo() *iterator.PageInfo
type LogSinkIterator
    func (it *LogSinkIterator) Next() (*loggingpb.LogSink, error)
    func (it *LogSinkIterator) PageInfo() *iterator.PageInfo
type MetricsCallOptions
type MetricsClient
    func NewMetricsClient(ctx context.Context, opts ...option.ClientOption) (*MetricsClient, error)
    func (c *MetricsClient) Close() error
    func (c *MetricsClient) Connection() *grpc.ClientConn
    func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)
    func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error
    func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)
    func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator
    func (c *MetricsClient) SetGoogleClientInfo(keyval ...string)
    func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)
type MonitoredResourceDescriptorIterator
    func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, error)
    func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo
type StringIterator
    func (it *StringIterator) Next() (string, error)
    func (it *StringIterator) PageInfo() *iterator.PageInfo

Package files

config_client.go doc.go logging_client.go metrics_client.go

func ConfigProjectPath

func ConfigProjectPath(project string) string

ConfigProjectPath returns the path for the project resource.

func ConfigSinkPath

func ConfigSinkPath(project, sink string) string

ConfigSinkPath returns the path for the sink resource.

func DefaultAuthScopes

func DefaultAuthScopes() []string

func LoggingLogPath

func LoggingLogPath(project, log string) string

LoggingLogPath returns the path for the log resource.

func LoggingProjectPath

func LoggingProjectPath(project string) string

LoggingProjectPath returns the path for the project resource.

func MetricsMetricPath

func MetricsMetricPath(project, metric string) string

MetricsMetricPath returns the path for the metric resource.

func MetricsProjectPath

func MetricsProjectPath(project string) string

MetricsProjectPath returns the path for the project resource.

type CallOptions

CallOptions contains the retry settings for each method of Client.

type CallOptions struct {
    DeleteLog                        []gax.CallOption
    WriteLogEntries                  []gax.CallOption
    ListLogEntries                   []gax.CallOption
    ListMonitoredResourceDescriptors []gax.CallOption
    ListLogs                         []gax.CallOption
}

type Client

Client is a client for interacting with Stackdriver Logging API.

type Client struct {

    // The call options for this service.
    CallOptions *CallOptions
    // contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new logging service v2 client.

Service for ingesting and querying logs.

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*Client) Connection

func (c *Client) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*Client) DeleteLog

func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error

DeleteLog deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.DeleteLogRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteLog(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*Client) ListLogEntries

func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest, opts ...gax.CallOption) *LogEntryIterator

ListLogEntries lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to export log entries, see [Exporting Logs](/logging/docs/export).

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.ListLogEntriesRequest{
// TODO: Fill request struct fields.
}
it := c.ListLogEntries(ctx, req)
for {
    resp, err := it.Next()
    if err != nil {
        // TODO: Handle error.
        break
    }
    // TODO: Use resp.
    _ = resp
}

func (*Client) ListLogs

func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator

ListLogs lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.ListLogsRequest{
// TODO: Fill request struct fields.
}
it := c.ListLogs(ctx, req)
for {
    resp, err := it.Next()
    if err != nil {
        // TODO: Handle error.
        break
    }
    // TODO: Use resp.
    _ = resp
}

func (*Client) ListMonitoredResourceDescriptors

func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator

ListMonitoredResourceDescriptors lists the descriptors for monitored resource types used by Stackdriver Logging.

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.ListMonitoredResourceDescriptorsRequest{
// TODO: Fill request struct fields.
}
it := c.ListMonitoredResourceDescriptors(ctx, req)
for {
    resp, err := it.Next()
    if err != nil {
        // TODO: Handle error.
        break
    }
    // TODO: Use resp.
    _ = resp
}

func (*Client) SetGoogleClientInfo

func (c *Client) SetGoogleClientInfo(keyval ...string)

SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.

func (*Client) WriteLogEntries

func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest, opts ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error)

WriteLogEntries writes log entries to Stackdriver Logging.

Example

Code:

ctx := context.Background()
c, err := logging.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.WriteLogEntriesRequest{
// TODO: Fill request struct fields.
}
resp, err := c.WriteLogEntries(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type ConfigCallOptions

ConfigCallOptions contains the retry settings for each method of ConfigClient.

type ConfigCallOptions struct {
    ListSinks  []gax.CallOption
    GetSink    []gax.CallOption
    CreateSink []gax.CallOption
    UpdateSink []gax.CallOption
    DeleteSink []gax.CallOption
}

type ConfigClient

ConfigClient is a client for interacting with Stackdriver Logging API.

type ConfigClient struct {

    // The call options for this service.
    CallOptions *ConfigCallOptions
    // contains filtered or unexported fields
}

func NewConfigClient

func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error)

NewConfigClient creates a new config service v2 client.

Service for configuring sinks used to export log entries outside of Stackdriver Logging.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*ConfigClient) Close

func (c *ConfigClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ConfigClient) Connection

func (c *ConfigClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*ConfigClient) CreateSink

func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)

CreateSink creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's `writer_identity` is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.CreateSinkRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateSink(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ConfigClient) DeleteSink

func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error

DeleteSink deletes a sink. If the sink has a unique `writer_identity`, then that service account is also deleted.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.DeleteSinkRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteSink(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*ConfigClient) GetSink

func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)

GetSink gets a sink.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.GetSinkRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetSink(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ConfigClient) ListSinks

func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator

ListSinks lists sinks.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.ListSinksRequest{
// TODO: Fill request struct fields.
}
it := c.ListSinks(ctx, req)
for {
    resp, err := it.Next()
    if err != nil {
        // TODO: Handle error.
        break
    }
    // TODO: Use resp.
    _ = resp
}

func (*ConfigClient) SetGoogleClientInfo

func (c *ConfigClient) SetGoogleClientInfo(keyval ...string)

SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.

func (*ConfigClient) UpdateSink

func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error)

UpdateSink updates a sink. If the named sink doesn't exist, then this method is identical to [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create). If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: `destination`, `filter`, `output_version_format`, `start_time`, and `end_time`. The updated filter might also have a new `writer_identity`; see the `unique_writer_identity` field.

Example

Code:

ctx := context.Background()
c, err := logging.NewConfigClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.UpdateSinkRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateSink(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type LogEntryIterator

LogEntryIterator manages a stream of *loggingpb.LogEntry.

type LogEntryIterator struct {

    // InternalFetch is for use by the Google Cloud Libraries only.
    // It is not part of the stable interface of this package.
    //
    // InternalFetch returns results from a single call to the underlying RPC.
    // The number of results is no greater than pageSize.
    // If there are no more results, nextPageToken is empty and err is nil.
    InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogEntry, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*LogEntryIterator) Next

func (it *LogEntryIterator) Next() (*loggingpb.LogEntry, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*LogEntryIterator) PageInfo

func (it *LogEntryIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type LogMetricIterator

LogMetricIterator manages a stream of *loggingpb.LogMetric.

type LogMetricIterator struct {

    // InternalFetch is for use by the Google Cloud Libraries only.
    // It is not part of the stable interface of this package.
    //
    // InternalFetch returns results from a single call to the underlying RPC.
    // The number of results is no greater than pageSize.
    // If there are no more results, nextPageToken is empty and err is nil.
    InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogMetric, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*LogMetricIterator) Next

func (it *LogMetricIterator) Next() (*loggingpb.LogMetric, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*LogMetricIterator) PageInfo

func (it *LogMetricIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type LogSinkIterator

LogSinkIterator manages a stream of *loggingpb.LogSink.

type LogSinkIterator struct {

    // InternalFetch is for use by the Google Cloud Libraries only.
    // It is not part of the stable interface of this package.
    //
    // InternalFetch returns results from a single call to the underlying RPC.
    // The number of results is no greater than pageSize.
    // If there are no more results, nextPageToken is empty and err is nil.
    InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogSink, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*LogSinkIterator) Next

func (it *LogSinkIterator) Next() (*loggingpb.LogSink, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*LogSinkIterator) PageInfo

func (it *LogSinkIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MetricsCallOptions

MetricsCallOptions contains the retry settings for each method of MetricsClient.

type MetricsCallOptions struct {
    ListLogMetrics  []gax.CallOption
    GetLogMetric    []gax.CallOption
    CreateLogMetric []gax.CallOption
    UpdateLogMetric []gax.CallOption
    DeleteLogMetric []gax.CallOption
}

type MetricsClient

MetricsClient is a client for interacting with Stackdriver Logging API.

type MetricsClient struct {

    // The call options for this service.
    CallOptions *MetricsCallOptions
    // contains filtered or unexported fields
}

func NewMetricsClient

func NewMetricsClient(ctx context.Context, opts ...option.ClientOption) (*MetricsClient, error)

NewMetricsClient creates a new metrics service v2 client.

Service for configuring logs-based metrics.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*MetricsClient) Close

func (c *MetricsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MetricsClient) Connection

func (c *MetricsClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*MetricsClient) CreateLogMetric

func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)

CreateLogMetric creates a logs-based metric.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.CreateLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateLogMetric(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*MetricsClient) DeleteLogMetric

func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error

DeleteLogMetric deletes a logs-based metric.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.DeleteLogMetricRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteLogMetric(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*MetricsClient) GetLogMetric

func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)

GetLogMetric gets a logs-based metric.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.GetLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetLogMetric(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*MetricsClient) ListLogMetrics

func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator

ListLogMetrics lists logs-based metrics.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.ListLogMetricsRequest{
// TODO: Fill request struct fields.
}
it := c.ListLogMetrics(ctx, req)
for {
    resp, err := it.Next()
    if err != nil {
        // TODO: Handle error.
        break
    }
    // TODO: Use resp.
    _ = resp
}

func (*MetricsClient) SetGoogleClientInfo

func (c *MetricsClient) SetGoogleClientInfo(keyval ...string)

SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.

func (*MetricsClient) UpdateLogMetric

func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error)

UpdateLogMetric creates or updates a logs-based metric.

Example

Code:

ctx := context.Background()
c, err := logging.NewMetricsClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &loggingpb.UpdateLogMetricRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateLogMetric(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type MonitoredResourceDescriptorIterator

MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor.

type MonitoredResourceDescriptorIterator struct {

    // InternalFetch is for use by the Google Cloud Libraries only.
    // It is not part of the stable interface of this package.
    //
    // InternalFetch returns results from a single call to the underlying RPC.
    // The number of results is no greater than pageSize.
    // If there are no more results, nextPageToken is empty and err is nil.
    InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResourceDescriptor, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*MonitoredResourceDescriptorIterator) Next

func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*MonitoredResourceDescriptorIterator) PageInfo

func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type StringIterator

StringIterator manages a stream of string.

type StringIterator struct {

    // InternalFetch is for use by the Google Cloud Libraries only.
    // It is not part of the stable interface of this package.
    //
    // InternalFetch returns results from a single call to the underlying RPC.
    // The number of results is no greater than pageSize.
    // If there are no more results, nextPageToken is empty and err is nil.
    InternalFetch func(pageSize int, pageToken string) (results []string, nextPageToken string, err error)
    // contains filtered or unexported fields
}

func (*StringIterator) Next

func (it *StringIterator) Next() (string, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*StringIterator) PageInfo

func (it *StringIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.