Documentation ¶
Index ¶
- Constants
- Variables
- func FilterEquals(key string, val string) interface{}
- type DBLogs
- type MongoClient
- func (mc *MongoClient) AddLogs(level string, message string, details map[string]interface{}) error
- func (mc *MongoClient) FindDocuments(filter interface{}, res interface{}, opts ...*options.FindOptions) error
- func (mc *MongoClient) FindOneDocument(filter interface{}, res interface{}) error
- func (mc *MongoClient) GetLogs(n int, skip int) ([]DBLogs, error)
- func (mc *MongoClient) InsertDocument(doc interface{}) error
- func (mc *MongoClient) Start() error
- func (mc *MongoClient) Stop() error
- func (mc *MongoClient) UpdateDocument(filter interface{}, doc interface{}) error
- type MongoConfig
Constants ¶
View Source
const ( MongoDatabase = "nlib" MongoCollection = "logs" )
Variables ¶
View Source
var (
ErrNoDocuments = errors.New("no documents")
)
Functions ¶
func FilterEquals ¶
Types ¶
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
func NewMongoClient ¶
func NewMongoClient(mongoURI string) *MongoClient
func (*MongoClient) AddLogs ¶
func (mc *MongoClient) AddLogs(level string, message string, details map[string]interface{}) error
func (*MongoClient) FindDocuments ¶
func (mc *MongoClient) FindDocuments(filter interface{}, res interface{}, opts ...*options.FindOptions) error
func (*MongoClient) FindOneDocument ¶
func (mc *MongoClient) FindOneDocument(filter interface{}, res interface{}) error
func (*MongoClient) InsertDocument ¶
func (mc *MongoClient) InsertDocument(doc interface{}) error
func (*MongoClient) Start ¶
func (mc *MongoClient) Start() error
func (*MongoClient) Stop ¶
func (mc *MongoClient) Stop() error
func (*MongoClient) UpdateDocument ¶
func (mc *MongoClient) UpdateDocument(filter interface{}, doc interface{}) error
type MongoConfig ¶
Click to show internal directories.
Click to hide internal directories.