Documentation ¶
Index ¶
- func AppendToStream(conn *EventStoreConnection, streamID string, expectedVersion int32, ...) (protobuf.WriteEventsCompleted, error)
- func CreatePersistentSubscription(conn *EventStoreConnection, streamID string, groupName string, ...) (protobuf.CreatePersistentSubscriptionCompleted, error)
- func DecodeNetUUID(netEncoded []byte) []byte
- func DeleteStream(conn *EventStoreConnection, streamID string, expectedVersion int32, ...) (protobuf.DeleteStreamCompleted, error)
- func EncodeNetUUID(uuid []byte) []byte
- func ReadSingleEvent(conn *EventStoreConnection, streamID string, eventNumber int32, ...) (protobuf.ReadEventCompleted, error)
- func ReadStreamEventsBackward(conn *EventStoreConnection, streamID string, from int32, maxCount int32, ...) (protobuf.ReadStreamEventsCompleted, error)
- func ReadStreamEventsForward(conn *EventStoreConnection, streamID string, from int32, maxCount int32, ...) (protobuf.ReadStreamEventsCompleted, error)
- type Command
- type Configuration
- type EndpointDiscoverer
- type Event
- type EventStoreConnection
- type GossipEndpointDiscoverer
- type GossipResponse
- type GossipSeed
- type MemberInfo
- type PersistentSubscriptionSettings
- type Subscription
- func ConnectToPersistentSubscription(conn *EventStoreConnection, stream string, groupName string, ...) (*Subscription, error)
- func NewSubscription(connection *EventStoreConnection, correlationID uuid.UUID, ...) (*Subscription, error)
- func SubscribeToStream(conn *EventStoreConnection, streamID string, resolveLinkTos bool, ...) (*Subscription, error)
- type TCPPackage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToStream ¶
func AppendToStream(conn *EventStoreConnection, streamID string, expectedVersion int32, evnts []Event) (protobuf.WriteEventsCompleted, error)
AppendToStream appends an event to the stream
func CreatePersistentSubscription ¶
func CreatePersistentSubscription(conn *EventStoreConnection, streamID string, groupName string, settings PersistentSubscriptionSettings) (protobuf.CreatePersistentSubscriptionCompleted, error)
CreatePersistentSubscription creates a new persistent subscription
func DecodeNetUUID ¶
DecodeNetUUI decodes a dotnet UUID
func DeleteStream ¶
func DeleteStream(conn *EventStoreConnection, streamID string, expectedVersion int32, requireMaster bool, hardDelete bool) (protobuf.DeleteStreamCompleted, error)
DeleteStream will delete the stream
func ReadSingleEvent ¶
func ReadSingleEvent(conn *EventStoreConnection, streamID string, eventNumber int32, resolveLinkTos bool, requireMaster bool) (protobuf.ReadEventCompleted, error)
ReadSingleEvent reads a single event from a stream
func ReadStreamEventsBackward ¶
func ReadStreamEventsBackward(conn *EventStoreConnection, streamID string, from int32, maxCount int32, resolveLinkTos bool, requireMaster bool) (protobuf.ReadStreamEventsCompleted, error)
ReadStreamEventsBackward will read n number of events from the stream backward.
func ReadStreamEventsForward ¶
func ReadStreamEventsForward(conn *EventStoreConnection, streamID string, from int32, maxCount int32, resolveLinkTos bool, requireMaster bool) (protobuf.ReadStreamEventsCompleted, error)
ReadStreamEventsForward will read n number of events from the stream forward. The read includes the stream at the from position.
Types ¶
type Configuration ¶
type Configuration struct { Address string Port int Login string Password string ReconnectionDelay int MaxReconnects int MaxOperationRetries int EndpointDiscoverer EndpointDiscoverer }
Configuration for an Event Store Connection
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration creates a configuration with default settings
type EndpointDiscoverer ¶
type EndpointDiscoverer interface {
Discover() (MemberInfo, error)
}
EndpointDiscoverer func that is used to discover an endpoint given the gossip seeds
type Event ¶
Event is a structure that is used to help in marshalling events to and from a tcp package
type EventStoreConnection ¶
type EventStoreConnection struct { Config *Configuration Socket *net.TCPConn ConnectionID uuid.UUID Mutex *sync.Mutex // contains filtered or unexported fields }
EventStoreConnection will manage the lifetime and connection to an Event Store Node/Cluster
func NewEventStoreConnection ¶
func NewEventStoreConnection(config *Configuration) (*EventStoreConnection, error)
NewEventStoreConnection sets up a new Event Store Connection but does not open the connection
func (*EventStoreConnection) Close ¶
func (connection *EventStoreConnection) Close() error
Close attempts to close the connection to Event Store
func (*EventStoreConnection) Connect ¶
func (connection *EventStoreConnection) Connect() error
Connect attempts to connect to Event Store using the given configuration
type GossipEndpointDiscoverer ¶
GossipEndpointDiscoverer used for discovering and picking the most appropriate node in a cluster
func (*GossipEndpointDiscoverer) Discover ¶
func (discoverer *GossipEndpointDiscoverer) Discover() (MemberInfo, error)
Discover will discover nodes via performing a gossip over HTTP and then picking the best candidate to connect to
type GossipResponse ¶
type GossipResponse struct {
Members []MemberInfo `json:"members"`
}
GossipResponse represents the response from a gossip request
type GossipSeed ¶
GossipSeed represents and endpoint where a gossip can be issued and nodes in a cluster discovered
type MemberInfo ¶
type MemberInfo struct { State string `json:"state"` IsAlive bool `json:"isAlive"` ExternalTCPIP string `json:"externalTcpIp"` ExternalHTTPPort int `json:"externalHttpPort"` ExternalTCPPort int `json:"externalTcpPort"` }
MemberInfo represents the members in a cluster which is retrieved as part of the gossip request and lives inside of the members in the response
type PersistentSubscriptionSettings ¶
type PersistentSubscriptionSettings struct { ResolveLinkTos bool StartFrom int MessageTimeoutMilliseconds int RecordStatistics bool LiveBufferSize int ReadBatchSize int BufferSize int MaxRetryCount int PreferRoundRobit bool CheckpointAfterTime int CheckpointMaxCount int CheckpointMinCount int SubscriberMaxCount int NamedConsumerStrategy string }
PersistentSubscriptionSettings describes the settings for the persistent subscription
func NewPersistentSubscriptionSettings ¶
func NewPersistentSubscriptionSettings() *PersistentSubscriptionSettings
NewPersistentSubscriptionSettings creates new subscription settings
type Subscription ¶
type Subscription struct { CorrelationID uuid.UUID Connection *EventStoreConnection Channel chan TCPPackage EventAppeared eventAppeared Dropped dropped Started bool }
Subscription represents an Event Store Client Subscription to a stream
func ConnectToPersistentSubscription ¶
func ConnectToPersistentSubscription(conn *EventStoreConnection, stream string, groupName string, eventAppeared eventAppeared, dropped dropped, bufferSize int, autoAck bool) (*Subscription, error)
ConnectToPersistentSubscription connects to a persistent subscription
func NewSubscription ¶
func NewSubscription(connection *EventStoreConnection, correlationID uuid.UUID, channel chan TCPPackage, appeared eventAppeared, dropped dropped) (*Subscription, error)
NewSubscription creates a new subscription to a stream
func SubscribeToStream ¶
func SubscribeToStream(conn *EventStoreConnection, streamID string, resolveLinkTos bool, eventAppeared eventAppeared, dropped dropped) (*Subscription, error)
SubscribeToStream registers a subscription with the stream
func (*Subscription) Start ¶
func (subscription *Subscription) Start() error
Start starts a subscription
func (*Subscription) Stop ¶
func (subscription *Subscription) Stop() error
Stop stops a subscription from receiving events