Documentation
¶
Overview ¶
Package errorreporting is an auto-generated package for the Error Reporting API.
Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/errorreporting/apiv1beta1@latest
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := errorreporting.NewErrorGroupClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &errorreportingpb.GetGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/errorreporting/apiv1beta1/errorreportingpb#GetGroupRequest.
}
resp, err := c.GetGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
Use of Context ¶
The ctx passed to NewErrorGroupClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- func ErrorStatsProjectPath(project string) stringdeprecated
- func ReportErrorsProjectPath(project string) stringdeprecated
- func ResultPath(result string) stringdeprecated
- type ErrorEventIterator
- type ErrorGroupCallOptions
- type ErrorGroupClient
- func (c *ErrorGroupClient) Close() error
- func (c *ErrorGroupClient) Connection() *grpc.ClientConndeprecated
- func (c *ErrorGroupClient) GetGroup(ctx context.Context, req *errorreportingpb.GetGroupRequest, ...) (*errorreportingpb.ErrorGroup, error)
- func (c *ErrorGroupClient) SetGoogleClientInfo(keyval ...string)
- func (c *ErrorGroupClient) UpdateGroup(ctx context.Context, req *errorreportingpb.UpdateGroupRequest, ...) (*errorreportingpb.ErrorGroup, error)
- type ErrorGroupStatsIterator
- type ErrorStatsCallOptions
- type ErrorStatsClient
- func (c *ErrorStatsClient) Close() error
- func (c *ErrorStatsClient) Connection() *grpc.ClientConndeprecated
- func (c *ErrorStatsClient) DeleteEvents(ctx context.Context, req *errorreportingpb.DeleteEventsRequest, ...) (*errorreportingpb.DeleteEventsResponse, error)
- func (c *ErrorStatsClient) ListEvents(ctx context.Context, req *errorreportingpb.ListEventsRequest, ...) *ErrorEventIterator
- func (c *ErrorStatsClient) ListGroupStats(ctx context.Context, req *errorreportingpb.ListGroupStatsRequest, ...) *ErrorGroupStatsIterator
- func (c *ErrorStatsClient) SetGoogleClientInfo(keyval ...string)
- type ReportErrorsCallOptions
- type ReportErrorsClient
- func (c *ReportErrorsClient) Close() error
- func (c *ReportErrorsClient) Connection() *grpc.ClientConndeprecated
- func (c *ReportErrorsClient) ReportErrorEvent(ctx context.Context, req *errorreportingpb.ReportErrorEventRequest, ...) (*errorreportingpb.ReportErrorEventResponse, error)
- func (c *ReportErrorsClient) SetGoogleClientInfo(keyval ...string)
Examples ¶
- ErrorGroupClient.GetGroup
- ErrorGroupClient.UpdateGroup
- ErrorStatsClient.DeleteEvents
- ErrorStatsClient.ListEvents
- ErrorStatsClient.ListEvents (All)
- ErrorStatsClient.ListGroupStats
- ErrorStatsClient.ListGroupStats (All)
- NewErrorGroupClient
- NewErrorGroupRESTClient
- NewErrorStatsClient
- NewErrorStatsRESTClient
- NewReportErrorsClient
- NewReportErrorsRESTClient
- ReportErrorsClient.ReportErrorEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func ErrorStatsProjectPath
deprecated
func ReportErrorsProjectPath
deprecated
func ReportErrorsProjectPath(project string)