Documentation
¶
Overview ¶
Package eventsourcingdb provides the official Go client SDK for EventSourcingDB.
Index ¶
- type Bound
- type BoundType
- type Client
- func (c *Client) ObserveEvents(ctx context.Context, subject string, options ObserveEventsOptions) iter.Seq2[Event, error]
- func (c *Client) Ping() error
- func (c *Client) ReadEventType(eventType string) (EventType, error)
- func (c *Client) ReadEventTypes(ctx context.Context) iter.Seq2[EventType, error]
- func (c *Client) ReadEvents(ctx context.Context, subject string, options ReadEventsOptions) iter.Seq2[Event, error]
- func (c *Client) ReadSubjects(ctx context.Context, baseSubject string) iter.Seq2[string, error]
- func (c *Client) RegisterEventSchema(eventType string, schema map[string]any) error
- func (c *Client) RunEventQLQuery(ctx context.Context, query string) iter.Seq2[json.RawMessage, error]
- func (c *Client) VerifyAPIToken() error
- func (c *Client) WriteEvents(events []EventCandidate, preconditions []Precondition) ([]Event, error)
- type Container
- func (c *Container) GetAPIToken() string
- func (c *Container) GetBaseURL(ctx context.Context) (*url.URL, error)
- func (c *Container) GetClient(ctx context.Context) (*Client, error)
- func (c *Container) GetHost(ctx context.Context) (string, error)
- func (c *Container) GetMappedPort(ctx context.Context) (int, error)
- func (c *Container) GetSigningKey() (*ed25519.PrivateKey, error)
- func (c *Container) GetVerificationKey() (*ed25519.PublicKey, error)
- func (c *Container) IsRunning() bool
- func (c *Container) Start(ctx context.Context) error
- func (c *Container) Stop(ctx context.Context) error
- func (c *Container) WithAPIToken(token string) *Container
- func (c *Container) WithImageTag(tag string) *Container
- func (c *Container) WithPort(port int) *Container
- func (c *Container) WithSigningKey() *Container
- type Event
- type EventCandidate
- type EventType
- type ObserveEventsOptions
- type ObserveFromLatestEvent
- type ObserveIfEventIsMissing
- type Order
- type Precondition
- type ReadEventsOptions
- type ReadFromLatestEvent
- type ReadIfEventIsMissing
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 (*Client) ObserveEvents ¶ added in v0.29.0
func (*Client) ReadEventType ¶ added in v1.2.0
func (*Client) ReadEventTypes ¶ added in v0.29.0
func (*Client) ReadEvents ¶ added in v0.29.0
func (*Client) ReadSubjects ¶ added in v0.29.0
func (*Client) RegisterEventSchema ¶ added in v0.29.0
func (*Client) RunEventQLQuery ¶ added in v0.29.0
func (*Client) VerifyAPIToken ¶
func (*Client) WriteEvents ¶ added in v0.28.0
func (c *Client) WriteEvents(events []EventCandidate, preconditions []Precondition) ([]Event, error)
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer() *Container
func (*Container) GetAPIToken ¶
func (*Container) GetBaseURL ¶
func (*Container) GetMappedPort ¶
func (*Container) GetSigningKey ¶ added in v1.3.0
func (c *Container) GetSigningKey() (*ed25519.PrivateKey, error)
func (*Container) GetVerificationKey ¶ added in v1.3.0
func (*Container) WithAPIToken ¶
func (*Container) WithImageTag ¶
func (*Container) WithSigningKey ¶ added in v1.3.0
type Event ¶ added in v0.28.0
type Event struct {
SpecVersion string
ID string
Time time.Time
Source string
Subject string
Type string
DataContentType string
Data json.RawMessage
Hash string
PredecessorHash string
TraceParent *string
TraceState *string
Signature *string
}
func (Event) VerifyHash ¶ added in v1.3.0
type EventCandidate ¶ added in v0.28.0
type ObserveEventsOptions ¶ added in v0.29.0
type ObserveEventsOptions struct {
Recursive bool
LowerBound *Bound
FromLatestEvent *ObserveFromLatestEvent
}
type ObserveFromLatestEvent ¶ added in v0.29.0
type ObserveFromLatestEvent struct {
Subject string
Type string
IfEventIsMissing ObserveIfEventIsMissing
}
type ObserveIfEventIsMissing ¶ added in v0.29.0
type ObserveIfEventIsMissing string
const ( WaitForEventIfEventIsMissing ObserveIfEventIsMissing = "wait-for-event" ObserveEverythingIfEventIsMissing ObserveIfEventIsMissing = "read-everything" )
type Order ¶ added in v0.29.0
type Order string
func OrderAntichronological ¶ added in v0.29.0
func OrderAntichronological() *Order
func OrderChronological ¶ added in v0.29.0
func OrderChronological() *Order
type Precondition ¶ added in v0.28.0
type Precondition interface {
// contains filtered or unexported methods
}
func NewIsEventQLQueryTruePrecondition ¶ added in v1.2.1
func NewIsEventQLQueryTruePrecondition(query string) Precondition
func NewIsSubjectOnEventIDPrecondition ¶ added in v0.28.0
func NewIsSubjectOnEventIDPrecondition(subject string, eventID string) Precondition
func NewIsSubjectPristinePrecondition ¶ added in v0.28.0
func NewIsSubjectPristinePrecondition(subject string) Precondition
type ReadEventsOptions ¶ added in v0.29.0
type ReadEventsOptions struct {
Recursive bool
Order *Order
LowerBound *Bound
UpperBound *Bound
FromLatestEvent *ReadFromLatestEvent
}
type ReadFromLatestEvent ¶ added in v0.29.0
type ReadFromLatestEvent struct {
Subject string
Type string
IfEventIsMissing ReadIfEventIsMissing
}
type ReadIfEventIsMissing ¶ added in v0.29.0
type ReadIfEventIsMissing string
const ( ReadNothingIfEventIsMissing ReadIfEventIsMissing = "read-nothing" ReadEverythingIfEventIsMissing ReadIfEventIsMissing = "read-everything" )
Source Files
¶
- bound.go
- client.go
- container.go
- documentation.go
- event.go
- event_candidate.go
- event_type.go
- get_url.go
- is_eventql_query_true_precondition.go
- is_subject_on_event_id_precondition.go
- is_subject_pristine_precondition.go
- observe_events.go
- observe_events_options.go
- ping.go
- precondition.go
- read_event_type.go
- read_event_types.go
- read_events.go
- read_events_options.go
- read_subjects.go
- register_event_schema.go
- run_event_ql_query.go
- verify_api_token.go
- write_events.go
Click to show internal directories.
Click to hide internal directories.