Documentation ¶
Index ¶
- func NewResource[T Resource]() T
- type BarSetLoader
- type Error
- type ErrorType
- type MongoStore
- func (s *MongoStore[T]) Create(ctx context.Context, val T) Error
- func (s *MongoStore[T]) Delete(ctx context.Context, key string) Error
- func (s *MongoStore[T]) Get(ctx context.Context, key string) (T, Error)
- func (s *MongoStore[T]) GetAll(ctx context.Context) ([]T, Error)
- func (s *MongoStore[T]) GetAllKeys(ctx context.Context) ([]string, Error)
- func (s *MongoStore[T]) GetInfo() *ResourceInfo
- func (s *MongoStore[T]) Reset(ctx context.Context) Error
- func (s *MongoStore[T]) Update(ctx context.Context, val T) Error
- type Resource
- type ResourceInfo
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResource ¶
func NewResource[T Resource]() T
Types ¶
type BarSetLoader ¶
func NewBarSetLoader ¶
type MongoStore ¶
type MongoStore[T Resource] struct { // contains filtered or unexported fields }
func (*MongoStore[T]) Delete ¶
func (s *MongoStore[T]) Delete(ctx context.Context, key string) Error
func (*MongoStore[T]) GetAllKeys ¶
func (s *MongoStore[T]) GetAllKeys(ctx context.Context) ([]string, Error)
func (*MongoStore[T]) GetInfo ¶
func (s *MongoStore[T]) GetInfo() *ResourceInfo
type ResourceInfo ¶
func (*ResourceInfo) NewErrNotFound ¶
func (rdef *ResourceInfo) NewErrNotFound(key string) Error
type Store ¶
type Store[T Resource] interface { GetInfo() *ResourceInfo Reset(ctx context.Context) Error Create(ctx context.Context, val T) Error Delete(ctx context.Context, key string) Error Get(ctx context.Context, key string) (T, Error) GetAll(ctx context.Context) ([]T, Error) GetAllKeys(ctx context.Context) ([]string, Error) Update(ctx context.Context, val T) Error }
func NewMongoStore ¶
func NewMongoStore[T Resource]( info *ResourceInfo, col *mongo.Collection, ) Store[T]
Click to show internal directories.
Click to hide internal directories.