clean

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus[T, K comparable, E any] interface {
	Emitter[T, E]
	Subscriber[T, E]
}

type EV

type EV struct{}

func (*EV) Emit

func (*EV) Emit(topic string, event evvent) error

func (*EV) EventLog

func (*EV) EventLog(topic string) List[string, uint64, evvent]

func (*EV) Load

func (*EV) Load(topic string, a aggr) error

func (*EV) Store

func (*EV) Store(a aggr) error

func (*EV) Subscribe

func (*EV) Subscribe(topic string, after uint64) evvesub

func (*EV) Truncate

func (*EV) Truncate(topic string) error

type Edge

type Edge[C, K comparable] struct {
	Key    K
	Kursor C
}

type Emitter

type Emitter[T comparable, E any] interface {
	Emit(T, E) error
}

type Event

type Event[T, C comparable, V any] struct {
	Topic    T
	Position C
	Payload  V
}

type EventLog

type EventLog[T, K, C comparable, E any] interface {
	EventLog(T) List[K, C, E]
}

type EventStore

type EventStore[T, K, C comparable, E, A any] interface {
	Bus[T, K, E]
	EventLog[T, K, C, E]

	Load(T, A) error
	Store(A) error
	Truncate(T) error
}

type GPD

type GPD[K comparable, V any] interface {
	Get(...K) ([]V, error)
	Put(K, V) error
	Delete(K) error
}

type LOG

type LOG struct{}

func (*LOG) First

func (*LOG) First(n uint64, after string) ([]PAGE, error)

func (*LOG) Last

func (*LOG) Last(n uint64, before string) ([]PAGE, error)

type List

type List[K, C comparable, V any] interface {
	First(n uint64, after C) ([]Page[C, K], error)
	Last(n uint64, before C) ([]Page[C, K], error)
}

type PAGE

type PAGE = Page[string, string]

type Page

type Page[C, K comparable] struct {
	Edges Edge[C, K]
	Start C
	End   C
	Next  bool
	Prev  bool
}

type SUB

type SUB struct{}

func (*SUB) Close

func (*SUB) Close()

func (*SUB) Events

func (*SUB) Events() []evvent

func (*SUB) Recv

func (*SUB) Recv() error

type Subscriber

type Subscriber[T comparable, E any] interface {
	Subscribe(T, uint64) Subscription[E]
}

type Subscription

type Subscription[E any] interface {
	Recv() error
	Events() []E
	Close()
}

Jump to

Keyboard shortcuts

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