mongo

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventRepository

func NewEventRepository(cfg events.Persistence) (events.Repository, error)

Types

type Config

type Config struct {
	URI        string
	Database   string
	Collection string
	Duration   time.Duration
}

type Event

type Event struct {
	Time    time.Time      `bson:"_time"`
	ID      ulid.ULID      `bson:"id"`
	Topic   string         `bson:"topic"`
	Payload events.Payload `bson:"payload"`
}

func NewEvent

func NewEvent(e *events.Event) *Event

func (*Event) Event

func (e *Event) Event() *events.Event

type EventRepository

type EventRepository interface {
	events.Repository
	DropDatabase(name string) error
}

type PayloadCodec

type PayloadCodec interface {
	bsoncodec.ValueEncoder
	bsoncodec.ValueDecoder
}

func NewPayloadCodec

func NewPayloadCodec() PayloadCodec

type ULIDCodec

type ULIDCodec interface {
	bsoncodec.ValueEncoder
	bsoncodec.ValueDecoder
}

func NewULIDCodec

func NewULIDCodec() ULIDCodec

Jump to

Keyboard shortcuts

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