esdb

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 32 Imported by: 5

Documentation

Index

Constants

View Source
const (
	SchemeDefaultPort       = 2113
	SchemaHostsSeparator    = ","
	SchemeName              = "esdb"
	SchemeNameWithDiscover  = "esdb+discover"
	SchemePathSeparator     = "/"
	SchemePortSeparator     = ":"
	SchemeQuerySeparator    = "?"
	SchemeSeparator         = "://"
	SchemeSettingSeparator  = "&"
	SchemeUserInfoSeparator = "@"
)
View Source
const (
	FEATURE_NOTHING                                   = 0
	FEATURE_BATCH_APPEND                              = 1
	FEATURE_PERSISTENT_SUBSCRIPTION_LIST              = 2
	FEATURE_PERSISTENT_SUBSCRIPTION_REPLAY            = 4
	FEATURE_PERSISTENT_SUBSCRIPTION_RESTART_SUBSYSTEM = 8
	FEATURE_PERSISTENT_SUBSCRIPTION_GET_INFO          = 16
	FEATURE_PERSISTENT_SUBSCRIPTION_TO_ALL            = 32
	FEATURE_PERSISTENT_SUBSCRIPTION_MANAGEMENT        = FEATURE_PERSISTENT_SUBSCRIPTION_LIST | FEATURE_PERSISTENT_SUBSCRIPTION_GET_INFO | FEATURE_PERSISTENT_SUBSCRIPTION_RESTART_SUBSYSTEM | FEATURE_PERSISTENT_SUBSCRIPTION_REPLAY
)
View Source
const (
	RegularOperation operationKind = iota
	StreamingOperation
)
View Source
const (
	UserStreamAcl   = "$userStreamAcl"
	SystemStreamAcl = "$systemStreamAcl"
)
View Source
const (
	EventFilterType   FilterType = 0
	StreamFilterType  FilterType = 1
	NoMaxSearchWindow int        = -1
)
View Source
const (
	PersistentSubscriptionStatus_NotReady                = "NotReady"
	PersistentSubscriptionStatus_Behind                  = "Behind"
	PersistentSubscriptionStatus_OutstandingPageRequest  = "OutstandingPageRequest"
	PersistentSubscriptionStatus_ReplayingParkedMessages = "ReplayingParkedMessages"
	PersistentSubscriptionStatus_Live                    = "Live"
)
View Source
const SUBSCRIBER_COUNT_UNLIMITED = 0

Variables

This section is empty.

Functions

func EventIDFromProto

func EventIDFromProto(recordedEvent *api.ReadResp_ReadEvent_RecordedEvent) uuid.UUID

EventIDFromProto ...

func NewGrpcClient

func NewGrpcClient(config Configuration) *grpcClient

Types

type Acl

type Acl struct {
	// contains filtered or unexported fields
}

func AclFromMap

func AclFromMap(props map[string]interface{}) (Acl, error)

func (*Acl) AddDeleteRoles

func (a *Acl) AddDeleteRoles(roles ...string)

func (*Acl) AddMetaReadRoles

func (a *Acl) AddMetaReadRoles(roles ...string)

func (*Acl) AddMetaWriteRoles

func (a *Acl) AddMetaWriteRoles(roles ...string)

func (*Acl) AddReadRoles

func (a *Acl) AddReadRoles(roles ...string)

func (*Acl) AddWriteRoles

func (a *Acl) AddWriteRoles(roles ...string)

func (*Acl) DeleteRoles

func (a *Acl) DeleteRoles() []string

func (*Acl) MetaReadRoles

func (a *Acl) MetaReadRoles() []string

func (*Acl) MetaWriteRoles

func (a *Acl) MetaWriteRoles() []string

func (*Acl) ReadRoles

func (a *Acl) ReadRoles() []string

func (Acl) ToMap

func (a Acl) ToMap() map[string]interface{}

func (*Acl) WriteRoles

func (a *Acl) WriteRoles() []string

type AllPosition

type AllPosition interface {
	// contains filtered or unexported methods
}

type Any

type Any struct{}

type AppendToStreamOptions

type AppendToStreamOptions struct {
	ExpectedRevision ExpectedRevision
	Authenticated    *Credentials
	Deadline         *time.Duration
}

type Client

