Documentation
¶
Overview ¶
Example (PublishAndReceiveCloudEvents) ¶
package main import ( "context" "encoding/json" "errors" "fmt" "os" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/messaging" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid" ) func main() { endpoint := os.Getenv("EVENTGRID_ENDPOINT") key := os.Getenv("EVENTGRID_KEY") topicName := os.Getenv("EVENTGRID_TOPIC") subscriptionName := os.Getenv("EVENTGRID_SUBSCRIPTION") if endpoint == "" || key == "" || topicName == "" || subscriptionName == "" { return } client, err := azeventgrid.NewClientWithSharedKeyCredential(endpoint, azcore.NewKeyCredential(key), nil) if err != nil { panic(err) } // // Publish an event with a string payload // fmt.Fprintf(os.Stderr, "Published event with a string payload 'hello world'\n") eventWithString, err := publishAndReceiveEvent(client, topicName, subscriptionName, "application/json", "hello world") if err != nil { panic(err) } fmt.Fprintf(os.Stderr, "Received an event with a string payload\n") fmt.Fprintf(os.Stderr, "ID: %s\n", eventWithString.Event.ID) var str *string if err := json.Unmarshal(eventWithString.Event.Data.([]byte), &str); err != nil { panic(err) } fmt.Fprintf(os.Stderr, " Body: %s\n", *str) // prints 'Body: hello world' fmt.Fprintf(os.Stderr, " Delivery count: %d\n", eventWithString.BrokerProperties.DeliveryCount) // // Publish an event with a []byte payload // eventWithBytes, err := publishAndReceiveEvent(client, topicName, subscriptionName, "application/octet-stream", []byte{0, 1, 2}) if err != nil { panic(err) } fmt.Fprintf(os.Stderr, "ID: %s\n", eventWithBytes.Event.ID) fmt.Fprintf(os.Stderr, " Body: %#v\n", eventWithBytes.Event.Data.([]byte)) // prints 'Body: []byte{0x0, 0x1, 0x2}' fmt.Fprintf(os.Stderr, " Delivery count: %d\n", eventWithBytes.BrokerProperties.DeliveryCount) // // Publish an event with a struct as the payload // type SampleData struct { Name string `json:"name"` } eventWithStruct, err := publishAndReceiveEvent(client, topicName, subscriptionName, "application/json", SampleData{Name: "hello"}) if err != nil { panic(err) } var sampleData *SampleData if err := json.Unmarshal(eventWithStruct.Event.Data.([]byte), &sampleData); err != nil { panic(err) } fmt.Fprintf(os.Stderr, "ID: %s\n", eventWithStruct.Event.ID) fmt.Fprintf(os.Stderr, " Body: %#v\n", sampleData) // prints 'Body: &azeventgrid_test.SampleData{Name:"hello"}' fmt.Fprintf(os.Stderr, " Delivery count: %d\n", eventWithStruct.BrokerProperties.DeliveryCount) } func publishAndReceiveEvent(client *azeventgrid.Client, topicName string, subscriptionName string, dataContentType string, payload any) (azeventgrid.ReceiveDetails, error) { event, err := messaging.NewCloudEvent("source", "eventType", payload, &messaging.CloudEventOptions{ DataContentType: &dataContentType, }) if err != nil { return azeventgrid.ReceiveDetails{}, err } eventsToSend := []messaging.CloudEvent{ event, } // NOTE: we're sending a single event as an example. For better efficiency it's best if you send // multiple events at a time. _, err = client.PublishCloudEvents(context.TODO(), topicName, eventsToSend, nil) if err != nil { return azeventgrid.ReceiveDetails{}, err } events, err := client.ReceiveCloudEvents(context.TODO(), topicName, subscriptionName, &azeventgrid.ReceiveCloudEventsOptions{ MaxEvents: to.Ptr(int32(1)), // Wait for 60 seconds for events. MaxWaitTime: to.Ptr[int32](60), }) if err != nil { return azeventgrid.ReceiveDetails{}, err } if len(events.Value) == 0 { return azeventgrid.ReceiveDetails{}, errors.New("no events received") } // We can (optionally) renew the lock (multiple times) if we want to continue to // extend the lock time on the event. _, err = client.RenewCloudEventLocks(context.TODO(), topicName, subscriptionName, []string{ *events.Value[0].BrokerProperties.LockToken, }, nil) if err != nil { return azeventgrid.ReceiveDetails{}, err } // This acknowledges the event and causes it to be deleted from the subscription. // Other options are: // - client.ReleaseCloudEvents, which invalidates our event lock and allows another subscriber to receive the event. // - client.RejectCloudEvents, which rejects the event. // If dead-lettering is configured, the event will be moved into the dead letter queue. // Otherwise the event is deleted. ackResp, err := client.AcknowledgeCloudEvents(context.TODO(), topicName, subscriptionName, []string{ *events.Value[0].BrokerProperties.LockToken, }, nil) if err != nil { return azeventgrid.ReceiveDetails{}, err } if len(ackResp.FailedLockTokens) > 0 { // some events failed when we tried to acknowledge them. for _, failed := range ackResp.FailedLockTokens { fmt.Printf("Failed to acknowledge event with lock token %s: %s\n", *failed.LockToken, failed.Error) } return azeventgrid.ReceiveDetails{}, errors.New("failed to acknowledge event") } return events.Value[0], nil }
Output:
Index ¶
- type AcknowledgeCloudEventsOptions
- type AcknowledgeCloudEventsResponse
- type AcknowledgeResult
- type BrokerProperties
- type Client
- func (client *Client) AcknowledgeCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, ...) (AcknowledgeCloudEventsResponse, error)
- func (client *Client) PublishCloudEvent(ctx context.Context, topicName string, event messaging.CloudEvent, ...) (PublishCloudEventResponse, error)
- func (client *Client) PublishCloudEvents(ctx context.Context, topicName string, events []messaging.CloudEvent, ...) (PublishCloudEventsResponse, error)
- func (client *Client) ReceiveCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, ...) (ReceiveCloudEventsResponse, error)
- func (client *Client) RejectCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, ...) (RejectCloudEventsResponse, error)
- func (client *Client) ReleaseCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, ...) (ReleaseCloudEventsResponse, error)
- func (client *Client) RenewCloudEventLocks(ctx context.Context, topicName string, eventSubscriptionName string, ...) (RenewCloudEventLocksResponse, error)
- type ClientOptions
- type Error
- type FailedLockToken
- type PublishCloudEventOptions
- type PublishCloudEventResponse
- type PublishCloudEventsOptions
- type PublishCloudEventsResponse
- type ReceiveCloudEventsOptions
- type ReceiveCloudEventsResponse
- type ReceiveDetails
- type ReceiveResult
- type RejectCloudEventsOptions
- type RejectCloudEventsResponse
- type RejectResult
- type ReleaseCloudEventsOptions
- type ReleaseCloudEventsResponse
- type ReleaseDelay
- type ReleaseResult
- type RenewCloudEventLocksOptions
- type RenewCloudEventLocksResponse
- type RenewCloudEventLocksResult
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgeCloudEventsOptions ¶
type AcknowledgeCloudEventsOptions struct { }
AcknowledgeCloudEventsOptions contains the optional parameters for the Client.AcknowledgeCloudEvents method.
type AcknowledgeCloudEventsResponse ¶
type AcknowledgeCloudEventsResponse struct { // The result of the Acknowledge operation. AcknowledgeResult }
AcknowledgeCloudEventsResponse contains the response from method Client.AcknowledgeCloudEvents.
type AcknowledgeResult ¶
type AcknowledgeResult struct { // REQUIRED; Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the // related error information (namely, the error code and description). FailedLockTokens []FailedLockToken // REQUIRED; Array of lock tokens for the successfully acknowledged cloud events. SucceededLockTokens []string }
AcknowledgeResult - The result of the Acknowledge operation.
func (AcknowledgeResult) MarshalJSON ¶
func (a AcknowledgeResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AcknowledgeResult.
func (*AcknowledgeResult) UnmarshalJSON ¶
func (a *AcknowledgeResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AcknowledgeResult.
type BrokerProperties ¶
type BrokerProperties struct { // REQUIRED; The attempt count for delivering the event. DeliveryCount *int32 // REQUIRED; The token of the lock on the event. LockToken *string }
BrokerProperties - Properties of the Event Broker operation.
func (BrokerProperties) MarshalJSON ¶
func (b BrokerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BrokerProperties.
func (*BrokerProperties) UnmarshalJSON ¶
func (b *BrokerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BrokerProperties.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the methods for the Client group. Don't use this type directly, use a constructor function instead.
func NewClientWithSharedKeyCredential ¶
func NewClientWithSharedKeyCredential(endpoint string, keyCred *azcore.KeyCredential, options *ClientOptions) (*Client, error)
NewClientWithSharedKeyCredential creates a Client using a shared key.
func (*Client) AcknowledgeCloudEvents ¶
func (client *Client) AcknowledgeCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, lockTokens []string, options *AcknowledgeCloudEventsOptions) (AcknowledgeCloudEventsResponse, error)
AcknowledgeCloudEvents - Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- eventSubscriptionName - Event Subscription Name.
- lockTokens - slice of lock tokens.
- options - AcknowledgeCloudEventsOptions contains the optional parameters for the Client.AcknowledgeCloudEvents method.
func (*Client) PublishCloudEvent ¶ added in v0.4.0
func (client *Client) PublishCloudEvent(ctx context.Context, topicName string, event messaging.CloudEvent, options *PublishCloudEventOptions) (PublishCloudEventResponse, error)
PublishCloudEvent - Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- event - Single Cloud Event being published.
- options - PublishCloudEventOptions contains the optional parameters for the Client.PublishCloudEvent method.
func (*Client) PublishCloudEvents ¶
func (client *Client) PublishCloudEvents(ctx context.Context, topicName string, events []messaging.CloudEvent, options *PublishCloudEventsOptions) (PublishCloudEventsResponse, error)
PublishCloudEvents - Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- events - Array of Cloud Events being published.
- options - PublishCloudEventsOptions contains the optional parameters for the Client.PublishCloudEvents method.
Example ¶
package main import ( "context" "log" "os" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/messaging" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid" ) func main() { client := getEventGridClient() if client == nil { return } topic := os.Getenv("EVENTGRID_TOPIC") // CloudEvent is in github.com/Azure/azure-sdk-for-go/azcore/messaging and can be // used to transport // you can send a variety of different payloads, all of which can be encoded by messaging.CloudEvent var payloads = []any{ []byte{1, 2, 3}, "hello world", struct{ Value string }{Value: "hello world"}, } var eventsToSend []messaging.CloudEvent for _, payload := range payloads { event, err := messaging.NewCloudEvent("source", "eventType", payload, &messaging.CloudEventOptions{ DataContentType: to.Ptr("application/octet-stream"), }) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } eventsToSend = append(eventsToSend, event) } _, err := client.PublishCloudEvents(context.TODO(), topic, eventsToSend, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } } func getEventGridClient() *azeventgrid.Client { endpoint := os.Getenv("EVENTGRID_ENDPOINT") sharedKey := os.Getenv("EVENTGRID_KEY") if endpoint == "" || sharedKey == "" { return nil } client, err := azeventgrid.NewClientWithSharedKeyCredential(endpoint, azcore.NewKeyCredential(sharedKey), nil) if err != nil { log.Fatalf("ERROR: %s", err) } return client }
Output:
func (*Client) ReceiveCloudEvents ¶
func (client *Client) ReceiveCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, options *ReceiveCloudEventsOptions) (ReceiveCloudEventsResponse, error)
ReceiveCloudEvents - Receive Batch of Cloud Events from the Event Subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- eventSubscriptionName - Event Subscription Name.
- options - ReceiveCloudEventsOptions contains the optional parameters for the Client.ReceiveCloudEvents method.
Example ¶
package main import ( "context" "fmt" "log" "os" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid" ) func main() { client := getEventGridClient() if client == nil { return } topic := os.Getenv("EVENTGRID_TOPIC") subscription := os.Getenv("EVENTGRID_SUBSCRIPTION") resp, err := client.ReceiveCloudEvents(context.TODO(), topic, subscription, &azeventgrid.ReceiveCloudEventsOptions{ MaxEvents: to.Ptr[int32](1), MaxWaitTime: to.Ptr[int32](10), // in seconds }) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } for _, rd := range resp.Value { lockToken := rd.BrokerProperties.LockToken // NOTE: See the documentation for CloudEvent.Data on how your data // is deserialized. data := rd.Event.Data fmt.Fprintf(os.Stderr, "Event ID:%s, data: %#v, lockToken: %s\n", rd.Event.ID, data, *lockToken) // This will complete the message, deleting it from the subscription. resp, err := client.AcknowledgeCloudEvents(context.TODO(), topic, subscription, []string{*lockToken}, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } if len(resp.FailedLockTokens) > 0 { log.Fatalf("ERROR: %d events were not acknowledged", len(resp.FailedLockTokens)) } } } func getEventGridClient() *azeventgrid.Client { endpoint := os.Getenv("EVENTGRID_ENDPOINT") sharedKey := os.Getenv("EVENTGRID_KEY") if endpoint == "" || sharedKey == "" { return nil } client, err := azeventgrid.NewClientWithSharedKeyCredential(endpoint, azcore.NewKeyCredential(sharedKey), nil) if err != nil { log.Fatalf("ERROR: %s", err) } return client }
Output:
func (*Client) RejectCloudEvents ¶
func (client *Client) RejectCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, lockTokens []string, options *RejectCloudEventsOptions) (RejectCloudEventsResponse, error)
RejectCloudEvents - Reject batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully rejected lockTokens, along with other failed lockTokens with their corresponding error information. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- eventSubscriptionName - Event Subscription Name.
- lockTokens - slice of lock tokens.
- options - RejectCloudEventsOptions contains the optional parameters for the Client.RejectCloudEvents method.
func (*Client) ReleaseCloudEvents ¶
func (client *Client) ReleaseCloudEvents(ctx context.Context, topicName string, eventSubscriptionName string, lockTokens []string, options *ReleaseCloudEventsOptions) (ReleaseCloudEventsResponse, error)
ReleaseCloudEvents - Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- eventSubscriptionName - Event Subscription Name.
- lockTokens - slice of lock tokens.
- options - ReleaseCloudEventsOptions contains the optional parameters for the Client.ReleaseCloudEvents method.
func (*Client) RenewCloudEventLocks ¶ added in v0.4.0
func (client *Client) RenewCloudEventLocks(ctx context.Context, topicName string, eventSubscriptionName string, lockTokens []string, options *RenewCloudEventLocksOptions) (RenewCloudEventLocksResponse, error)
RenewCloudEventLocks - Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-01-preview
- topicName - Topic Name.
- eventSubscriptionName - Event Subscription Name.
- lockTokens - slice of lock tokens.
- options - RenewCloudEventLocksOptions contains the optional parameters for the Client.RenewCloudEventLocks method.
type ClientOptions ¶
type ClientOptions struct {
azcore.ClientOptions
}
ClientOptions contains optional settings for Client
type Error ¶ added in v0.4.0
type Error struct { // REQUIRED; One of a server-defined set of error codes. Code *string // contains filtered or unexported fields }
Error - The error object.
func (*Error) Error ¶ added in v0.4.0
Error implements the error interface for type Error. Note that the message contents are not contractual and can change over time.
func (Error) MarshalJSON ¶ added in v0.4.0
MarshalJSON implements the json.Marshaller interface for type Error.
func (*Error) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON implements the json.Unmarshaller interface for type Error.
type FailedLockToken ¶
type FailedLockToken struct { // REQUIRED; Error information of the failed operation result for the lock token in the request. Error *Error // REQUIRED; The lock token of an entry in the request. LockToken *string }
FailedLockToken - Failed LockToken information.
func (FailedLockToken) MarshalJSON ¶
func (f FailedLockToken) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FailedLockToken.
func (*FailedLockToken) UnmarshalJSON ¶
func (f *FailedLockToken) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FailedLockToken.
type PublishCloudEventOptions ¶ added in v0.4.0
type PublishCloudEventOptions struct { }
PublishCloudEventOptions contains the optional parameters for the Client.PublishCloudEvent method.
type PublishCloudEventResponse ¶ added in v0.4.0
type PublishCloudEventResponse struct { }
PublishCloudEventResponse contains the response from method Client.PublishCloudEvent.
type PublishCloudEventsOptions ¶
type PublishCloudEventsOptions struct { }
PublishCloudEventsOptions contains the optional parameters for the Client.PublishCloudEvents method.
type PublishCloudEventsResponse ¶
type PublishCloudEventsResponse struct { }
PublishCloudEventsResponse contains the response from method Client.PublishCloudEvents.
type ReceiveCloudEventsOptions ¶
type ReceiveCloudEventsOptions struct { // Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value // is 1. MaxEvents *int32 // Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for // the availability of an event and responds to the request. If an event is // available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. // If not specified, the default value is 60 seconds. MaxWaitTime *int32 }
ReceiveCloudEventsOptions contains the optional parameters for the Client.ReceiveCloudEvents method.
type ReceiveCloudEventsResponse ¶
type ReceiveCloudEventsResponse struct { // Details of the Receive operation response. ReceiveResult }
ReceiveCloudEventsResponse contains the response from method Client.ReceiveCloudEvents.
type ReceiveDetails ¶
type ReceiveDetails struct { // REQUIRED; The Event Broker details. BrokerProperties *BrokerProperties // REQUIRED; Cloud Event details. Event messaging.CloudEvent }
ReceiveDetails - Receive operation details per Cloud Event.
func (ReceiveDetails) MarshalJSON ¶
func (r ReceiveDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReceiveDetails.
func (*ReceiveDetails) UnmarshalJSON ¶
func (r *ReceiveDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReceiveDetails.
type ReceiveResult ¶
type ReceiveResult struct { // REQUIRED; Array of receive responses, one per cloud event. Value []ReceiveDetails }
ReceiveResult - Details of the Receive operation response.
func (ReceiveResult) MarshalJSON ¶
func (r ReceiveResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReceiveResult.
func (*ReceiveResult) UnmarshalJSON ¶
func (r *ReceiveResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReceiveResult.
type RejectCloudEventsOptions ¶
type RejectCloudEventsOptions struct { }
RejectCloudEventsOptions contains the optional parameters for the Client.RejectCloudEvents method.
type RejectCloudEventsResponse ¶
type RejectCloudEventsResponse struct { // The result of the Reject operation. RejectResult }
RejectCloudEventsResponse contains the response from method Client.RejectCloudEvents.
type RejectResult ¶
type RejectResult struct { // REQUIRED; Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the // related error information (namely, the error code and description). FailedLockTokens []FailedLockToken // REQUIRED; Array of lock tokens for the successfully rejected cloud events. SucceededLockTokens []string }
RejectResult - The result of the Reject operation.
func (RejectResult) MarshalJSON ¶
func (r RejectResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RejectResult.
func (*RejectResult) UnmarshalJSON ¶
func (r *RejectResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RejectResult.
type ReleaseCloudEventsOptions ¶
type ReleaseCloudEventsOptions struct { // Release cloud events with the specified delay in seconds. ReleaseDelayInSeconds *ReleaseDelay }
ReleaseCloudEventsOptions contains the optional parameters for the Client.ReleaseCloudEvents method.
type ReleaseCloudEventsResponse ¶
type ReleaseCloudEventsResponse struct { // The result of the Release operation. ReleaseResult }
ReleaseCloudEventsResponse contains the response from method Client.ReleaseCloudEvents.
type ReleaseDelay ¶ added in v0.4.0
type ReleaseDelay int32
ReleaseDelay indicates how long the service should delay before releasing an event.
const ( // ReleaseDelayBy0Seconds - Release the event after 0 seconds. ReleaseDelayBy0Seconds ReleaseDelay = 0 // ReleaseDelayBy10Seconds - Release the event after 10 seconds. ReleaseDelayBy10Seconds ReleaseDelay = 10 // ReleaseDelayBy3600Seconds - Release the event after 3600 seconds. ReleaseDelayBy3600Seconds ReleaseDelay = 3600 // ReleaseDelayBy600Seconds - Release the event after 600 seconds. ReleaseDelayBy600Seconds ReleaseDelay = 600 // ReleaseDelayBy60Seconds - Release the event after 60 seconds. ReleaseDelayBy60Seconds ReleaseDelay = 60 )
func PossibleReleaseDelayValues ¶ added in v0.4.0
func PossibleReleaseDelayValues() []ReleaseDelay
PossibleReleaseDelayValues returns the possible values for the ReleaseDelay const type.
type ReleaseResult ¶
type ReleaseResult struct { // REQUIRED; Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the // related error information (namely, the error code and description). FailedLockTokens []FailedLockToken // REQUIRED; Array of lock tokens for the successfully released cloud events. SucceededLockTokens []string }
ReleaseResult - The result of the Release operation.
func (ReleaseResult) MarshalJSON ¶
func (r ReleaseResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReleaseResult.
func (*ReleaseResult) UnmarshalJSON ¶
func (r *ReleaseResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReleaseResult.
type RenewCloudEventLocksOptions ¶ added in v0.4.0
type RenewCloudEventLocksOptions struct { }
RenewCloudEventLocksOptions contains the optional parameters for the Client.RenewCloudEventLocks method.
type RenewCloudEventLocksResponse ¶ added in v0.4.0
type RenewCloudEventLocksResponse struct { // The result of the RenewLock operation. RenewCloudEventLocksResult }
RenewCloudEventLocksResponse contains the response from method Client.RenewCloudEventLocks.
type RenewCloudEventLocksResult ¶ added in v0.4.0
type RenewCloudEventLocksResult struct { // REQUIRED; Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the // related error information (namely, the error code and description). FailedLockTokens []FailedLockToken // REQUIRED; Array of lock tokens for the successfully renewed locks. SucceededLockTokens []string }
RenewCloudEventLocksResult - The result of the RenewLock operation.
func (RenewCloudEventLocksResult) MarshalJSON ¶ added in v0.4.0
func (r RenewCloudEventLocksResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewCloudEventLocksResult.
func (*RenewCloudEventLocksResult) UnmarshalJSON ¶ added in v0.4.0
func (r *RenewCloudEventLocksResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewCloudEventLocksResult.