Documentation ¶
Index ¶
- Variables
- func CloseIterator(svc Service) endpoint.Endpoint
- func FetchFromIterator(svc Service) endpoint.Endpoint
- func IteratorEndpoint(svc Service) endpoint.Endpoint
- func MinifyMiddleware() endpoint.Middleware
- func NewIteratorEndpoint(svc Service) endpoint.Endpoint
- func StoreEndpoint(svc Service) endpoint.Endpoint
- type Config
- type DataType
- type Event
- type FetchFromIteratorRequest
- type Iterator
- type NewIteratorRequest
- type Payload
- func (p *Payload) Bytes() ([]byte, bool)
- func (p *Payload) JSON() (json.RawMessage, bool)
- func (p *Payload) MarshalJSON() ([]byte, error)
- func (p *Payload) SetBytes(data []byte)
- func (p *Payload) SetData(data any)
- func (p *Payload) SetJSON(data json.RawMessage)
- func (p *Payload) UnmarshalJSON(data []byte) error
- type Persistence
- type Repository
- type Service
- type ServiceMiddleware
- type StorageDriver
- type StoreRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyPayload = errors.New("empty payload") ErrIteratorNotFound = errors.New("iterator not found") ErrInvalidType = errors.New("invalid type") )
View Source
var (
ErrTimeout = errors.New("timeout")
)
Functions ¶
func CloseIterator ¶
func FetchFromIterator ¶
func IteratorEndpoint ¶
func MinifyMiddleware ¶
func MinifyMiddleware() endpoint.Middleware
func NewIteratorEndpoint ¶ added in v1.0.1
func StoreEndpoint ¶
Types ¶
type Config ¶
type Config struct { Persistence Persistence `yaml:"persistence"` Path string `yaml:"-"` }
type Event ¶
type NewIteratorRequest ¶ added in v1.0.1
type Payload ¶ added in v1.0.2
func NewPayload ¶ added in v1.0.2
func NewPayloadFromBytes ¶ added in v1.0.2
func NewPayloadFromJSON ¶ added in v1.0.2
func NewPayloadFromJSON(data json.RawMessage) Payload
func (*Payload) MarshalJSON ¶ added in v1.0.2
func (*Payload) SetJSON ¶ added in v1.0.2
func (p *Payload) SetJSON(data json.RawMessage)
func (*Payload) UnmarshalJSON ¶ added in v1.0.2
type Persistence ¶
type Persistence struct { Driver StorageDriver `yaml:"driver"` DSN string `yaml:"dsn"` }
type Repository ¶
type Service ¶
type Service interface { Up() Down() Store(topic string, payload Payload, ids ...ulid.ULID) error NewIterator(topic string, since time.Time) (string, error) Iterator(id string) (Iterator, error) // Iterator FetchFromIterator(batch int, id string) ([]*Event, error) CloseIterator(id string) error }
func NewService ¶
func NewService(events Repository) Service
type ServiceMiddleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(log *zap.Logger) ServiceMiddleware
type StorageDriver ¶
type StorageDriver string
const ( InMem StorageDriver = "inmem" BadgerDB StorageDriver = "badger" Redis StorageDriver = "redis" InfluxDB StorageDriver = "influxdb" InfluxDBv2 StorageDriver = "influxdb2" MySQL StorageDriver = "mysql" SQLServer StorageDriver = "sqlserver" PostgreSQL StorageDriver = "postgres" SQLite StorageDriver = "sqlite" // Document Database MongoDB StorageDriver = "mongo" )
type StoreRequest ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.