Documentation ¶
Index ¶
- Constants
- type MongoDB
- func (md *MongoDB) Delete(ctx context.Context, name string) error
- func (md *MongoDB) Get(ctx context.Context, name string, doc interface{}) error
- func (md *MongoDB) GetAll(ctx context.Context, docs interface{}) error
- func (md *MongoDB) Init(ctx context.Context) (err error)
- func (md *MongoDB) Set(ctx context.Context, data interface{}) error
- func (md *MongoDB) Update(ctx context.Context, name string, data interface{}) error
- type MongoDBOpts
- type Storage
Constants ¶
View Source
const (
IncidentsColl = "incidents"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
type MongoDBOpts ¶
type Storage ¶
type Storage interface { Init(ctx context.Context) error Get(ctx context.Context, name string, item interface{}) error GetAll(ctx context.Context, items interface{}) error Set(ctx context.Context, data interface{}) error Delete(ctx context.Context, name string) error Update(ctx context.Context, name string, data interface{}) error }
Storage a common interface for all database storage
func NewMongoDB ¶
func NewMongoDB(opts *MongoDBOpts) (Storage, error)
Click to show internal directories.
Click to hide internal directories.