Documentation
¶
Index ¶
- Constants
- func RemoveStore(uri string, logger *slog.Logger) error
- func URIFromPath(path string) string
- func URITemp() string
- func VacuumOnReadAck(mq *MQ)
- type MQ
- func (c *MQ) Close() error
- func (c *MQ) CurrentStream() string
- func (mq *MQ) Publish(topic string, payload []byte) (*Publication, error)
- func (mq *MQ) PublishAsync(topic string, payload []byte) *Publication
- func (mq *MQ) Queue(topic string, key string) (*Subscription, error)
- func (mq *MQ) Request(ctx context.Context, topic string, payload []byte) (*Subscription, error)
- func (c *MQ) Stream(stream string, ops ...Op) (*MQ, error)
- func (mq *MQ) Subscribe(topic string) (*Subscription, error)
- func (mq *MQ) SubscribeFrom(topic string, from time.Time) (*Subscription, error)
- type Msg
- type Op
- type Publication
- type Subscription
- type VacuumFunc
Constants ¶
View Source
const ( OptimizeLatency = iota OptimizeThroughput )
View Source
const DEFAULT_STREAM = "default"
Variables ¶
This section is empty.
Functions ¶
func URIFromPath ¶
func VacuumOnReadAck ¶ added in v0.1.0
func VacuumOnReadAck(mq *MQ)
Types ¶
type MQ ¶
type MQ struct {
// contains filtered or unexported fields
}
func (*MQ) CurrentStream ¶
func (*MQ) PublishAsync ¶
func (mq *MQ) PublishAsync(topic string, payload []byte) *Publication
func (*MQ) SubscribeFrom ¶
type Msg ¶
type Op ¶
func DBRemoveOnClose ¶
func DBRemoveOnClose() Op
DBRemoveOnClose is a helper function to remove the database files on close
func DBSyncOff ¶
func DBSyncOff() Op
DBSyncOff is a helper function to set
synchronous = off
this is useful for write performance but effects read performance and durability
func WithVacuum ¶ added in v0.1.0
func WithVacuum(vacuum VacuumFunc, interval time.Duration) Op
WithVacuum sets the logger for the cache
type Publication ¶
func (*Publication) Done ¶
func (p *Publication) Done() <-chan struct{}
type Subscription ¶
type Subscription struct { Unsubscribe func() // contains filtered or unexported fields }
func (*Subscription) Chan ¶
func (s *Subscription) Chan() <-chan Msg
func (*Subscription) Id ¶
func (s *Subscription) Id() string
func (*Subscription) Next ¶
func (s *Subscription) Next() (Msg, bool)
func (*Subscription) Topic ¶
func (s *Subscription) Topic() string
type VacuumFunc ¶ added in v0.1.0
type VacuumFunc func(*MQ)
func VacuumKeepN ¶ added in v0.1.0
func VacuumKeepN(n int) VacuumFunc
func VacuumOnAge ¶ added in v0.1.0
func VacuumOnAge(maxAge time.Duration) VacuumFunc
Click to show internal directories.
Click to hide internal directories.