Documentation
¶
Index ¶
- func MongoDBConnect(ctx context.Context, mongoCfg *config.MongoConfig, ...) (*mongo.Client, error)
- func MongoGateStream(m *MongoReadiness, allowMethods ...string) grpc.StreamServerInterceptor
- func MongoGateUnary(m *MongoReadiness, allowMethods ...string) grpc.UnaryServerInterceptor
- type MongoReadiness
- func (m *MongoReadiness) CheckNow(ctx context.Context) error
- func (m *MongoReadiness) CloseGate(reason string)
- func (m *MongoReadiness) LastError() string
- func (m *MongoReadiness) OpenGate()
- func (m *MongoReadiness) Ready() bool
- func (m *MongoReadiness) Run(ctx context.Context, interval time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MongoDBConnect ¶
func MongoDBConnect(ctx context.Context, mongoCfg *config.MongoConfig, opts ...*options.ClientOptions) (*mongo.Client, error)
func MongoGateStream ¶ added in v0.1.3
func MongoGateStream(m *MongoReadiness, allowMethods ...string) grpc.StreamServerInterceptor
func MongoGateUnary ¶ added in v0.1.3
func MongoGateUnary(m *MongoReadiness, allowMethods ...string) grpc.UnaryServerInterceptor
Types ¶
type MongoReadiness ¶ added in v0.1.3
type MongoReadiness struct {
// contains filtered or unexported fields
}
func NewMongoReadiness ¶ added in v0.1.3
func NewMongoReadiness(client *mongo.Client, timeout time.Duration) *MongoReadiness
func (*MongoReadiness) CheckNow ¶ added in v0.1.3
func (m *MongoReadiness) CheckNow(ctx context.Context) error
func (*MongoReadiness) CloseGate ¶ added in v0.1.4
func (m *MongoReadiness) CloseGate(reason string)
func (*MongoReadiness) LastError ¶ added in v0.1.3
func (m *MongoReadiness) LastError() string
func (*MongoReadiness) OpenGate ¶ added in v0.1.4
func (m *MongoReadiness) OpenGate()
func (*MongoReadiness) Ready ¶ added in v0.1.3
func (m *MongoReadiness) Ready() bool
Click to show internal directories.
Click to hide internal directories.