Documentation
¶
Index ¶
- type Mongo
- func (m *Mongo) CheckTopicExists(id string) error
- func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (m *Mongo) Close(ctx context.Context) error
- func (m *Mongo) GetContent(id string) (*models.ContentResponse, error)
- func (m *Mongo) GetTopic(id string) (*models.TopicResponse, error)
- func (m *Mongo) Init(ctx context.Context) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct {
Session *mgo.Session
URI string
Database string
TopicsCollection string
ContentCollection string
// contains filtered or unexported fields
}
Mongo represents a simplistic MongoDB config, with session, health and lock clients
func (*Mongo) CheckTopicExists ¶ added in v0.4.0
CheckTopicExists checks that the topic exists
func (*Mongo) Checker ¶
func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker is called by the healthcheck library to check the health state of this mongoDB instance
func (*Mongo) GetContent ¶ added in v0.4.0
func (m *Mongo) GetContent(id string) (*models.ContentResponse, error)
GetContent retrieves a content document by its ID
Click to show internal directories.
Click to hide internal directories.