Documentation ¶
Overview ¶
Package config is an experimental, auto-generated package for the logging API.
The Google Cloud Logging API lets you write log entries and manage your logs, log sinks and logs-based metrics.
Index ¶
- Variables
- func ProjectPath(project string) string
- func SinkPath(project string, sink string) string
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateSink(ctx context.Context, req *google_logging_v2.CreateSinkRequest) (*google_logging_v2.LogSink, error)
- func (c *Client) DeleteSink(ctx context.Context, req *google_logging_v2.DeleteSinkRequest) error
- func (c *Client) GetSink(ctx context.Context, req *google_logging_v2.GetSinkRequest) (*google_logging_v2.LogSink, error)
- func (c *Client) ListSinks(ctx context.Context, req *google_logging_v2.ListSinksRequest) *LogSinkIterator
- func (c *Client) UpdateSink(ctx context.Context, req *google_logging_v2.UpdateSinkRequest) (*google_logging_v2.LogSink, error)
- type LogSinkIterator
- func (it *LogSinkIterator) Next() (*google_logging_v2.LogSink, error)
- func (it *LogSinkIterator) NextPage() ([]*google_logging_v2.LogSink, error)
- func (it *LogSinkIterator) NextPageToken() string
- func (it *LogSinkIterator) SetPageSize(pageSize int32)
- func (it *LogSinkIterator) SetPageToken(token string)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Done is returned by iterators on successful completion. Done = errors.New("iterator done") )
Functions ¶
func ProjectPath ¶
ProjectPath returns the path for the project resource.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with ConfigServiceV2.
func NewClient ¶
NewClient creates a new API service client.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" gax "github.com/googleapis/gax-go" "golang.org/x/net/context" ) func main() { ctx := context.Background() opts := []gax.ClientOption{ /* Optional client parameters. */ } c, err := config.NewClient(ctx, opts...) _, _ = c, err // Handle error. }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) CreateSink ¶
func (c *Client) CreateSink(ctx context.Context, req *google_logging_v2.CreateSinkRequest) (*google_logging_v2.LogSink, error)
CreateSink creates a sink.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" google_logging_v2 "github.com/googleapis/proto-client-go/logging/v2" "golang.org/x/net/context" ) func main() { ctx := context.Background() c, err := config.NewClient(ctx) _ = err // Handle error. req := &google_logging_v2.CreateSinkRequest{ /* Data... */ } var resp *google_logging_v2.LogSink resp, err = c.CreateSink(ctx, req) _, _ = resp, err // Handle error. }
Output:
func (*Client) DeleteSink ¶
func (c *Client) DeleteSink(ctx context.Context, req *google_logging_v2.DeleteSinkRequest) error
DeleteSink deletes a sink.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" google_logging_v2 "github.com/googleapis/proto-client-go/logging/v2" "golang.org/x/net/context" ) func main() { ctx := context.Background() c, err := config.NewClient(ctx) _ = err // Handle error. req := &google_logging_v2.DeleteSinkRequest{ /* Data... */ } err = c.DeleteSink(ctx, req) _ = err // Handle error. }
Output:
func (*Client) GetSink ¶
func (c *Client) GetSink(ctx context.Context, req *google_logging_v2.GetSinkRequest) (*google_logging_v2.LogSink, error)
GetSink gets a sink.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" google_logging_v2 "github.com/googleapis/proto-client-go/logging/v2" "golang.org/x/net/context" ) func main() { ctx := context.Background() c, err := config.NewClient(ctx) _ = err // Handle error. req := &google_logging_v2.GetSinkRequest{ /* Data... */ } var resp *google_logging_v2.LogSink resp, err = c.GetSink(ctx, req) _, _ = resp, err // Handle error. }
Output:
func (*Client) ListSinks ¶
func (c *Client) ListSinks(ctx context.Context, req *google_logging_v2.ListSinksRequest) *LogSinkIterator
ListSinks lists sinks.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" google_logging_v2 "github.com/googleapis/proto-client-go/logging/v2" "golang.org/x/net/context" ) func main() { ctx := context.Background() c, err := config.NewClient(ctx) _ = err // Handle error. req := &google_logging_v2.ListSinksRequest{ /* Data... */ } it := c.ListSinks(ctx, req) var resp *google_logging_v2.LogSink for { resp, err = it.Next() if err != nil { break } } _ = resp }
Output:
func (*Client) UpdateSink ¶
func (c *Client) UpdateSink(ctx context.Context, req *google_logging_v2.UpdateSinkRequest) (*google_logging_v2.LogSink, error)
UpdateSink creates or updates a sink.
Example ¶
package main import ( "cloud.google.com/go/logging/apiv2/config" google_logging_v2 "github.com/googleapis/proto-client-go/logging/v2" "golang.org/x/net/context" ) func main() { ctx := context.Background() c, err := config.NewClient(ctx) _ = err // Handle error. req := &google_logging_v2.UpdateSinkRequest{ /* Data... */ } var resp *google_logging_v2.LogSink resp, err = c.UpdateSink(ctx, req) _, _ = resp, err // Handle error. }
Output:
type LogSinkIterator ¶
type LogSinkIterator struct {
// contains filtered or unexported fields
}
LogSinkIterator manages a stream of *google_logging_v2.LogSink.
func (*LogSinkIterator) Next ¶
func (it *LogSinkIterator) Next() (*google_logging_v2.LogSink, error)
Next returns the next element in the stream. It returns Done at the end of the stream.
func (*LogSinkIterator) NextPage ¶
func (it *LogSinkIterator) NextPage() ([]*google_logging_v2.LogSink, error)
NextPage moves to the next page and updates its internal data. It returns Done if no more pages exist.
func (*LogSinkIterator) NextPageToken ¶
func (it *LogSinkIterator) NextPageToken() string
NextPageToken returns the next page token.
func (*LogSinkIterator) SetPageSize ¶
func (it *LogSinkIterator) SetPageSize(pageSize int32)
SetPageSize sets the maximum size of the next page to be retrieved.
func (*LogSinkIterator) SetPageToken ¶
func (it *LogSinkIterator) SetPageToken(token string)
SetPageToken sets the next page token to be retrieved. Note, it does not retrieve the next page, or modify the cached page. If Next is called, there is no guarantee that the result returned will be from the next page until NextPage is called.