Documentation ¶
Index ¶
- type Setup
- type User
- func (u *User) QueryAdmin() (*model.Admin, error)
- func (u *User) QueryConsumer() (*model.Consumer, error)
- func (u *User) QueryResource(resourceID string) (*model.Resource, model.ResourceHistories, error)
- func (u *User) QueryResources(filter string) ([]model.Resource, error)
- func (u *User) QueryResourcesDeleted() (model.ResourcesDeleted, error)
- func (u *User) UpdateAcquire(resourceID string, mission string) error
- func (u *User) UpdateAdd(resourceID, resourceDescription string) error
- func (u *User) UpdateDelete(resourceID string) error
- func (u *User) UpdateRegister() error
- func (u *User) UpdateRelease(resourceID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Setup ¶
type Setup struct { ChannelID string ChannelConfig string ChaincodeID string ChaincodeGoPath string ChaincodePath string ChaincodeVersion string OrgID string OrgMspID string OrgAdminUser string OrdererOrgID string OrdererOrgAdminUser string OrdererID string CaID string ConfigFile string // contains filtered or unexported fields }
Setup implementation of the Hyperledger Fabric blockchain SDK
func (*Setup) CloseSDK ¶
func (s *Setup) CloseSDK()
CloseSDK allow to close communication between the initialized blockchain client and the network
func (*Setup) Initialize ¶
Initialize reads the configuration stored in the Setup struct and sets up the blockchain client
func (*Setup) Install ¶
Install reads the configuration stored in the Setup struct and sets up the blockchain channel and chaincode
func (*Setup) LogUser ¶
LogUser allow to login a user using credentials provided and retrieve the blockchain user related
func (*Setup) RegisterUser ¶
RegisterUser register a user to the Fabric CA client and into the blockchain using invoke on the chaincode
type User ¶
type User struct { Username string Fabric *Setup ChannelClient *channel.Client SigningIdentity msp.SigningIdentity }
User stuct that allow a registered user to query and invoke the blockchain
func (*User) QueryAdmin ¶
QueryAdmin query the blockchain chaincode to retrieve information about the current admin user connected
func (*User) QueryConsumer ¶
QueryConsumer query the blockchain chaincode to retrieve information about the current consumer user connected
func (*User) QueryResource ¶
QueryResource query the blockchain chaincode to get resource details
func (*User) QueryResources ¶
QueryResources query the blockchain chaincode to retrieve resources
func (*User) QueryResourcesDeleted ¶
func (u *User) QueryResourcesDeleted() (model.ResourcesDeleted, error)
QueryResourcesDeleted query the blockchain chaincode to delete a resource
func (*User) UpdateAcquire ¶
UpdateAcquire allow to acquire a resource into the blockchain
func (*User) UpdateDelete ¶
UpdateDelete allow to delete a resource into the blockchain
func (*User) UpdateRegister ¶
UpdateRegister allow to register a user into the blockchain
func (*User) UpdateRelease ¶
UpdateRelease allow to release a resource into the blockchain