Documentation ¶
Index ¶
- Variables
- func Inject(tripodInterface interface{}) error
- type BlockCycle
- type BlockVerifier
- type Committer
- type DefaultBlockCycle
- type DefaultBlockVerifier
- type DefaultCommitter
- type DefaultInit
- type DefaultPreTxnHandler
- type DefaultTxnChecker
- type GrpcLand
- type Init
- type Land
- func (l *Land) GetReading(tripodName, rdName string) (Reading, error)
- func (l *Land) GetTripod(name string) *Tripod
- func (l *Land) GetTripodInstance(name string) interface{}
- func (l *Land) GetWriting(tripodName, wrName string) (Writing, error)
- func (l *Land) RangeList(fn func(*Tripod) error) error
- func (l *Land) RangeMap(fn func(string, *Tripod) error) error
- func (l *Land) SetTripods(Tripods ...*Tripod)
- type PreTxnHandler
- type Tripod
- func (t *Tripod) AllReadingNames() []string
- func (t *Tripod) AllWritingNames() []string
- func (t *Tripod) CommitState() (Hash, error)
- func (t *Tripod) Delete(key []byte)
- func (t *Tripod) Discard()
- func (t *Tripod) DiscardAll()
- func (t *Tripod) Exist(key []byte) bool
- func (t *Tripod) ExistWriting(name string) bool
- func (t *Tripod) Get(key []byte) ([]byte, error)
- func (t *Tripod) GetByBlockHash(key []byte, blockHash Hash) ([]byte, error)
- func (t *Tripod) GetCurrentBlock() (*Block, error)
- func (t *Tripod) GetCurrentCompactBlock() (*CompactBlock, error)
- func (t *Tripod) GetFinalized(key []byte) ([]byte, error)
- func (t *Tripod) GetReading(name string) Reading
- func (t *Tripod) GetReadingFromLand(tripodName, funcName string) (Reading, error)
- func (t *Tripod) GetWriting(name string) Writing
- func (t *Tripod) GetWritingFromLand(tripodName, funcName string) (Writing, error)
- func (t *Tripod) HandleError(err error, ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt
- func (t *Tripod) HandleEvent(ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt
- func (t *Tripod) HandleReceipt(ctx *context.WriteContext, receipt *Receipt, block *Block, stxn *SignedTxn)
- func (t *Tripod) Name() string
- func (t *Tripod) NextTxn()
- func (t *Tripod) PostExecute(block *Block, receipts map[Hash]*Receipt) error
- func (t *Tripod) Set(key, value []byte)
- func (t *Tripod) SetBlockCycle(bc BlockCycle)
- func (t *Tripod) SetBlockVerifier(bv BlockVerifier)
- func (t *Tripod) SetChainEnv(env *ChainEnv)
- func (t *Tripod) SetCommitter(c Committer)
- func (t *Tripod) SetInit(init Init)
- func (t *Tripod) SetInstance(tripodInstance any)
- func (t *Tripod) SetLand(land *Land)
- func (t *Tripod) SetP2pHandler(code int, handler P2pHandler) *Tripod
- func (t *Tripod) SetPreTxnHandler(pth PreTxnHandler)
- func (t *Tripod) SetReadings(readings ...Reading)
- func (t *Tripod) SetTxnChecker(tc TxnChecker)
- func (t *Tripod) SetWritings(wrs ...Writing)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InjectTag = "tripod" OmitEmpty = "omitempty" )
Functions ¶
Types ¶
type BlockCycle ¶
type BlockCycle interface { StartBlock(block *Block) EndBlock(block *Block) FinalizeBlock(block *Block) }
type BlockVerifier ¶
type BlockVerifier interface {
VerifyBlock(block *Block) error
}
type DefaultBlockCycle ¶
type DefaultBlockCycle struct{}
func (*DefaultBlockCycle) EndBlock ¶
func (*DefaultBlockCycle) EndBlock(*Block)
func (*DefaultBlockCycle) FinalizeBlock ¶
func (*DefaultBlockCycle) FinalizeBlock(*Block)
func (*DefaultBlockCycle) StartBlock ¶
func (*DefaultBlockCycle) StartBlock(*Block)
type DefaultBlockVerifier ¶
type DefaultBlockVerifier struct{}
func (*DefaultBlockVerifier) VerifyBlock ¶
func (*DefaultBlockVerifier) VerifyBlock(*Block) error
type DefaultCommitter ¶
type DefaultCommitter struct{}
func (*DefaultCommitter) Commit ¶
func (*DefaultCommitter) Commit(*Block)
type DefaultInit ¶
type DefaultInit struct{}
func (*DefaultInit) InitChain ¶
func (*DefaultInit) InitChain(*Block)
type DefaultPreTxnHandler ¶
type DefaultPreTxnHandler struct{}
func (*DefaultPreTxnHandler) PreHandleTxn ¶
func (*DefaultPreTxnHandler) PreHandleTxn(*SignedTxn) error
type DefaultTxnChecker ¶
type DefaultTxnChecker struct{}
func (*DefaultTxnChecker) CheckTxn ¶
func (*DefaultTxnChecker) CheckTxn(*SignedTxn) error
type GrpcLand ¶
type GrpcLand struct {
// contains filtered or unexported fields
}
func NewGrpcLand ¶
type Land ¶
type Land struct { OrderedTripods []*Tripod // Key: the Name of Tripod TripodsMap map[string]*Tripod }
func (*Land) GetReading ¶
func (*Land) GetTripodInstance ¶
func (*Land) GetWriting ¶
func (*Land) SetTripods ¶
type PreTxnHandler ¶
type PreTxnHandler interface {
PreHandleTxn(*SignedTxn) error
}
type Tripod ¶
type Tripod struct { *ChainEnv *Land BlockVerifier BlockVerifier TxnChecker TxnChecker Init Init BlockCycle BlockCycle PreTxnHandler PreTxnHandler Committer Committer Instance interface{} // key: p2p-handler type code P2pHandlers map[int]P2pHandler // contains filtered or unexported fields }
func NewTripodWithName ¶
func ResolveTripod ¶
func ResolveTripod(v interface{}) *Tripod
func (*Tripod) AllReadingNames ¶
func (*Tripod) AllWritingNames ¶
func (*Tripod) CommitState ¶
func (*Tripod) DiscardAll ¶
func (t *Tripod) DiscardAll()
func (*Tripod) ExistWriting ¶
func (*Tripod) GetByBlockHash ¶
func (*Tripod) GetCurrentBlock ¶
func (*Tripod) GetCurrentCompactBlock ¶
func (*Tripod) GetReading ¶
func (*Tripod) GetReadingFromLand ¶
func (*Tripod) GetWriting ¶
func (*Tripod) GetWritingFromLand ¶
func (*Tripod) HandleError ¶
func (t *Tripod) HandleError(err error, ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt
func (*Tripod) HandleEvent ¶
func (t *Tripod) HandleEvent(ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt
func (*Tripod) HandleReceipt ¶
func (t *Tripod) HandleReceipt(ctx *context.WriteContext, receipt *Receipt, block *Block, stxn *SignedTxn)
func (*Tripod) PostExecute ¶
func (*Tripod) SetBlockCycle ¶
func (t *Tripod) SetBlockCycle(bc BlockCycle)
func (*Tripod) SetBlockVerifier ¶
func (t *Tripod) SetBlockVerifier(bv BlockVerifier)
func (*Tripod) SetChainEnv ¶
func (t *Tripod) SetChainEnv(env *ChainEnv)
func (*Tripod) SetCommitter ¶
func (*Tripod) SetInstance ¶
func (*Tripod) SetP2pHandler ¶
func (*Tripod) SetPreTxnHandler ¶
func (t *Tripod) SetPreTxnHandler(pth PreTxnHandler)
func (*Tripod) SetReadings ¶
func (t *Tripod) SetReadings(readings ...Reading)
func (*Tripod) SetTxnChecker ¶
func (t *Tripod) SetTxnChecker(tc TxnChecker)
func (*Tripod) SetWritings ¶
func (t *Tripod) SetWritings(wrs ...Writing)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.