Documentation ¶
Index ¶
- Constants
- type Service
- func (s *Service) Create(ctx context.Context, kv *model.KVDoc) (*model.KVDoc, error)
- func (s *Service) Exist(ctx context.Context, domain, key string, project string, ...) (*model.KVDoc, error)
- func (s *Service) FindManyAndDelete(ctx context.Context, kvIDs []string, domain string, project string) ([]*model.KVDoc, error)
- func (s *Service) FindOneAndDelete(ctx context.Context, kvID string, domain string, project string) (*model.KVDoc, error)
- func (s *Service) Get(ctx context.Context, request *model.GetKVRequest) (*model.KVDoc, error)
- func (s *Service) List(ctx context.Context, domain, project string, options ...service.FindOption) (*model.KVResponse, error)
- func (s *Service) Total(ctx context.Context, domain string) (int64, error)
- func (s *Service) Update(ctx context.Context, kv *model.UpdateKVRequest) (*model.KVDoc, error)
Constants ¶
View Source
const ( MsgFindKvFailed = "find kv failed, deadline exceeded" MsgFindOneKey = "find one key" MsgCreateLabelFailed = "create label failed" FmtErrFindKvFailed = "can not find kv in %s" )
const of kv service
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service operate data in mongodb
func (*Service) Exist ¶
func (s *Service) Exist(ctx context.Context, domain, key string, project string, options ...service.FindOption) (*model.KVDoc, error)
Exist supports you query a key value by label map or labels id
func (*Service) FindManyAndDelete ¶
func (s *Service) FindManyAndDelete(ctx context.Context, kvIDs []string, domain string, project string) ([]*model.KVDoc, error)
FindManyAndDelete deletes multiple kvs and return the deleted kv list as these appeared before deletion
func (*Service) FindOneAndDelete ¶
func (s *Service) FindOneAndDelete(ctx context.Context, kvID string, domain string, project string) (*model.KVDoc, error)
FindOneAndDelete deletes one kv by id and return the deleted kv as these appeared before deletion domain=tenant
func (*Service) List ¶
func (s *Service) List(ctx context.Context, domain, project string, options ...service.FindOption) (*model.KVResponse, error)
List get kv list by key and criteria
Click to show internal directories.
Click to hide internal directories.