mongo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	/*
		DefaultDB and DefaultCollection refere to the database and collection initiated by docker/mongo/initdb.js file
	*/
	DefaultDB         = "admin-server-db"
	DefaultCollection = "logs"
)

Functions

func NewMongoStorage

func NewMongoStorage(ctx xcontext.Context, uri string) (storage.Storage, error)

Types

type Log

type Log struct {
	JobID    uint64    `bson:"job_id"`
	LogData  string    `bson:"log_data"`
	Date     time.Time `bson:"date"`
	LogLevel string    `bson:"log_level"`
}

type MongoStorage

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

func (*MongoStorage) Close

func (s *MongoStorage) Close(ctx xcontext.Context) error

func (*MongoStorage) GetLogs

func (s *MongoStorage) GetLogs(ctx xcontext.Context, query storage.Query) (*storage.Result, error)

func (*MongoStorage) StoreLog

func (s *MongoStorage) StoreLog(ctx xcontext.Context, log storage.Log) error

Jump to

Keyboard shortcuts

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