type Client struct {
	Config *Configuration
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(configuration *Configuration) (*Client, error)

NewClient ...

func (*Client) AppendToStream

func (client *Client) AppendToStream(
	context context.Context,
	streamID string,
	opts AppendToStreamOptions,
	events ...EventData,
) (*WriteResult, error)

AppendToStream ...

func (*Client) Close

func (client *Client) Close() error

Close ...

func (*Client) CreatePersistentSubscription

func (client *Client) CreatePersistentSubscription(
	ctx context.Context,
	streamName string,
	groupName string,
	options PersistentStreamSubscriptionOptions,
) error

func (*Client) CreatePersistentSubscriptionToAll

func (client *Client) CreatePersistentSubscriptionToAll(
	ctx context.Context,
	groupName string,
	options PersistentAllSubscriptionOptions,
) error

func (*Client) DeletePersistentSubscription

func (client *Client) DeletePersistentSubscription(
	ctx context.Context,
	streamName string,
	groupName string,
	options DeletePersistentSubscriptionOptions,
) error

func (*Client) DeletePersistentSubscriptionToAll

func (client *Client) DeletePersistentSubscriptionToAll(
	ctx context.Context,
	groupName string,
	options DeletePersistentSubscriptionOptions,
) error

func (*Client) DeleteStream

func (client *Client) DeleteStream(
	parent context.Context,
	streamID string,
	opts DeleteStreamOptions,
) (*DeleteResult, error)

DeleteStream ...

func (*Client) GetPersistentSubscriptionInfo

func (client *Client) GetPersistentSubscriptionInfo(ctx context.Context, streamName string, groupName string, options GetPersistentSubscriptionOptions) (*PersistentSubscriptionInfo, error)

func (*Client) GetPersistentSubscriptionInfoToAll

func (client *Client) GetPersistentSubscriptionInfoToAll(ctx context.Context, groupName string, options GetPersistentSubscriptionOptions) (*PersistentSubscriptionInfo, error)

func (*Client) GetStreamMetadata

func (client *Client) GetStreamMetadata(
	context context.Context,
	streamID string,
	opts ReadStreamOptions,
) (*StreamMetadata, error)

func (*Client) ListAllPersistentSubscriptions

func (client *Client) ListAllPersistentSubscriptions(ctx context.Context, options ListPersistentSubscriptionsOptions) ([]PersistentSubscriptionInfo, error)

func (*Client) ListPersistentSubscriptionsForStream

func (client *Client) ListPersistentSubscriptionsForStream(ctx context.Context, streamName string, options ListPersistentSubscriptionsOptions) ([]PersistentSubscriptionInfo, error)

func (*Client) ListPersistentSubscriptionsToAll

func (client *Client) ListPersistentSubscriptionsToAll(ctx context.Context, options ListPersistentSubscriptionsOptions) ([]PersistentSubscriptionInfo, error)

func (*Client) ReadAll

func (client *Client) ReadAll(
	context context.Context,
	opts ReadAllOptions,
	count uint64,
) (*ReadStream, error)

ReadAll ...

func (*Client) ReadStream

func (client *Client) ReadStream(
	context context.Context,
	streamID string,
	opts ReadStreamOptions,
	count uint64,
) (*ReadStream, error)

ReadStream ...

func (*Client) ReplayParkedMessages

func (client *Client) ReplayParkedMessages(ctx context.Context, streamName string, groupName string, options ReplayParkedMessagesOptions) error

func (*Client) ReplayParkedMessagesToAll

func (client *Client) ReplayParkedMessagesToAll(ctx context.Context, groupName string, options ReplayParkedMessagesOptions) error

func (*Client) RestartPersistentSubscriptionSubsystem

func (client *Client) RestartPersistentSubscriptionSubsystem(ctx context.Context, options RestartPersistentSubscriptionSubsystemOptions) error

func (*Client) SetStreamMetadata

func (client *Client) SetStreamMetadata(
	context context.Context,
	streamID string,
	opts AppendToStreamOptions,
	metadata StreamMetadata,
) (*WriteResult, error)

func (*Client) SubscribeToAll

func (client *Client) SubscribeToAll(
	parent context.Context,
	opts SubscribeToAllOptions,
) (*Subscription, error)

SubscribeToAll ...

func (*Client) SubscribeToPersistentSubscription

func (client *Client) SubscribeToPersistentSubscription(
	ctx context.Context,
	streamName string,
	groupName string,
	options SubscribeToPersistentSubscriptionOptions,
) (*PersistentSubscription, error)

SubscribeToPersistentSubscription ...

func (*Client) SubscribeToPersistentSubscriptionToAll

func (client *Client) SubscribeToPersistentSubscriptionToAll(
	ctx context.Context,
	groupName string,
	options SubscribeToPersistentSubscriptionOptions,
) (*PersistentSubscription, error)

func (*Client) SubscribeToStream

func (client *Client) SubscribeToStream(
	parent context.Context,
	streamID string,
	opts SubscribeToStreamOptions,
) (*Subscription, error)

SubscribeToStream ...

func (*Client) TombstoneStream

func (client *Client) TombstoneStream(
	parent context.Context,
	streamID string,
	opts TombstoneStreamOptions,
) (*DeleteResult, error)

Tombstone ...

func (*Client) UpdatePersistentSubscription

func (client *Client) UpdatePersistentSubscription(
	ctx context.Context,
	streamName string,
	groupName string,
	options PersistentStreamSubscriptionOptions,
) error

func (*Client) UpdatePersistentSubscriptionToAll

func (client *Client) UpdatePersistentSubscriptionToAll(
	ctx context.Context,
	groupName string,
	options PersistentAllSubscriptionOptions,
) error

type Configuration

type Configuration struct {
	// The URI of the EventStoreDB. Use this when connecting to a single node.
	// Example: localhost:2113
	Address string

	// An array of end points used to seed gossip.
	GossipSeeds []*EndPoint

	// Disable communicating over a secure channel.
	DisableTLS bool // Defaults to false.

	// The NodePreference to use when connecting.
	NodePreference NodePreference

	// The username to use for authenticating against the EventStoreDB instance.
	Username string

	// The password to use for authenticating against the EventStoreDB instance.
	Password string

	// RootCAs defines the set of root certificate authorities
	// that clients use when verifying server certificates.
	// If RootCAs is nil, TLS uses the host's root CA set.
	RootCAs *x509.CertPool // Defaults to nil.

	// Allows to skip certificate validation.
	SkipCertificateVerification bool // Defaults to false.

	// The maximum number of times to attempt end point discovery.
	MaxDiscoverAttempts int // Defaults to 10.

	// The polling interval (in milliseconds) used to discover the end point.
	DiscoveryInterval int // Defaults to 100 milliseconds.

	// The amount of time (in seconds) after which an attempt to discover gossip will fail.
	GossipTimeout int // Defaults to 5 seconds.

	// Specifies if DNS discovery should be used.
	DnsDiscover bool // Defaults to false.

	// The amount of time (in milliseconds) to wait after which a keepalive ping is sent on the transport.
	// If set below 10s, a minimum value of 10s will be used instead. Use -1 to disable. Use -1 to disable.
	KeepAliveInterval time.Duration // Defaults to 10 seconds.

	// The amount of time (in milliseconds) the sender of the keep alive ping waits for an acknowledgement.
	KeepAliveTimeout time.Duration // Defaults to 10 seconds.

	// The amount of time (in milliseconds) a non-streaming operation should take to complete before resulting in a
	// DeadlineExceeded. Defaults to 10 seconds.
	DefaultDeadline *time.Duration

	// Logging abstraction used by the client.
	Logger LoggingFunc
}

Configuration describes how to connect to an instance of EventStoreDB.

func ParseConnectionString

func ParseConnectionString(connectionString string) (*Configuration, error)

ParseConnectionString creates a Configuration based on an EventStoreDb connection string.

type ConsumerStrategy

type ConsumerStrategy string
const (
	ConsumerStrategy_RoundRobin          ConsumerStrategy = "RoundRobin"
	ConsumerStrategy_DispatchToSingle    ConsumerStrategy = "DispatchToSingle"
	ConsumerStrategy_Pinned              ConsumerStrategy = "Pinned"
	ConsumerStrategy_PinnedByCorrelation ConsumerStrategy = "PinnedByCorrelation"
)

type ContentType

type ContentType int
const (
	BinaryContentType ContentType = 0
	JsonContentType   ContentType = 1
)

type Credentials

type Credentials struct {
	Login    string
	Password string
}

type DeletePersistentSubscriptionOptions

type DeletePersistentSubscriptionOptions struct {
	Authenticated *Credentials
	Deadline      *time.Duration
}

type DeleteResult

type DeleteResult struct {
	Position Position
}

type DeleteStreamOptions

type DeleteStreamOptions struct {
	ExpectedRevision ExpectedRevision
	Authenticated    *Credentials
	Deadline         *time.Duration
}

type Direction

type Direction int

Direction ...

const (
	// Forwards ...
	Forwards Direction = iota
	// Backwards ...
	Backwards
)

type End

type End struct {
}

type EndPoint

type EndPoint struct {
	Host string
	Port uint16
}

func ParseEndPoint

func ParseEndPoint(s string) (*EndPoint, error)

func (*EndPoint) String

func (e *EndPoint) String() string

type Error

type Error struct {
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) (*Error, bool)

func (*Error) Code

func (e *Error) Code() ErrorCode

func (*Error) Err

func (e *Error) Err() error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode int
const (
	ErrorUnknown ErrorCode = iota
	ErrorUnsupportedFeature
	ErrorDeadlineExceeded
	ErrorUnauthenticated
	ErrorResourceNotFound
	ErrorResourceAlreadyExists
	ErrorConnectionClosed
	ErrorWrongExpectedVersion
	ErrorAccessDenied
	ErrorStreamDeleted
	ErrorParsing
	ErrorInternalClient
	ErrorInternalServer
	ErrorNotLeader
)

type EventAppeared

type EventAppeared struct {
	Event      *ResolvedEvent
	RetryCount int
}

type EventData

type EventData struct {
	EventID     uuid.UUID
	EventType   string
	ContentType ContentType
	Data        []byte
	Metadata    []byte
}

EventData ...

type ExpectedRevision

type ExpectedRevision interface {
	// contains filtered or unexported methods
}

type FilterType

type FilterType int

type GetPersistentSubscriptionOptions

type GetPersistentSubscriptionOptions struct {
	Authenticated *Credentials
	Deadline      *time.Duration
}

type ListPersistentSubscriptionsOptions

type ListPersistentSubscriptionsOptions struct {
	Authenticated *Credentials
	Deadline      *time.Duration
}

type LogLevel added in v2.1.0

type LogLevel = string
const (
	LogDebug LogLevel = "debug"
	LogInfo  LogLevel = "info"
	LogWarn  LogLevel = "warn"
	LogError LogLevel = "error"
)

type LoggingFunc added in v2.1.0

type LoggingFunc = func(level LogLevel, format string, args ...interface{})

func ConsoleLogging added in v2.1.0

func ConsoleLogging() LoggingFunc

func NoopLogging added in v2.1.0

func NoopLogging() LoggingFunc

type Nack_Action

type Nack_Action int32
const (
	Nack_Unknown Nack_Action = 0
	Nack_Park    Nack_Action = 1
	Nack_Retry   Nack_Action = 2
	Nack_Skip    Nack_Action = 3
	Nack_Stop    Nack_Action = 4
)

type NoStream

type NoStream struct{}

type NodePreference

type NodePreference string
const (
	NodePreference_Leader          NodePreference = "Leader"
	NodePreference_Follower        NodePreference = "Follower"
	NodePreference_ReadOnlyReplica NodePreference = "ReadOnlyReplica"
	NodePreference_Random          NodePreference = "Random"
)

func (NodePreference) String

func (nodePreference NodePreference) String() string

type PersistentAllSubscriptionOptions

type PersistentAllSubscriptionOptions struct {
	Settings        *SubscriptionSettings
	StartFrom       AllPosition
	MaxSearchWindow int
	Filter          *SubscriptionFilter
	Authenticated   *Credentials
	Deadline        *time.Duration
}

type PersistentStreamSubscriptionOptions

type PersistentStreamSubscriptionOptions struct {
	Settings      *SubscriptionSettings
	StartFrom     StreamPosition
	Authenticated *Credentials
	Deadline      *time.Duration
}

type PersistentSubscription

type PersistentSubscription struct {
	// contains filtered or unexported fields
}

func NewPersistentSubscription

func NewPersistentSubscription(
	client persistent.PersistentSubscriptions_ReadClient,
	subscriptionId string,
	cancel context.CancelFunc,
	logger *logger,
) *PersistentSubscription

func (*PersistentSubscription) Ack

func (connection *PersistentSubscription) Ack(messages ...*ResolvedEvent) error

func (*PersistentSubscription) Close

func (connection *PersistentSubscription) Close() error

func (*PersistentSubscription) Nack

func (connection *PersistentSubscription) Nack(reason string, action Nack_Action, messages ...*ResolvedEvent) error

func (*PersistentSubscription) Recv

type PersistentSubscriptionConfig

type PersistentSubscriptionConfig struct {
	ResolveLinkTos       bool   `json:"resolveLinktos"`
	StartFrom            int64  `json:"startFrom"`
	StartPosition        string `json:"startPosition,omitempty"`
	MessageTimeout       int64  `json:"messageTimeoutMilliseconds"`
	ExtraStatistics      bool   `json:"extraStatistics"`
	MaxRetryCount        int64  `json:"maxRetryCount"`
	LiveBufferSize       int64  `json:"liveBufferSize"`
	BufferSize           int64  `json:"bufferSize"`
	ReadBatchSize        int64  `json:"readBatchSize"`
	PreferRoundRobin     bool   `json:"preferRoundRobin"`
	CheckpointAfter      int64  `json:"checkPointAfterMilliseconds"`
	CheckpointLowerBound int64  `json:"minCheckPointCount"`
	CheckpointUpperBound int64  `json:"maxCheckPointCount"`
	MaxSubscriberCount   int64  `json:"maxSubscriberCount"`
	ConsumerStrategyName string `json:"consumerStrategyName"`
}

type PersistentSubscriptionConnectionInfo

type PersistentSubscriptionConnectionInfo struct {
	From                      string                              `json:"from"`
	Username                  string                              `json:"username"`
	AverageItemsPerSecond     float64                             `json:"averageItemsPerSecond"`
	TotalItemsProcessed       int64                               `json:"totalItemsProcessed"`
	CountSinceLastMeasurement int64                               `json:"countSinceLastMeasurement"`
	AvailableSlots            int64                               `json:"availableSlots"`
	InFlightMessages          int64                               `json:"inFlightMessages"`
	ConnectionName            string                              `json:"connectionName"`
	ExtraStatistics           []PersistentSubscriptionMeasurement `json:"extraStatistics"`
}

type PersistentSubscriptionEvent

type PersistentSubscriptionEvent struct {
	EventAppeared       *EventAppeared
	SubscriptionDropped *SubscriptionDropped
	CheckPointReached   *Position
}

type PersistentSubscriptionInfo

type PersistentSubscriptionInfo struct {
	EventSource string
	GroupName   string
	Status      string
	Connections []PersistentSubscriptionConnectionInfo
	Settings    *SubscriptionSettings
	Stats       *PersistentSubscriptionStats
}

type PersistentSubscriptionInfoHttpJson

type PersistentSubscriptionInfoHttpJson struct {
	EventStreamId                 string                                 `json:"eventStreamId"`
	GroupName                     string                                 `json:"groupName"`
	Status                        string                                 `json:"status"`
	AverageItemsPerSecond         float64                                `json:"averageItemsPerSecond"`
	TotalItemsProcessed           int64                                  `json:"totalItemsProcessed"`
	LastProcessedEventNumber      int64                                  `json:"lastProcessedEventNumber"`
	LastKnownEventNumber          int64                                  `json:"lastKnownEventNumber"`
	LastCheckpointedEventPosition string                                 `json:"lastCheckpointedEventPosition,omitempty"`
	LastKnownEventPosition        string                                 `json:"lastKnownEventPosition,omitempty"`
	ConnectionCount               int64                                  `json:"connectionCount,omitempty"`
	TotalInFlightMessages         int64                                  `json:"totalInFlightMessages"`
	Config                        *PersistentSubscriptionConfig          `json:"config,omitempty"`
	Connections                   []PersistentSubscriptionConnectionInfo `json:"connections,omitempty"`
	ReadBufferCount               int64                                  `json:"readBufferCount"`
	RetryBufferCount              int64                                  `json:"retryBufferCount"`
	LiveBufferCount               int64                                  `json:"liveBufferCount"`
	OutstandingMessagesCount      int64                                  `json:"OutstandingMessagesCount"`
	ParkedMessageCount            int64                                  `json:"parkedMessageCount"`
	CountSinceLastMeasurement     int64                                  `json:"countSinceLastMeasurement"`
}

type PersistentSubscriptionMeasurement

type PersistentSubscriptionMeasurement struct {
	Key   string `json:"key"`
	Value int64  `json:"value"`
}

type PersistentSubscriptionStats

type PersistentSubscriptionStats struct {
	AveragePerSecond              int64
	TotalItems                    int64
	CountSinceLastMeasurement     int64
	LastCheckpointedEventRevision *uint64
	LastKnownEventRevision        *uint64
	LastCheckpointedPosition      *Position
	LastKnownPosition             *Position
	ReadBufferCount               int64
	LiveBufferCount               int64
	RetryBufferCount              int64
	TotalInFlightMessages         int64
	OutstandingMessagesCount      int64
	ParkedMessagesCount           int64
}

type PersistentSubscriptionStatus

type PersistentSubscriptionStatus string

type Position

type Position struct {
	Commit  uint64
	Prepare uint64
}

Position ...

var EmptyPosition Position = Position{Commit: ^uint64(0), Prepare: ^uint64(0)}

EmptyPosition ...

var EndPosition Position = Position{Commit: ^uint64(0), Prepare: ^uint64(0)}

EndPosition ...

var StartPosition Position = Position{Commit: 0, Prepare: 0}

StartPosition ...

type ReadAllOptions

type ReadAllOptions struct {
	Direction      Direction
	From           AllPosition
	ResolveLinkTos bool
	Authenticated  *Credentials
	Deadline       *time.Duration
}

type ReadStream

type ReadStream struct {
	// contains filtered or unexported fields
}

func (*ReadStream) Close

func (stream *ReadStream) Close()

func (*ReadStream) Recv

func (stream *ReadStream) Recv() (*ResolvedEvent, error)

type ReadStreamOptions

type ReadStreamOptions struct {
	Direction      Direction
	From           StreamPosition
	ResolveLinkTos bool
	Authenticated  *Credentials
	Deadline       *time.Duration
}

type RecordedEvent

type RecordedEvent struct {
	EventID        uuid.UUID
	EventType      string
	ContentType    string
	StreamID       string
	EventNumber    uint64
	Position       Position
	CreatedDate    time.Time
	Data           []byte
	SystemMetadata map[string]string
	UserMetadata   []byte
}

RecordedEvent ...

type ReplayParkedMessagesOptions

type ReplayParkedMessagesOptions struct {
	Authenticated *Credentials
	StopAt        int
	Deadline      *time.Duration
}

type ResolvedEvent

type ResolvedEvent struct {
	Link   *RecordedEvent
	Event  *RecordedEvent
	Commit *uint64
}

func (ResolvedEvent) OriginalEvent

func (resolved ResolvedEvent) OriginalEvent() *RecordedEvent

type RestartPersistentSubscriptionSubsystemOptions

type RestartPersistentSubscriptionSubsystemOptions struct {
	Authenticated *Credentials
	Deadline      *time.Duration
}

type ServerInfo

type ServerInfo struct {
	Version      ServerVersion
	FeatureFlags int
}

type ServerVersion

type ServerVersion struct {
	Major int
	Minor int
	Patch int
}

type Start

type Start struct {
}

type StreamExists

type StreamExists struct{}

type StreamMetadata

type StreamMetadata struct {
	// contains filtered or unexported fields
}

func StreamMetadataFromMap

func StreamMetadataFromMap(props map[string]interface{}) (StreamMetadata, error)

func (*StreamMetadata) Acl

func (m *StreamMetadata) Acl() interface{}

func (*StreamMetadata) AddCustomProperty

func (m *StreamMetadata) AddCustomProperty(name string, value interface{})

func (*StreamMetadata) CacheControl

func (m *StreamMetadata) CacheControl() *time.Duration

func (*StreamMetadata) IsSystemStreamAcl

func (m *StreamMetadata) IsSystemStreamAcl() bool

func (*StreamMetadata) IsUserStreamAcl

func (m *StreamMetadata) IsUserStreamAcl() bool

func (*StreamMetadata) MaxAge

func (m *StreamMetadata) MaxAge() *time.Duration

func (*StreamMetadata) MaxCount

func (m *StreamMetadata) MaxCount() *uint64

func (*StreamMetadata) SetAcl

func (m *StreamMetadata) SetAcl(value interface{})

func (*StreamMetadata) SetCacheControl

func (m *StreamMetadata) SetCacheControl(value time.Duration)

func (*StreamMetadata) SetMaxAge

func (m *StreamMetadata) SetMaxAge(value time.Duration)

func (*StreamMetadata) SetMaxCount

func (m *StreamMetadata) SetMaxCount(value uint64)

func (*StreamMetadata) SetTruncateBefore

func (m *StreamMetadata) SetTruncateBefore(value uint64)

func (*StreamMetadata) StreamAcl

func (m *StreamMetadata) StreamAcl() *Acl

func (StreamMetadata) ToMap

func (m StreamMetadata) ToMap() (map[string]interface{}, error)

func (*StreamMetadata) TruncateBefore

func (m *StreamMetadata) TruncateBefore() *uint64

type StreamPosition

type StreamPosition interface {
	// contains filtered or unexported methods
}

type StreamRevision

type StreamRevision struct {
	Value uint64
}

func Revision

func Revision(value uint64) StreamRevision

type SubscribeToAllOptions

type SubscribeToAllOptions struct {
	From               AllPosition
	ResolveLinkTos     bool
	MaxSearchWindow    int
	CheckpointInterval int
	Filter             *SubscriptionFilter
	Authenticated      *Credentials
	Deadline           *time.Duration
}

type SubscribeToPersistentSubscriptionOptions

type SubscribeToPersistentSubscriptionOptions struct {
	BufferSize    uint32
	Authenticated *Credentials
	Deadline      *time.Duration
}

type SubscribeToStreamOptions

type SubscribeToStreamOptions struct {
	From           StreamPosition
	ResolveLinkTos bool
	Authenticated  *Credentials
	Deadline       *time.Duration
}

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

func NewSubscription

func NewSubscription(client *Client, cancel context.CancelFunc, inner api.Streams_ReadClient, id string) *Subscription

func (*Subscription) Close

func (sub *Subscription) Close() error

func (*Subscription) Id

func (sub *Subscription) Id() string

func (*Subscription) Recv

func (sub *Subscription) Recv() *SubscriptionEvent

type SubscriptionDropped

type SubscriptionDropped struct {
	Error error
}

type SubscriptionEvent

type SubscriptionEvent struct {
	EventAppeared       *ResolvedEvent
	SubscriptionDropped *SubscriptionDropped
	CheckPointReached   *Position
}

type SubscriptionFilter

type SubscriptionFilter struct {
	Type     FilterType
	Prefixes []string
	Regex    string
}

func ExcludeSystemEventsFilter

func ExcludeSystemEventsFilter() *SubscriptionFilter

type SubscriptionFilterOptions

type SubscriptionFilterOptions struct {
	MaxSearchWindow    int
	CheckpointInterval int
	SubscriptionFilter *SubscriptionFilter
}

type SubscriptionSettings

type SubscriptionSettings struct {
	StartFrom            interface{}
	ResolveLinkTos       bool
	ExtraStatistics      bool
	MaxRetryCount        int32
	CheckpointLowerBound int32
	CheckpointUpperBound int32
	MaxSubscriberCount   int32
	LiveBufferSize       int32
	ReadBatchSize        int32
	HistoryBufferSize    int32
	ConsumerStrategyName ConsumerStrategy
	MessageTimeout       int32
	CheckpointAfter      int32
}

func SubscriptionSettingsDefault

func SubscriptionSettingsDefault() SubscriptionSettings

type TombstoneStreamOptions

type TombstoneStreamOptions struct {
	ExpectedRevision ExpectedRevision
	Authenticated    *Credentials
	Deadline         *time.Duration
}

type WriteResult

type WriteResult struct {
	CommitPosition      uint64
	PreparePosition     uint64
	NextExpectedVersion uint64
}

WriteResult ...

Jump to

Keyboard shortcuts

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