Documentation ¶
Index ¶
- Variables
- type AckInfo
- type AckRequest
- type AckResponse
- type AckStatus
- type AckStatus_StatusCode
- func (AckStatus_StatusCode) Descriptor() protoreflect.EnumDescriptor
- func (x AckStatus_StatusCode) Enum() *AckStatus_StatusCode
- func (AckStatus_StatusCode) EnumDescriptor() ([]byte, []int)deprecated
- func (x AckStatus_StatusCode) Number() protoreflect.EnumNumber
- func (x AckStatus_StatusCode) String() string
- func (AckStatus_StatusCode) Type() protoreflect.EnumType
- type DurableQueue
- type Identifier
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)deprecated
- func (x *Metadata) GetAckInfo() *AckInfo
- func (x *Metadata) GetIdentifier() *Identifier
- func (x *Metadata) GetIsRedelivered() bool
- func (x *Metadata) GetTimestamp() *timestamppb.Timestamp
- func (*Metadata) ProtoMessage()
- func (x *Metadata) ProtoReflect() protoreflect.Message
- func (x *Metadata) Reset()
- func (x *Metadata) String() string
- type RegularStream
- type StreamConfiguration
- func (*StreamConfiguration) Descriptor() ([]byte, []int)deprecated
- func (m *StreamConfiguration) GetAcknowledgeOption() isStreamConfiguration_AcknowledgeOption
- func (x *StreamConfiguration) GetCustomAckTimeout() *durationpb.Duration
- func (x *StreamConfiguration) GetDisableExplicitAck() *emptypb.Empty
- func (x *StreamConfiguration) GetDurableQueue() *DurableQueue
- func (x *StreamConfiguration) GetMaxInFlight() uint32
- func (x *StreamConfiguration) GetRegular() *RegularStream
- func (x *StreamConfiguration) GetStartAtId() uint64
- func (x *StreamConfiguration) GetStartAtNew() *emptypb.Empty
- func (x *StreamConfiguration) GetStartAtOldestPossible() *emptypb.Empty
- func (x *StreamConfiguration) GetStartAtTimestamp() *timestamppb.Timestamp
- func (m *StreamConfiguration) GetStartPosition() isStreamConfiguration_StartPosition
- func (m *StreamConfiguration) GetStreamType() isStreamConfiguration_StreamType
- func (*StreamConfiguration) ProtoMessage()
- func (x *StreamConfiguration) ProtoReflect() protoreflect.Message
- func (x *StreamConfiguration) Reset()
- func (x *StreamConfiguration) String() string
- type StreamConfiguration_CustomAckTimeout
- type StreamConfiguration_DisableExplicitAck
- type StreamConfiguration_DurableQueue
- type StreamConfiguration_Regular
- type StreamConfiguration_StartAtId
- type StreamConfiguration_StartAtNew
- type StreamConfiguration_StartAtOldestPossible
- type StreamConfiguration_StartAtTimestamp
Constants ¶
This section is empty.
Variables ¶
var ( AckStatus_StatusCode_name = map[int32]string{ 0: "STATUS_CODE_UNSPECIFIED", 1: "STATUS_CODE_FAILURE", 2: "STATUS_CODE_SUCCESS", } AckStatus_StatusCode_value = map[string]int32{ "STATUS_CODE_UNSPECIFIED": 0, "STATUS_CODE_FAILURE": 1, "STATUS_CODE_SUCCESS": 2, } )
Enum value maps for AckStatus_StatusCode.
var File_wgtwo_events_v1_events_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AckInfo ¶
type AckInfo struct { // Opaque string that must be included in the ack request to identify the event Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
This contains a opaque string which must be included in the ack request to identify the event
func (*AckInfo) Descriptor
deprecated
func (*AckInfo) ProtoMessage ¶
func (*AckInfo) ProtoMessage()
func (*AckInfo) ProtoReflect ¶
func (x *AckInfo) ProtoReflect() protoreflect.Message
type AckRequest ¶
type AckRequest struct { // Information that must be included in the ack request to identify the event AckInfo *AckInfo `protobuf:"bytes,1,opt,name=ack_info,json=ackInfo,proto3" json:"ack_info,omitempty"` // contains filtered or unexported fields }
Ack request, which is required for sending a ack of an event
func (*AckRequest) Descriptor
deprecated
func (*AckRequest) Descriptor() ([]byte, []int)
Deprecated: Use AckRequest.ProtoReflect.Descriptor instead.
func (*AckRequest) GetAckInfo ¶
func (x *AckRequest) GetAckInfo() *AckInfo
func (*AckRequest) ProtoMessage ¶
func (*AckRequest) ProtoMessage()
func (*AckRequest) ProtoReflect ¶
func (x *AckRequest) ProtoReflect() protoreflect.Message
func (*AckRequest) Reset ¶
func (x *AckRequest) Reset()
func (*AckRequest) String ¶
func (x *AckRequest) String() string
type AckResponse ¶
type AckResponse struct { // If the ack request was successful or not AckStatus *AckStatus `protobuf:"bytes,1,opt,name=ack_status,json=ackStatus,proto3" json:"ack_status,omitempty"` // contains filtered or unexported fields }
This response includes the status of the ack request
func (*AckResponse) Descriptor
deprecated
func (*AckResponse) Descriptor() ([]byte, []int)
Deprecated: Use AckResponse.ProtoReflect.Descriptor instead.
func (*AckResponse) GetAckStatus ¶
func (x *AckResponse) GetAckStatus() *AckStatus
func (*AckResponse) ProtoMessage ¶
func (*AckResponse) ProtoMessage()
func (*AckResponse) ProtoReflect ¶
func (x *AckResponse) ProtoReflect() protoreflect.Message
func (*AckResponse) Reset ¶
func (x *AckResponse) Reset()
func (*AckResponse) String ¶
func (x *AckResponse) String() string
type AckStatus ¶
type AckStatus struct { // Status of the ack request StatusCode AckStatus_StatusCode `` /* 134-byte string literal not displayed */ // contains filtered or unexported fields }
Status of the ack request
If status is not successful, the ack request may be retried. Everything except AckStatusCodeACK_STATUS_SUCCESS should be treated as a failure
func (*AckStatus) Descriptor
deprecated
func (*AckStatus) GetStatusCode ¶
func (x *AckStatus) GetStatusCode() AckStatus_StatusCode
func (*AckStatus) ProtoMessage ¶
func (*AckStatus) ProtoMessage()
func (*AckStatus) ProtoReflect ¶
func (x *AckStatus) ProtoReflect() protoreflect.Message
type AckStatus_StatusCode ¶
type AckStatus_StatusCode int32
Status of the ack request enum
const ( // Unspecified status code; it's a server error if this is returned AckStatus_STATUS_CODE_UNSPECIFIED AckStatus_StatusCode = 0 // The ack request failed AckStatus_STATUS_CODE_FAILURE AckStatus_StatusCode = 1 // The ack request was successful AckStatus_STATUS_CODE_SUCCESS AckStatus_StatusCode = 2 )
func (AckStatus_StatusCode) Descriptor ¶
func (AckStatus_StatusCode) Descriptor() protoreflect.EnumDescriptor
func (AckStatus_StatusCode) Enum ¶
func (x AckStatus_StatusCode) Enum() *AckStatus_StatusCode
func (AckStatus_StatusCode) EnumDescriptor
deprecated
func (AckStatus_StatusCode) EnumDescriptor() ([]byte, []int)
Deprecated: Use AckStatus_StatusCode.Descriptor instead.
func (AckStatus_StatusCode) Number ¶
func (x AckStatus_StatusCode) Number() protoreflect.EnumNumber
func (AckStatus_StatusCode) String ¶
func (x AckStatus_StatusCode) String() string
func (AckStatus_StatusCode) Type ¶
func (AckStatus_StatusCode) Type() protoreflect.EnumType
type DurableQueue ¶
type DurableQueue struct { // Optional: Messages will by default be shared between all connections using the same OAuth 2.0 client CustomName string `protobuf:"bytes,1,opt,name=custom_name,json=customName,proto3" json:"custom_name,omitempty"` // contains filtered or unexported fields }
All connected clients with the same name will share the stream, so that an event will only be seen be a single client.
The server will store the clients reading position for 1 hour after the client has disconnected. That would make it possible for a client to resume reading after it has been disconnected.
If e.g. five group of clients should see all events in the stream, each group must be given a unique name.
func (*DurableQueue) Descriptor
deprecated
func (*DurableQueue) Descriptor() ([]byte, []int)
Deprecated: Use DurableQueue.ProtoReflect.Descriptor instead.
func (*DurableQueue) GetCustomName ¶
func (x *DurableQueue) GetCustomName() string
func (*DurableQueue) ProtoMessage ¶
func (*DurableQueue) ProtoMessage()
func (*DurableQueue) ProtoReflect ¶
func (x *DurableQueue) ProtoReflect() protoreflect.Message
func (*DurableQueue) Reset ¶
func (x *DurableQueue) Reset()
func (*DurableQueue) String ¶
func (x *DurableQueue) String() string
type Identifier ¶
type Identifier struct { // The subscription identifier SubscriptionIdentifier *v1.SubscriptionIdentifier `` /* 127-byte string literal not displayed */ // contains filtered or unexported fields }
Identity of the subscription this event was generated for.
func (*Identifier) Descriptor
deprecated
func (*Identifier) Descriptor() ([]byte, []int)
Deprecated: Use Identifier.ProtoReflect.Descriptor instead.
func (*Identifier) GetSubscriptionIdentifier ¶
func (x *Identifier) GetSubscriptionIdentifier() *v1.SubscriptionIdentifier
func (*Identifier) ProtoMessage ¶
func (*Identifier) ProtoMessage()
func (*Identifier) ProtoReflect ¶
func (x *Identifier) ProtoReflect() protoreflect.Message
func (*Identifier) Reset ¶
func (x *Identifier) Reset()
func (*Identifier) String ¶
func (x *Identifier) String() string
type Metadata ¶
type Metadata struct { // The timestamp this event was generated Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Identity of the subscription this event was generated for. Identifier *Identifier `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` // Information that must be included in the ack request to identify the event AckInfo *AckInfo `protobuf:"bytes,3,opt,name=ack_info,json=ackInfo,proto3" json:"ack_info,omitempty"` // True when this is not the first time the message has been sent IsRedelivered bool `protobuf:"varint,4,opt,name=is_redelivered,json=isRedelivered,proto3" json:"is_redelivered,omitempty"` // contains filtered or unexported fields }
Metadata about the event
func (*Metadata) Descriptor
deprecated
func (*Metadata) GetAckInfo ¶
func (*Metadata) GetIdentifier ¶
func (x *Metadata) GetIdentifier() *Identifier
func (*Metadata) GetIsRedelivered ¶
func (*Metadata) GetTimestamp ¶
func (x *Metadata) GetTimestamp() *timestamppb.Timestamp
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type RegularStream ¶
type RegularStream struct {
// contains filtered or unexported fields
}
All connected clients will see all events in the stream. Reading position is not stored at the server, so disconnecting will make it start fresh.
func (*RegularStream) Descriptor
deprecated
func (*RegularStream) Descriptor() ([]byte, []int)
Deprecated: Use RegularStream.ProtoReflect.Descriptor instead.
func (*RegularStream) ProtoMessage ¶
func (*RegularStream) ProtoMessage()
func (*RegularStream) ProtoReflect ¶
func (x *RegularStream) ProtoReflect() protoreflect.Message
func (*RegularStream) Reset ¶
func (x *RegularStream) Reset()
func (*RegularStream) String ¶
func (x *RegularStream) String() string
type StreamConfiguration ¶
type StreamConfiguration struct { // Optional: Will use DurableQueue by default // // Types that are assignable to StreamType: // // *StreamConfiguration_Regular // *StreamConfiguration_DurableQueue StreamType isStreamConfiguration_StreamType `protobuf_oneof:"stream_type"` // Optional: By default, the client is required to send a ack message and will use a timeout of 30 seconds. // // Types that are assignable to AcknowledgeOption: // // *StreamConfiguration_DisableExplicitAck // *StreamConfiguration_CustomAckTimeout AcknowledgeOption isStreamConfiguration_AcknowledgeOption `protobuf_oneof:"acknowledge_option"` // Optional: By default, max 50 unacknowledged events may be in-flight // Must be between 1 and 200 MaxInFlight uint32 `protobuf:"varint,5,opt,name=max_in_flight,json=maxInFlight,proto3" json:"max_in_flight,omitempty"` // Optional: By default, only new events will be included // // Types that are assignable to StartPosition: // // *StreamConfiguration_StartAtNew // *StreamConfiguration_StartAtId // *StreamConfiguration_StartAtTimestamp // *StreamConfiguration_StartAtOldestPossible StartPosition isStreamConfiguration_StartPosition `protobuf_oneof:"start_position"` // contains filtered or unexported fields }
This is the configuration for setting up a event stream from our APIs.
The client will be forced to reconnect after one hour to ensure it is using fresh access tokens.
The default settings should be well suited for production usage, but 'max_in_flight' may be tweaked.
Regular:
Warning: This is intended for testing purposes only and is not recommended for production. All connected clients will see all events in the stream. Reading position is not stored at the server, so disconnecting will make it start fresh.
Durable Queue:
All connected clients with the same name will share the stream, so that an event will only be seen be a single client. The server will store the clients reading position for 1 hour after the client has disconnected. That would make it possible for a client to resume reading after it has been disconnected. Note: - The custom_name is namespaced to be per OAuth 2.0 client, so using the same name for two different OAuth 2.0 clients will not make them part of the same stream. Example: Giving the following configuration, you may get approximately the distribution shown below: 3 × custom_name = "" (default) 2 × custom_name = "alice" 1 × custom_name = "bob" ┌─►33 % ─► "" ─ ─ ──┼─►33 % ─► "" └─►33 % ─► "" ─ ─ ──┬─►50 % ─► "alice" └─►50 % ─► "alice" ─ ─ ────►100 ──► "bob"
Acknowledge:
The server will for the client to sent a ack message. If no such message has been received within 30 seconds, the event will be resent.
Max in-flight:
The server will only allow, by default, 50 in-flight unacknowledged events. In combination with requiring acks, this allows the client to apply some backpressure. Note that max in-flight > 1 may cause events to be received out-of-order, something the client must design for.
Start Position:
This decides the policy used when a client connects without having its reading position stored at the server. The start position may be set to - only include new events (events created after connection) - a specific ID - starting at a given time - deliver all available events
All settings are optional, with the following set as default:
- Events are load balanced between all connected clients using the same OAuth 2.0 client
Current reading position is remembered on the server for 1 hour, even if no clients are connected That is, reading may resume even if the clients needs to disconnect
The clients needs to send a ack after processing a event If a client does not ack within 30 seconds, the event will be resent
- 50 un-acknowledged events will be allowed at once
- If reading position is not stored in server, that is on first connection or if all clients has been gone for 30 minutes, only new events will be included.
func (*StreamConfiguration) Descriptor
deprecated
func (*StreamConfiguration) Descriptor() ([]byte, []int)
Deprecated: Use StreamConfiguration.ProtoReflect.Descriptor instead.
func (*StreamConfiguration) GetAcknowledgeOption ¶
func (m *StreamConfiguration) GetAcknowledgeOption() isStreamConfiguration_AcknowledgeOption
func (*StreamConfiguration) GetCustomAckTimeout ¶
func (x *StreamConfiguration) GetCustomAckTimeout() *durationpb.Duration
func (*StreamConfiguration) GetDisableExplicitAck ¶
func (x *StreamConfiguration) GetDisableExplicitAck() *emptypb.Empty
func (*StreamConfiguration) GetDurableQueue ¶
func (x *StreamConfiguration) GetDurableQueue() *DurableQueue
func (*StreamConfiguration) GetMaxInFlight ¶
func (x *StreamConfiguration) GetMaxInFlight() uint32
func (*StreamConfiguration) GetRegular ¶
func (x *StreamConfiguration) GetRegular() *RegularStream
func (*StreamConfiguration) GetStartAtId ¶
func (x *StreamConfiguration) GetStartAtId() uint64
func (*StreamConfiguration) GetStartAtNew ¶
func (x *StreamConfiguration) GetStartAtNew() *emptypb.Empty
func (*StreamConfiguration) GetStartAtOldestPossible ¶
func (x *StreamConfiguration) GetStartAtOldestPossible() *emptypb.Empty
func (*StreamConfiguration) GetStartAtTimestamp ¶
func (x *StreamConfiguration) GetStartAtTimestamp() *timestamppb.Timestamp
func (*StreamConfiguration) GetStartPosition ¶
func (m *StreamConfiguration) GetStartPosition() isStreamConfiguration_StartPosition
func (*StreamConfiguration) GetStreamType ¶
func (m *StreamConfiguration) GetStreamType() isStreamConfiguration_StreamType
func (*StreamConfiguration) ProtoMessage ¶
func (*StreamConfiguration) ProtoMessage()
func (*StreamConfiguration) ProtoReflect ¶
func (x *StreamConfiguration) ProtoReflect() protoreflect.Message
func (*StreamConfiguration) Reset ¶
func (x *StreamConfiguration) Reset()
func (*StreamConfiguration) String ¶
func (x *StreamConfiguration) String() string
type StreamConfiguration_CustomAckTimeout ¶
type StreamConfiguration_CustomAckTimeout struct { // Must be between 10 seconds and 10 minutes CustomAckTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=custom_ack_timeout,json=customAckTimeout,proto3,oneof"` }
type StreamConfiguration_DurableQueue ¶
type StreamConfiguration_DurableQueue struct { // Remembers message position, resumes receiving messages after disconnection within a permissible time frame. DurableQueue *DurableQueue `protobuf:"bytes,2,opt,name=durable_queue,json=durableQueue,proto3,oneof"` }
type StreamConfiguration_Regular ¶
type StreamConfiguration_Regular struct { // Receives messages only while connected; misses messages published when disconnected. Regular *RegularStream `protobuf:"bytes,1,opt,name=regular,proto3,oneof"` }
type StreamConfiguration_StartAtId ¶
type StreamConfiguration_StartAtId struct { // Will deliver events from the given ID StartAtId uint64 `protobuf:"varint,7,opt,name=start_at_id,json=startAtId,proto3,oneof"` }
type StreamConfiguration_StartAtTimestamp ¶
type StreamConfiguration_StartAtTimestamp struct { // Will deliver events from the given timestamp StartAtTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_at_timestamp,json=startAtTimestamp,proto3,oneof"` }