Documentation
¶
Index ¶
- func GetContextValueDatabase(ctx context.Context, key interface{}) database.Database
- func GetMsgFromDB(db database.Database, key []byte, msg proto.Message) error
- func GetMsgFromParam(params graphql.ResolveParams, paramName string, msg proto.Message) error
- func MakeGraphQLErrorResult(code pb.CODE) *graphql.Result
- func MakeMsgFromResult(result *graphql.Result, msg proto.Message) error
- func MakeObjFromResult(result *graphql.Result, obj interface{}) error
- func MakeParamsFromMsg(params map[string]interface{}, paramName string, msg proto.Message) error
- func PutMsg2DB(db database.Database, key []byte, msg proto.Message) error
- type AnkaDB
- type Config
- type DBConfig
- type DBLogic
- type DBMgr
- type FuncOnQueryStream
- type SnapshotMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextValueDatabase ¶
GetContextValueDatabase -
func GetMsgFromDB ¶
GetMsgFromDB - get protobuf message from database
func GetMsgFromParam ¶
GetMsgFromParam - get protobuf message from param
func MakeGraphQLErrorResult ¶
MakeGraphQLErrorResult -
func MakeMsgFromResult ¶
MakeMsgFromResult - make protobuf object from graphql.Result
func MakeObjFromResult ¶
MakeObjFromResult - make object from graphql.Result
func MakeParamsFromMsg ¶
MakeParamsFromMsg - change protobuf message to param
Types ¶
type AnkaDB ¶
type AnkaDB struct {
MgrDB DBMgr
// contains filtered or unexported fields
}
AnkaDB -
func GetContextValueAnkaDB ¶
GetContextValueAnkaDB -
type Config ¶
type Config struct {
AddrGRPC string `yaml:"addrgrpc"`
PathDBRoot string `yaml:"pathdbroot"`
AddrHTTP string `yaml:"addrhttp"`
ListDB []DBConfig `yaml:"listdb"`
}
Config -
type DBConfig ¶
type DBConfig struct {
Name string `yaml:"name"`
Engine string `yaml:"engine"`
PathDB string `yaml:"pathdb"`
}
DBConfig -
type DBLogic ¶
type DBLogic interface {
OnQuery(ctx context.Context, request string, values map[string]interface{}) (*graphql.Result, error)
OnQueryStream(ctx context.Context, request string, values map[string]interface{}, funcOnQueryStream FuncOnQueryStream) error
}
DBLogic -
type DBMgr ¶
type DBMgr interface {
AddDB(cfg DBConfig) error
GetDB(name string) database.Database
GetMgrSnapshot(name string) *SnapshotMgr
}
DBMgr -
type FuncOnQueryStream ¶
type FuncOnQueryStream func(*pb.ReplyQuery)
FuncOnQueryStream - use in DBLogic.OnQueryStream
type SnapshotMgr ¶
type SnapshotMgr struct {
// contains filtered or unexported fields
}
SnapshotMgr - key list snapshot
func (*SnapshotMgr) Add ¶
func (mgr *SnapshotMgr) Add(pSnapshot *pb.Snapshot) (int64, error)
Add - add snapshot
func (*SnapshotMgr) Get ¶
func (mgr *SnapshotMgr) Get(snapshotid int64) *pb.Snapshot
Get - get snapshot
func (*SnapshotMgr) NewSnapshot ¶
func (mgr *SnapshotMgr) NewSnapshot(prefix []byte) (*pb.Snapshot, error)
NewSnapshot - new snapshot
Source Files
¶
Click to show internal directories.
Click to hide internal directories.