Documentation
¶
Index ¶
- type APIEndpoint
- type CommonAPIAdapter
- func (c *CommonAPIAdapter) AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)
- func (c *CommonAPIAdapter) AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)
- func (c *CommonAPIAdapter) LogList(ctx context.Context) ([]string, error)
- func (c *CommonAPIAdapter) LogSetLevel(ctx context.Context, group, level string) error
- func (c *CommonAPIAdapter) Version(ctx context.Context) (common.Version, error)
- type FullAPI
- type FullAPIAdapter
- type IFullAPI
- type StrategyAPIAdapter
- func (o *StrategyAPIAdapter) AddMethodIntoKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) AddMsgTypeIntoKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) ContainWallet(ctx context.Context, address core.Address) bool
- func (o *StrategyAPIAdapter) GetGroupByName(ctx context.Context, name string) (*storage.Group, error)
- func (o *StrategyAPIAdapter) GetKeyBindByName(ctx context.Context, name string) (*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) GetKeyBinds(ctx context.Context, address core.Address) ([]*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) GetMethodTemplateByName(ctx context.Context, name string) (*storage.MethodTemplate, error)
- func (o *StrategyAPIAdapter) GetMsgTypeTemplate(ctx context.Context, name string) (*storage.MsgTypeTemplate, error)
- func (o *StrategyAPIAdapter) GetWalletTokenInfo(ctx context.Context, token string) (*storage.GroupAuth, error)
- func (o *StrategyAPIAdapter) GetWalletTokensByGroup(ctx context.Context, groupName string) ([]string, error)
- func (o *StrategyAPIAdapter) ListGroups(ctx context.Context, fromIndex, toIndex int) ([]*storage.Group, error)
- func (o *StrategyAPIAdapter) ListKeyBinds(ctx context.Context, fromIndex, toIndex int) ([]*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error)
- func (o *StrategyAPIAdapter) ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error)
- func (o *StrategyAPIAdapter) NewGroup(ctx context.Context, name string, keyBindNames []string) error
- func (o *StrategyAPIAdapter) NewKeyBindCustom(ctx context.Context, name string, address core.Address, codes []int, ...) error
- func (o *StrategyAPIAdapter) NewKeyBindFromTemplate(ctx context.Context, name string, address core.Address, mttName, mtName string) error
- func (o *StrategyAPIAdapter) NewMethodTemplate(ctx context.Context, name string, methods []string) error
- func (o *StrategyAPIAdapter) NewMsgTypeTemplate(ctx context.Context, name string, codes []int) error
- func (o *StrategyAPIAdapter) NewStToken(ctx context.Context, groupName string) (token string, err error)
- func (o *StrategyAPIAdapter) RemoveGroup(ctx context.Context, name string) error
- func (o *StrategyAPIAdapter) RemoveKeyBind(ctx context.Context, name string) error
- func (o *StrategyAPIAdapter) RemoveKeyBindByAddress(ctx context.Context, address core.Address) (int64, error)
- func (o *StrategyAPIAdapter) RemoveMethodFromKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) RemoveMethodTemplate(ctx context.Context, name string) error
- func (o *StrategyAPIAdapter) RemoveMsgTypeFromKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error)
- func (o *StrategyAPIAdapter) RemoveMsgTypeTemplate(ctx context.Context, name string) error
- func (o *StrategyAPIAdapter) RemoveStToken(ctx context.Context, token string) error
- func (o *StrategyAPIAdapter) ScopeWallet(ctx context.Context) (*core.AddressScope, error)
- func (o *StrategyAPIAdapter) Verify(ctx context.Context, address core.Address, msgType core.MsgType, ...) error
- type WalletAPIAdapter
- func (c *WalletAPIAdapter) WalletDelete(ctx context.Context, addr core.Address) error
- func (c *WalletAPIAdapter) WalletExport(ctx context.Context, a core.Address) (*core.KeyInfo, error)
- func (c *WalletAPIAdapter) WalletHas(ctx context.Context, addr core.Address) (bool, error)
- func (c *WalletAPIAdapter) WalletImport(ctx context.Context, ki *core.KeyInfo) (core.Address, error)
- func (c *WalletAPIAdapter) WalletList(ctx context.Context) ([]core.Address, error)
- func (c *WalletAPIAdapter) WalletNew(ctx context.Context, keyType core.KeyType) (core.Address, error)
- func (c *WalletAPIAdapter) WalletSign(ctx context.Context, signer core.Address, toSign []byte, meta core.MsgMeta) (*core.Signature, error)
- type WalletEventAPIAdapter
- type WalletLockAPIAdapter
- func (c *WalletLockAPIAdapter) Lock(ctx context.Context, password string) error
- func (c *WalletLockAPIAdapter) LockState(ctx context.Context) bool
- func (c *WalletLockAPIAdapter) SetPassword(ctx context.Context, password string) error
- func (c *WalletLockAPIAdapter) Unlock(ctx context.Context, password string) error
- func (c *WalletLockAPIAdapter) VerifyPassword(ctx context.Context, password string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonAPIAdapter ¶ added in v1.2.0
type CommonAPIAdapter struct { Internal struct { AuthVerify func(ctx context.Context, token string) ([]permission.Permission, error) `perm:"read"` AuthNew func(ctx context.Context, perms []permission.Permission) ([]byte, error) `perm:"admin"` Version func(context.Context) (common.Version, error) `perm:"read"` LogList func(context.Context) ([]string, error) `perm:"write"` LogSetLevel func(context.Context, string, string) error `perm:"write"` } }
common API permissions constraints
func (*CommonAPIAdapter) AuthNew ¶ added in v1.2.0
func (c *CommonAPIAdapter) AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)
func (*CommonAPIAdapter) AuthVerify ¶ added in v1.2.0
func (c *CommonAPIAdapter) AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)
func (*CommonAPIAdapter) LogList ¶ added in v1.2.0
func (c *CommonAPIAdapter) LogList(ctx context.Context) ([]string, error)
func (*CommonAPIAdapter) LogSetLevel ¶ added in v1.2.0
func (c *CommonAPIAdapter) LogSetLevel(ctx context.Context, group, level string) error
type FullAPI ¶
type FullAPI struct { strategy.ILocalStrategy wallet.ILocalWallet common.ICommon wallet_event.IWalletEventAPI }
type FullAPIAdapter ¶ added in v1.2.0
type FullAPIAdapter struct { CommonAPIAdapter WalletAPIAdapter WalletLockAPIAdapter StrategyAPIAdapter WalletEventAPIAdapter }
full service API permissions constraints
type IFullAPI ¶
type IFullAPI interface { strategy.ILocalStrategy wallet.ILocalWallet common.ICommon wallet_event.IWalletEventAPI }
func PermissionedFullAPI ¶
type StrategyAPIAdapter ¶ added in v1.2.0
type StrategyAPIAdapter struct { Internal struct { NewMsgTypeTemplate func(ctx context.Context, name string, codes []int) error `perm:"admin" local:"required"` NewMethodTemplate func(ctx context.Context, name string, methods []string) error `perm:"admin" local:"required"` NewKeyBindCustom func(ctx context.Context, name string, address core.Address, codes []int, methods []core.MethodName) error `perm:"admin" local:"required"` NewKeyBindFromTemplate func(ctx context.Context, name string, address core.Address, mttName, mtName string) error `perm:"admin" local:"required"` NewGroup func(ctx context.Context, name string, keyBindNames []string) error `perm:"admin" local:"required"` NewStToken func(ctx context.Context, groupName string) (token string, err error) `perm:"admin" local:"required"` GetMsgTypeTemplate func(ctx context.Context, name string) (*storage.MsgTypeTemplate, error) `perm:"admin" local:"required"` GetMethodTemplateByName func(ctx context.Context, name string) (*storage.MethodTemplate, error) `perm:"admin" local:"required"` GetKeyBindByName func(ctx context.Context, name string) (*storage.KeyBind, error) `perm:"admin" local:"required"` GetKeyBinds func(ctx context.Context, address core.Address) ([]*storage.KeyBind, error) `perm:"admin" local:"required"` GetGroupByName func(ctx context.Context, name string) (*storage.Group, error) `perm:"admin" local:"required"` GetWalletTokensByGroup func(ctx context.Context, groupName string) ([]string, error) `perm:"admin" local:"required"` GetWalletTokenInfo func(ctx context.Context, token string) (*storage.GroupAuth, error) `perm:"admin" local:"required"` ListGroups func(ctx context.Context, fromIndex, toIndex int) ([]*storage.Group, error) `perm:"admin" local:"required"` ListKeyBinds func(ctx context.Context, fromIndex, toIndex int) ([]*storage.KeyBind, error) `perm:"admin" local:"required"` ListMethodTemplates func(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error) `perm:"admin" local:"required"` ListMsgTypeTemplates func(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error) `perm:"admin" local:"required"` AddMsgTypeIntoKeyBind func(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) `perm:"admin" local:"required"` AddMethodIntoKeyBind func(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) `perm:"admin" local:"required"` RemoveMsgTypeFromKeyBind func(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) `perm:"admin" local:"required"` RemoveMethodFromKeyBind func(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) `perm:"admin" local:"required"` RemoveStToken func(ctx context.Context, token string) error `perm:"admin" local:"required"` RemoveKeyBind func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveKeyBindByAddress func(ctx context.Context, address core.Address) (int64, error) `perm:"admin" local:"required"` RemoveGroup func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveMethodTemplate func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveMsgTypeTemplate func(ctx context.Context, name string) error `perm:"admin" local:"required"` ScopeWallet func(ctx context.Context) (*core.AddressScope, error) `perm:"admin" local:"required"` ContainWallet func(ctx context.Context, address core.Address) bool `perm:"admin" local:"required"` Verify func(ctx context.Context, address core.Address, msgType core.MsgType, msg *core.Message) error `perm:"admin" local:"required"` } }
func (*StrategyAPIAdapter) AddMethodIntoKeyBind ¶ added in v1.3.0
func (*StrategyAPIAdapter) AddMsgTypeIntoKeyBind ¶ added in v1.3.0
func (*StrategyAPIAdapter) ContainWallet ¶ added in v1.2.0
func (*StrategyAPIAdapter) GetGroupByName ¶ added in v1.2.0
func (*StrategyAPIAdapter) GetKeyBindByName ¶ added in v1.2.0
func (*StrategyAPIAdapter) GetKeyBinds ¶ added in v1.2.0
func (*StrategyAPIAdapter) GetMethodTemplateByName ¶ added in v1.2.0
func (o *StrategyAPIAdapter) GetMethodTemplateByName(ctx context.Context, name string) (*storage.MethodTemplate, error)
func (*StrategyAPIAdapter) GetMsgTypeTemplate ¶ added in v1.2.0
func (o *StrategyAPIAdapter) GetMsgTypeTemplate(ctx context.Context, name string) (*storage.MsgTypeTemplate, error)
func (*StrategyAPIAdapter) GetWalletTokenInfo ¶ added in v1.2.0
func (*StrategyAPIAdapter) GetWalletTokensByGroup ¶ added in v1.2.0
func (*StrategyAPIAdapter) ListGroups ¶ added in v1.2.0
func (*StrategyAPIAdapter) ListKeyBinds ¶ added in v1.2.0
func (*StrategyAPIAdapter) ListMethodTemplates ¶ added in v1.2.0
func (o *StrategyAPIAdapter) ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error)
func (*StrategyAPIAdapter) ListMsgTypeTemplates ¶ added in v1.2.0
func (o *StrategyAPIAdapter) ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error)
func (*StrategyAPIAdapter) NewKeyBindCustom ¶ added in v1.2.0
func (o *StrategyAPIAdapter) NewKeyBindCustom(ctx context.Context, name string, address core.Address, codes []int, methods []core.MethodName) error
func (*StrategyAPIAdapter) NewKeyBindFromTemplate ¶ added in v1.2.0
func (*StrategyAPIAdapter) NewMethodTemplate ¶ added in v1.2.0
func (*StrategyAPIAdapter) NewMsgTypeTemplate ¶ added in v1.2.0
func (*StrategyAPIAdapter) NewStToken ¶ added in v1.3.0
func (*StrategyAPIAdapter) RemoveGroup ¶ added in v1.2.0
func (o *StrategyAPIAdapter) RemoveGroup(ctx context.Context, name string) error
func (*StrategyAPIAdapter) RemoveKeyBind ¶ added in v1.2.0
func (o *StrategyAPIAdapter) RemoveKeyBind(ctx context.Context, name string) error
func (*StrategyAPIAdapter) RemoveKeyBindByAddress ¶ added in v1.2.0
func (*StrategyAPIAdapter) RemoveMethodFromKeyBind ¶ added in v1.3.0
func (*StrategyAPIAdapter) RemoveMethodTemplate ¶ added in v1.2.0
func (o *StrategyAPIAdapter) RemoveMethodTemplate(ctx context.Context, name string) error
func (*StrategyAPIAdapter) RemoveMsgTypeFromKeyBind ¶ added in v1.3.0
func (*StrategyAPIAdapter) RemoveMsgTypeTemplate ¶ added in v1.2.0
func (o *StrategyAPIAdapter) RemoveMsgTypeTemplate(ctx context.Context, name string) error
func (*StrategyAPIAdapter) RemoveStToken ¶ added in v1.3.0
func (o *StrategyAPIAdapter) RemoveStToken(ctx context.Context, token string) error
func (*StrategyAPIAdapter) ScopeWallet ¶ added in v1.2.0
func (o *StrategyAPIAdapter) ScopeWallet(ctx context.Context) (*core.AddressScope, error)
type WalletAPIAdapter ¶ added in v1.2.0
type WalletAPIAdapter struct { Internal struct { WalletNew func(ctx context.Context, kt core.KeyType) (core.Address, error) `perm:"admin"` WalletHas func(ctx context.Context, address core.Address) (bool, error) `perm:"read"` WalletList func(ctx context.Context) ([]core.Address, error) `perm:"read"` WalletSign func(ctx context.Context, signer core.Address, toSign []byte, meta core.MsgMeta) (*core.Signature, error) `perm:"sign"` WalletExport func(ctx context.Context, addr core.Address) (*core.KeyInfo, error) `perm:"admin"` WalletImport func(ctx context.Context, ki *core.KeyInfo) (core.Address, error) `perm:"admin"` WalletDelete func(ctx context.Context, addr core.Address) error `perm:"admin"` } }
wallet API permissions constraints
func (*WalletAPIAdapter) WalletDelete ¶ added in v1.2.0
func (*WalletAPIAdapter) WalletExport ¶ added in v1.2.0
func (*WalletAPIAdapter) WalletImport ¶ added in v1.2.0
func (*WalletAPIAdapter) WalletList ¶ added in v1.2.0
type WalletEventAPIAdapter ¶ added in v1.2.0
type WalletEventAPIAdapter struct { Internal struct { AddSupportAccount func(ctx context.Context, supportAccount string) error `perm:"admin"` AddNewAddress func(ctx context.Context, newAddrs []address.Address) error `perm:"admin"` } }
func (WalletEventAPIAdapter) AddNewAddress ¶ added in v1.2.0
func (w WalletEventAPIAdapter) AddNewAddress(ctx context.Context, newAddrs []address.Address) error
func (WalletEventAPIAdapter) AddSupportAccount ¶ added in v1.2.0
func (w WalletEventAPIAdapter) AddSupportAccount(ctx context.Context, supportAccount string) error
type WalletLockAPIAdapter ¶ added in v1.2.0
type WalletLockAPIAdapter struct { Internal struct { SetPassword func(ctx context.Context, password string) error `perm:"admin" local:"required"` Unlock func(ctx context.Context, password string) error `perm:"admin" local:"required"` Lock func(ctx context.Context, password string) error `perm:"admin" local:"required"` VerifyPassword func(ctx context.Context, password string) error `perm:"admin" local:"required"` LockState func(ctx context.Context) bool `perm:"admin"` } }
func (*WalletLockAPIAdapter) Lock ¶ added in v1.2.0
func (c *WalletLockAPIAdapter) Lock(ctx context.Context, password string) error
func (*WalletLockAPIAdapter) LockState ¶ added in v1.2.0
func (c *WalletLockAPIAdapter) LockState(ctx context.Context) bool
func (*WalletLockAPIAdapter) SetPassword ¶ added in v1.2.0
func (c *WalletLockAPIAdapter) SetPassword(ctx context.Context, password string) error
func (*WalletLockAPIAdapter) Unlock ¶ added in v1.2.0
func (c *WalletLockAPIAdapter) Unlock(ctx context.Context, password string) error
func (*WalletLockAPIAdapter) VerifyPassword ¶ added in v1.2.1
func (c *WalletLockAPIAdapter) VerifyPassword(ctx context.Context, password string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.