client

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ClientOptions) (*Client, error)

func (*Client) AppendToStream

func (c *Client) AppendToStream(ctx context.Context, stream string, sequence uint64, events []EventRequest) ([]string, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) EventCount

func (c *Client) EventCount(ctx context.Context) (uint64, error)

func (*Client) GetEvent

func (c *Client) GetEvent(ctx context.Context, id ulid.ULID) (*Event, error)

func (*Client) GetStream

func (c *Client) GetStream(ctx context.Context, stream string, sequence uint64, limit uint32) ([]string, error)

func (*Client) StreamCount

func (c *Client) StreamCount(ctx context.Context) (uint64, error)

func (*Client) StreamSequence

func (c *Client) StreamSequence(ctx context.Context, stream string) (uint64, error)

func (*Client) Version

func (c *Client) Version(ctx context.Context) (string, error)

type ClientOptions

type ClientOptions struct {
	Address string
}

func DefaultOptions

func DefaultOptions() ClientOptions

func (ClientOptions) WithAddress

func (opts ClientOptions) WithAddress(address string) ClientOptions

type Event

type Event struct {
	ID             string    `json:"id"`
	Stream         string    `json:"stream"`
	Sequence       uint64    `json:"sequence"`
	GlobalSequence uint64    `json:"global_sequence"`
	Type           string    `json:"type"`
	Data           []byte    `json:"data"`
	CausationID    string    `json:"causation_id"`
	CorrelationID  string    `json:"correlation_id"`
	Timestamp      time.Time `json:"timestamp"`
}

type EventRequest

type EventRequest struct {
	Type          string `json:"type"`
	Data          []byte `json:"data"`
	CausationID   string `json:"causation_id"`
	CorrelationID string `json:"correlation_id"`
}

Jump to

Keyboard shortcuts

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