Documentation ¶
Index ¶
Constants ¶
View Source
const ServiceName = "mongodb"
ServiceName mongodb
Variables ¶
View Source
var ( ErrorCollectionDoesNotExist = errors.New("collection not found in database") ErrorWithMongoDBConnection = errors.New("unable to connect with MongoDB") )
List of errors
View Source
var (
// HealthyMessage is the message that will be used in healthcheck when mongo is Healthy and all the collections exist
HealthyMessage = "mongodb is OK and all expected collections exist"
)
Functions ¶
This section is empty.
Types ¶
type CheckMongoClient ¶
type CheckMongoClient struct { Client Client Healthcheck Healthcheck }
CheckMongoClient is an implementation of the mongo client with a healthcheck
func (*CheckMongoClient) Checker ¶
func (c *CheckMongoClient) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker calls an api health endpoint and updates the provided CheckState accordingly
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a healthcheck.Client implementation for health checking the service
func NewClientWithCollections ¶ added in v1.5.0
func NewClientWithCollections(db *mgo.Session, clientDatabaseCollection map[Database][]Collection) *Client
NewClientWithCollections returns a new health check client containing the collections using the given service
Click to show internal directories.
Click to hide internal directories.