db

package
v0.0.0-...-afcd3cb Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Entries(context.Context) ([]interface{}, error)
	EntriesMinutesAgo(context.Context, int, *options.FindOptions) (*mongo.Cursor, error)
	AddEntry(context.Context, interface{}) error
	DeleteAll(context.Context, string) error
	DatabaseCollection(string, string)
	Disconnect(context.Context) error
}

type Mongodb

type Mongodb struct {
	Conn       *mongo.Client
	Database   string
	Collection string
}

func (*Mongodb) AddEntry

func (m *Mongodb) AddEntry(ctx context.Context, e interface{}) error

func (*Mongodb) DatabaseCollection

func (m *Mongodb) DatabaseCollection(database string, collection string)

func (*Mongodb) DeleteAll

func (m *Mongodb) DeleteAll(ctx context.Context, message string) error

func (*Mongodb) Disconnect

func (m *Mongodb) Disconnect(ctx context.Context) error

func (*Mongodb) Entries

func (m *Mongodb) Entries(ctx context.Context) ([]interface{}, error)

func (*Mongodb) EntriesMinutesAgo

func (m *Mongodb) EntriesMinutesAgo(ctx context.Context, minutes int, opts *options.FindOptions) (*mongo.Cursor, error)

Jump to

Keyboard shortcuts

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