v1

package
v1.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_wgtwo_events_v1_events_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AckInfo

type AckInfo struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

This contains a opaque string which should be included in the ack request to identify the event

func (*AckInfo) Descriptor deprecated

func (*AckInfo) Descriptor() ([]byte, []int)

Deprecated: Use AckInfo.ProtoReflect.Descriptor instead.

func (*AckInfo) GetValue

func (x *AckInfo) GetValue() string

func (*AckInfo) ProtoMessage

func (*AckInfo) ProtoMessage()

func (*AckInfo) ProtoReflect

func (x *AckInfo) ProtoReflect() protoreflect.Message

func (*AckInfo) Reset

func (x *AckInfo) Reset()

func (*AckInfo) String

func (x *AckInfo) String() string

type AckRequest

type AckRequest struct {
	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 {
	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 {
	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) Descriptor() ([]byte, []int)

Deprecated: Use AckStatus.ProtoReflect.Descriptor instead.

func (*AckStatus) GetStatusCode

func (x *AckStatus) GetStatusCode() AckStatus_StatusCode

func (*AckStatus) ProtoMessage

func (*AckStatus) ProtoMessage()

func (*AckStatus) ProtoReflect

func (x *AckStatus) ProtoReflect() protoreflect.Message

func (*AckStatus) Reset

func (x *AckStatus) Reset()

func (*AckStatus) String

func (x *AckStatus) String() string

type AckStatus_StatusCode

type AckStatus_StatusCode int32
const (
	AckStatus_STATUS_CODE_UNSPECIFIED AckStatus_StatusCode = 0
	AckStatus_STATUS_CODE_FAILURE     AckStatus_StatusCode = 1
	AckStatus_STATUS_CODE_SUCCESS     AckStatus_StatusCode = 2
)

func (AckStatus_StatusCode) Descriptor

func (AckStatus_StatusCode) Enum

func (AckStatus_StatusCode) EnumDescriptor deprecated

func (AckStatus_StatusCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use AckStatus_StatusCode.Descriptor instead.

func (AckStatus_StatusCode) Number

func (AckStatus_StatusCode) String

func (x AckStatus_StatusCode) String() string

func (AckStatus_StatusCode) Type

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 {
	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) Descriptor() ([]byte, []int)

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetAckInfo

func (x *Metadata) GetAckInfo() *AckInfo

func (*Metadata) GetIdentifier

func (x *Metadata) GetIdentifier() *Identifier

func (*Metadata) GetIsRedelivered

func (x *Metadata) GetIsRedelivered() bool

func (*Metadata) GetTimestamp

func (x *Metadata) GetTimestamp() *timestamppb.Timestamp

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

func (x *Metadata) ProtoReflect() protoreflect.Message

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

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_DisableExplicitAck

type StreamConfiguration_DisableExplicitAck struct {
	// Disable ack
	DisableExplicitAck *emptypb.Empty `protobuf:"bytes,3,opt,name=disable_explicit_ack,json=disableExplicitAck,proto3,oneof"`
}

type StreamConfiguration_DurableQueue

type StreamConfiguration_DurableQueue struct {
	DurableQueue *DurableQueue `protobuf:"bytes,2,opt,name=durable_queue,json=durableQueue,proto3,oneof"`
}

type StreamConfiguration_Regular

type StreamConfiguration_Regular struct {
	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_StartAtNew

type StreamConfiguration_StartAtNew struct {
	// Will only deliver events generated after this subscription was started
	StartAtNew *emptypb.Empty `protobuf:"bytes,6,opt,name=start_at_new,json=startAtNew,proto3,oneof"`
}

type StreamConfiguration_StartAtOldestPossible

type StreamConfiguration_StartAtOldestPossible struct {
	// Will deliver all available events
	StartAtOldestPossible *emptypb.Empty `protobuf:"bytes,9,opt,name=start_at_oldest_possible,json=startAtOldestPossible,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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL