mongo

package
v0.0.0-...-765649b Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionCollection = "actions"
	EventsCollection = "events"
)

Functions

This section is empty.

Types

type DB

type DB struct {
	DB *mongo.Database
}

func NewMongoDB

func NewMongoDB(database *mongo.Database) *DB

func (*DB) GetAction

func (s *DB) GetAction(ctx context.Context, id primitive.ObjectID) (model.Action, error)

func (*DB) GetEvent

func (s *DB) GetEvent(ctx context.Context, eventID string, actionID string) (model.Event, error)

func (*DB) GetEventStatus

func (s *DB) GetEventStatus(ctx context.Context, actionID string) ([]response.EventStatusResponse, error)

func (*DB) GetEvents

func (s *DB) GetEvents(ctx context.Context, actionID string) ([]response.EventResponse, error)

func (*DB) StoreAction

func (s *DB) StoreAction(ctx context.Context, id primitive.ObjectID, t []string, eventCount int) (string, error)

func (*DB) StoreEvent

func (s *DB) StoreEvent(ctx context.Context, event *model.Event) (string, error)

func (*DB) UpdateEventStatus

func (s *DB) UpdateEventStatus(ctx context.Context, eventID string) *mongo.UpdateResult

Jump to

Keyboard shortcuts

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