Documentation ¶
Index ¶
- Constants
- Variables
- func Console(c router.Context) (interface{}, error)
- func Document(c router.Context) (interface{}, error)
- func IsExistKeyInLedgerError(err error) bool
- func IsRecordNotFoundError(err error) bool
- func ObjectType(stub *InitStubInterface) string
- func Router(r *router.Group)
- type ChainCompositeKey
- type ChainList
- type CollectionInterface
- type ConsoleInterface
- type Flannel
- type InitStubInterface
- type RequestDocumentInterface
- type Schema
Constants ¶
View Source
const ( TypeTransaction = `transaction` TypeAsset = `asset` TypeParticipant = `participant` )
View Source
const FLANNEL_CONSOLE = `flannel_console`
View Source
const (
TAG = `flannel`
)
Variables ¶
View Source
var ( ErrCompileStruct = errors.New(`error to compile interface is not a struct type In Create Function`) ErrTagPrimaryKey = errors.New(`error to get a primary key in the struct. primary key is important to make a transaction`) ErrModelDefineSchema = errors.New(`error to mapping flannel 'Schema' to Model structure please check your model type`) )
View Source
var ( // ErrRecordNotFound returns a "record not found error". Occurs only when attempting to query the database with a struct; querying with a slice won't return this error ErrRecordNotFound = errors.New("record not found") ErrExistKeyInLedger = errors.New("ledger is already exist this record") )
Functions ¶
func IsExistKeyInLedgerError ¶
func IsRecordNotFoundError ¶
IsRecordNotFoundError returns true if error contains a RecordNotFound error
func ObjectType ¶
func ObjectType(stub *InitStubInterface) string
Types ¶
type ChainCompositeKey ¶
type ChainCompositeKey interface { Create(args ...string) ChainCompositeKey Error() error Find(filter []string, val *ChainList) ChainCompositeKey }
type CollectionInterface ¶
type ConsoleInterface ¶
type ConsoleInterface struct {
Collections []CollectionInterface `json:"collections"`
}
type Flannel ¶
type Flannel interface { Error() error Chain(string, string) Flannel Model(interface{}) Flannel // InvokeLedger : force to create state in ledger InvokeLedger(key string, arg interface{}) Flannel // Create : new create a ledger transaction Create(interface{}) Flannel // Exist : checking a state is existing Exist(id string) (bool, Flannel) // FindById : query a ledger by using key state FindById(id string, arg interface{}) Flannel FindByIdAndUpdate(id string, modify interface{}) Flannel // UpdateOne : update ledger state using struct in the same query UpdateOne(arg interface{}) Flannel // InitChainCompositeKey : InitChainCompositeKey(index ...string) ChainCompositeKey }
func InitFlannel ¶
func InitFlannel(c router.Context, stub *InitStubInterface) Flannel
type InitStubInterface ¶
type RequestDocumentInterface ¶
type RequestDocumentInterface struct {
Collection string `json:"collection"`
}
Click to show internal directories.
Click to hide internal directories.