db

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 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) (interface{}, 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) (interface{}, error)

Jump to

Keyboard shortcuts

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