Documentation
¶
Index ¶
- func GenKeyID(key string) string
- func GetWorldState(ctx contractapi.TransactionContextInterface, key string, value interface{}) error
- func SetWorldState(сtx contractapi.TransactionContextInterface, key string, value interface{}) error
- type Book
- type Contract
- func (c *Contract) CreateBook(ctx contractapi.TransactionContextInterface, title, author, pubkisher string) error
- func (c *Contract) DeleteBook(ctx contractapi.TransactionContextInterface, id string) error
- func (c *Contract) GetBookById(ctx contractapi.TransactionContextInterface, id string) (*Book, error)
- func (c *Contract) GetBooks(ctx contractapi.TransactionContextInterface) ([]*Book, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWorldState ¶
func GetWorldState(ctx contractapi.TransactionContextInterface, key string, value interface{}) error
GetWorldState takes a key and gets the world state and returns values
func SetWorldState ¶
func SetWorldState(сtx contractapi.TransactionContextInterface, key string, value interface{}) error
SetWorldState takes a key and value and sets on the world state
Types ¶
type Contract ¶
type Contract struct {
contractapi.Contract
}
func (*Contract) CreateBook ¶
func (c *Contract) CreateBook(ctx contractapi.TransactionContextInterface, title, author, pubkisher string) error
CreateBook creating new book and set in world state
func (*Contract) DeleteBook ¶
func (c *Contract) DeleteBook(ctx contractapi.TransactionContextInterface, id string) error
DeleteBook delete the book from world state
func (*Contract) GetBookById ¶
func (c *Contract) GetBookById(ctx contractapi.TransactionContextInterface, id string) (*Book, error)
GetBookById returns book by id from world state
func (*Contract) GetBooks ¶
func (c *Contract) GetBooks(ctx contractapi.TransactionContextInterface) ([]*Book, error)
GetBooks returns books by all id from world state
Click to show internal directories.
Click to hide internal directories.