Documentation ¶
Index ¶
- Constants
- Variables
- func PermissionedFullAPI(a api.FullNode) api.FullNode
- type CommonStruct
- func (c *CommonStruct) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
- func (c *CommonStruct) AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)
- func (c *CommonStruct) Closing(ctx context.Context) (<-chan struct{}, error)
- func (c *CommonStruct) LogList(ctx context.Context) ([]string, error)
- func (c *CommonStruct) LogSetLevel(ctx context.Context, group, level string) error
- func (c *CommonStruct) Shutdown(ctx context.Context) error
- func (c *CommonStruct) SysUptime(ctx context.Context) (string, error)
- func (c *CommonStruct) Version(ctx context.Context) (api.Version, error)
- type FullNodeStruct
Constants ¶
View Source
const ( PermRead auth.Permission = "read" // default PermWrite auth.Permission = "write" PermSign auth.Permission = "sign" // Use wallet keys for signing PermAdmin auth.Permission = "admin" // Manage permissions )
Variables ¶
View Source
var AllPermissions = []auth.Permission{PermRead, PermWrite, PermSign, PermAdmin}
View Source
var DefaultPerms = []auth.Permission{PermRead}
Functions ¶
Types ¶
type CommonStruct ¶
type CommonStruct struct { Internal struct { AuthVerify func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"read"` AuthNew func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"` SysUptime func(context.Context) (string, error) `perm:"read"` Version func(context.Context) (api.Version, error) `perm:"read"` LogList func(context.Context) ([]string, error) `perm:"write"` LogSetLevel func(context.Context, string, string) error `perm:"write"` Shutdown func(context.Context) error `perm:"admin"` Closing func(context.Context) (<-chan struct{}, error) `perm:"read"` } }
func (*CommonStruct) AuthNew ¶
func (c *CommonStruct) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
func (*CommonStruct) AuthVerify ¶
func (c *CommonStruct) AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)
func (*CommonStruct) Closing ¶
func (c *CommonStruct) Closing(ctx context.Context) (<-chan struct{}, error)
func (*CommonStruct) LogList ¶
func (c *CommonStruct) LogList(ctx context.Context) ([]string, error)
func (*CommonStruct) LogSetLevel ¶
func (c *CommonStruct) LogSetLevel(ctx context.Context, group, level string) error
type FullNodeStruct ¶
type FullNodeStruct struct { CommonStruct Internal struct { //star function WorkersList func(context.Context) (string, error) `perm:"read"` MinerInfo func(context.Context) (string, error) `perm:"read"` } }
FullNodeStruct implements API passing calls to user-provided function values.
func (*FullNodeStruct) MinerInfo ¶
func (c *FullNodeStruct) MinerInfo(ctx context.Context) (string, error)
func (*FullNodeStruct) WorkersList ¶
func (c *FullNodeStruct) WorkersList(ctx context.Context) (string, error)
FullNodeStruct
Click to show internal directories.
Click to hide internal directories.