mongostore

package
v0.0.0-...-84d5eb4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DB constant represents db name
	DB = "myevents"

	// USERS constant represents db users collection
	USERS = "users"

	// EVENTS constant represents db events collection
	EVENTS = "events"
)

Variables

This section is empty.

Functions

func NewStore

func NewStore(connAddr string) (store.EventReadWriter, error)

NewStore creates a new mongodb store

Types

type MongoDBStore

type MongoDBStore struct {
	// contains filtered or unexported fields
}

MongoDBStore describes a mongodb store

func (*MongoDBStore) AddEvent

func (mgoStr *MongoDBStore) AddEvent(evt store.Event) ([]byte, error)

AddEvent add an event to mongoDB

func (*MongoDBStore) FindAllEvents

func (mgoStr *MongoDBStore) FindAllEvents() ([]store.Event, error)

FindAllEvents returns all events

func (*MongoDBStore) FindEvent

func (mgoStr *MongoDBStore) FindEvent(id []byte) (store.Event, error)

FindEvent finds an event with id

func (*MongoDBStore) FindEventByName

func (mgoStr *MongoDBStore) FindEventByName(name string) (store.Event, error)

FindEventByName finds an event with name

Jump to

Keyboard shortcuts

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