Documentation ¶
Overview ¶
Package owner provides method for storing in chaincode state information about chaincode owner
Index ¶
- Constants
- Variables
- func Get(c r.Context) (*identity.Entry, error)
- func IdentityEntryFromState(c r.Context) (identity.Entry, error)
- func Insert(c r.Context, mspID string, cert []byte) (*identity.Entry, error)
- func InvokeSetFromArgs(c router.Context) (interface{}, error)
- func InvokeSetFromCreator(c router.Context) (interface{}, error)
- func IsInvoker(c r.Context) (bool, error)
- func IsInvokerOr(c r.Context, allowedTo ...identity.Identity) (bool, error)
- func IsSetted(c r.Context) (bool, error)
- func Only(next router.HandlerFunc, pos ...int) router.HandlerFunc
- func Query(c router.Context) (interface{}, error)
- func SetFromArgs(c r.Context) (*identity.Entry, error)
- func SetFromCreator(c r.Context) (*identity.Entry, error)
Constants ¶
View Source
const OwnerStateKey = `OWNER`
OwnerStateKey key used to store owner grant struct in chain code state
View Source
const QueryMethod = `owner`
Variables ¶
View Source
var ( // ErrOwnerNotProvided occurs when providing owner identity in init arguments ErrOwnerNotProvided = errors.New(`owner not provided`) // ErrOwnerAlreadySetted owner already setted ErrOwnerAlreadySetted = errors.New(`owner already setted`) )
View Source
var ( // ErrOwnerOnly error occurs when trying to invoke chaincode func protected by onlyOwner middleware (modifier) ErrOwnerOnly = errors.New(`owner only`) )
Functions ¶
func IdentityEntryFromState ¶
IdentityFromState
func InvokeSetFromArgs ¶ added in v0.3.0
InvokeSetFromArgs gets owner data fron args[0] (Msp Id) and arg[1] (cert)
func InvokeSetFromCreator ¶ added in v0.3.0
InvokeSetFromCreator sets tx creator as chaincode owner, if owner not previously setted
func IsInvokerOr ¶
IsInvokerOr checks tx creator and compares with owner of another identity
func Only ¶
func Only(next router.HandlerFunc, pos ...int) router.HandlerFunc
Only allow access from chain code owner
func SetFromArgs ¶
SetFromArgs set owner fron first args
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.