Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ILocalStrategy ¶
type ILocalStrategy interface { IStrategyVerify IStrategy }
func NewStrategy ¶
func NewStrategy(store storage.StrategyStore, nodeCli *node.NodeClient, mw storage.KeyMiddleware) ILocalStrategy
type IStrategy ¶
type IStrategy interface { NewMsgTypeTemplate(ctx context.Context, name string, codes []int) error NewMethodTemplate(ctx context.Context, name string, methods []string) error NewKeyBindCustom(ctx context.Context, name, address string, codes []int, methods []core.MethodName) error NewKeyBindFromTemplate(ctx context.Context, name, address, mttName, mtName string) error NewGroup(ctx context.Context, name string, keyBindNames []string) error NewWalletToken(ctx context.Context, groupName string) (token string, err error) GetMsgTypeTemplate(ctx context.Context, name string) (*storage.MsgTypeTemplate, error) GetMethodTemplateByName(ctx context.Context, name string) (*storage.MethodTemplate, error) GetKeyBindByName(ctx context.Context, name string) (*storage.KeyBind, error) GetKeyBinds(ctx context.Context, address string) ([]*storage.KeyBind, error) GetGroupByName(ctx context.Context, name string) (*storage.Group, error) GetWalletTokensByGroup(ctx context.Context, groupName string) ([]string, error) GetWalletTokenInfo(ctx context.Context, token string) (*storage.GroupAuth, error) ListGroups(ctx context.Context, fromIndex, toIndex int) ([]*storage.Group, error) ListKeyBinds(ctx context.Context, fromIndex, toIndex int) ([]*storage.KeyBind, error) ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error) ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error) PushMsgTypeIntoKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) PushMethodIntoKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) PullMsgTypeFromKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) PullMethodFromKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) RemoveMsgTypeTemplate(nctx context.Context, ame string) error RemoveGroup(ctx context.Context, name string) error RemoveMethodTemplate(ctx context.Context, name string) error RemoveKeyBind(ctx context.Context, name string) error RemoveKeyBindByAddress(ctx context.Context, address string) (int64, error) RemoveToken(ctx context.Context, token string) error }
type IStrategyVerify ¶
type IStrategyVerify interface { Verify(ctx context.Context, address core.Address, msgType core.MsgType, msg *core.Message) error //@bool: root can do anything ScopeWallet(ctx context.Context) (*core.AddressScope, error) ContainWallet(ctx context.Context, address core.Address) bool }
NOTE: for wallet
type StrategyCache ¶
type StrategyCache interface {
// contains filtered or unexported methods
}
StrategyCache memory based wallet policy cache
type VerifyFunc ¶
Click to show internal directories.
Click to hide internal directories.