Documentation ¶
Index ¶
- func NewStatusHandler(e *echo.Echo, db *mongo.Database)
- func Open(ctx context.Context, cfg MongoConfig, logger *zap.Logger) (*mongo.Client, error)
- func Seed(ctx context.Context, db *mongo.Database) error
- func StatusCheck(ctx context.Context, db *mongo.Database) (*bson.M, error)
- func StructToDoc(v interface{}) (doc *bson.D, err error)
- type MongoConfig
- type StatusHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStatusHandler ¶
NewStatusHandler will initialize the /status endpoint
func StatusCheck ¶
StatusCheck gets database status and metrics
func StructToDoc ¶
StructToDoc transforms any struct to bson.D document
Types ¶
type MongoConfig ¶
type MongoConfig struct { Name string `yaml:"name"` User string `yaml:"user"` Password string `yaml:"pwd"` HostPort string `yaml:"host_port"` }
MongoConfig stores MongoDB configuration
type StatusHandler ¶
StatusHandler represent the http handler for status check
func (*StatusHandler) StatusCheckHandler ¶
func (h *StatusHandler) StatusCheckHandler(c echo.Context) error
StatusCheckHandler will get status of the database
Click to show internal directories.
Click to hide internal directories.