Documentation ¶
Index ¶
- type Mongo
- func (m *Mongo) AddRecord(database string, collection string, record any) (string, error)
- func (m *Mongo) Connect() error
- func (m *Mongo) Disconnect() error
- func (m *Mongo) GetClient() *mongo.Client
- func (m *Mongo) GetConfig() MongoConfig
- func (m *Mongo) Init() (*Mongo, error)
- func (m *Mongo) RemoveRecord(database string, collection string, id string) error
- func (m *Mongo) ReplaceRecord(database string, collection string, id string, record any) error
- func (m *Mongo) RetrieveAll(database string, collection string, result any) error
- func (m *Mongo) RetrieveFiltered(database string, collection string, filter bson.D, result any) error
- func (m *Mongo) RetrieveOne(database string, collection string, id string, result any) error
- type MongoConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo creates and manages the db message queue connection
func (*Mongo) RemoveRecord ¶
RemoveRecord deletes a record into the db database
func (*Mongo) ReplaceRecord ¶
ReplaceRecord update a record in the db database
func (*Mongo) RetrieveAll ¶
RetrieveAll get all documents in a collection Needs to be an array of interfaces
type MongoConfig ¶
MongoConfig configuration structure for the db db
func (*MongoConfig) FromEnv ¶
func (n *MongoConfig) FromEnv() (*MongoConfig, error)
FromEnv creates a nats config using environmental variables
func (*MongoConfig) IsSet ¶
func (n *MongoConfig) IsSet() bool
IsSet checks if the configuration has been set Note: All fields required
Click to show internal directories.
Click to hide internal directories.