Documentation
¶
Index ¶
- func GetAllIDRefs(id string)
- func InitConfig()
- func PrintConfig()
- type Address
- type Asset
- type AssetType
- type ChainConnection
- func (c *ChainConnection) CloseConnection()
- func (c *ChainConnection) CreateAsset(a *Asset) error
- func (c *ChainConnection) DeleteAsset(id string) (string, error)
- func (c *ChainConnection) GetAllAssets() ([]Asset, error)
- func (c *ChainConnection) GetMetadata() (string, error)
- func (c *ChainConnection) InitLedger()
- func (c *ChainConnection) ReadAssetByID(id string) (Asset, error)
- func (c *ChainConnection) UpdateAsset(a *Asset) error
- type CocoaBag
- type Farm
- type Farmer
- type HypercocoaConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllIDRefs ¶
func GetAllIDRefs(id string)
Types ¶
type Asset ¶
func (*Asset) ToCocoaBag ¶
toCocoaBag converts an Asset to CocoaBag struct
func (*Asset) ToPrettyJson ¶
func (*Asset) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Asset using the helper class
type AssetType ¶
type AssetType int64
func (AssetType) MarshalJSON ¶
func (*AssetType) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value
type ChainConnection ¶
type ChainConnection struct {
// contains filtered or unexported fields
}
func CreateChainConnection ¶
func CreateChainConnection() *ChainConnection
func (*ChainConnection) CloseConnection ¶
func (c *ChainConnection) CloseConnection()
func (*ChainConnection) CreateAsset ¶
func (c *ChainConnection) CreateAsset(a *Asset) error
CreateAsset Creates an asset synchronously
func (*ChainConnection) DeleteAsset ¶
func (c *ChainConnection) DeleteAsset(id string) (string, error)
DeleteAsset deletes a single Asset synchronously
func (*ChainConnection) GetAllAssets ¶
func (c *ChainConnection) GetAllAssets() ([]Asset, error)
GetAllAssets Returns all Assets on the ledger
func (*ChainConnection) GetMetadata ¶
func (c *ChainConnection) GetMetadata() (string, error)
GetMetadata returns all the metadata of the chaincode, e.g. available functions
func (*ChainConnection) InitLedger ¶
func (c *ChainConnection) InitLedger()
InitLedger runs the InitLedger function on the chaincode, which currently creates some dummy assets
func (*ChainConnection) ReadAssetByID ¶
func (c *ChainConnection) ReadAssetByID(id string) (Asset, error)
ReadAssetByID queries a single Asset
func (*ChainConnection) UpdateAsset ¶
func (c *ChainConnection) UpdateAsset(a *Asset) error
UpdateAsset Creates an asset synchronously
type CocoaBag ¶
type CocoaBag struct {
ID string
Type string
Weight int
FarmReference string
FactoryReference string `json:",omitempty"`
Price int
Currency string
}
CocoaBag
func (*CocoaBag) ToPrettyJson ¶
ToJson converts the CocoaBag to human readable json
type Farmer ¶
type Farmer struct {
ID string
Surname string
Firstname string
Address Address
Phone string
Email string
}
Farmer
func (*Farmer) ToPrettyJson ¶
ToJson converts the Farmer to human readable json
type HypercocoaConfig ¶
type HypercocoaConfig struct {
MspID string
CryptoPath string
CertPath string
KeyPath string
TlsCertPath string
PeerEndpoint string
GatewayPeer string
ChannelName string
ChaincodeName string
// Config options for gateway mode
BaseURL string
GatewayHost string
GatewayPort string
}
config options for the chain connection
var Hyperconfig *HypercocoaConfig