Documentation
¶
Index ¶
- type Outbox
- func (o *Outbox) Checkpoint(pid string) (string, error)
- func (o *Outbox) Commit(pid, target string, assign goarSchema.BundleItem) error
- func (o *Outbox) Peek(pid, target string) (item *goarSchema.BundleItem, err error)
- func (o *Outbox) Push(pid, target string, message goarSchema.BundleItem) error
- func (o *Outbox) Restore(data string) error
- type Pay
- func (p *Pay) AllPending() map[string]*big.Int
- func (p *Pay) BeneficiaryBreakdown(beneficiary string) map[string]*big.Int
- func (p *Pay) BeneficiaryTotal(beneficiary string) *big.Int
- func (p *Pay) CanCover(beneficiary string, delta *big.Int) bool
- func (p *Pay) Checkpoint() (data string, err error)
- func (p *Pay) DailyUsage(accid string) int64
- func (p *Pay) Deposit(sponsor, beneficiary string, amount *big.Int) error
- func (p *Pay) IncrDailyUsage(accid string) error
- func (p *Pay) IsExecuted(txHash string) bool
- func (p *Pay) IsWhitelist(accid string) bool
- func (p *Pay) MarkExecuted(txHash string) error
- func (p *Pay) ResetDailyUsage() error
- func (p *Pay) ResidencyFee(pid string, fee *big.Int) error
- func (p *Pay) Restore(data string) error
- func (p *Pay) SetWhitelist(accid string, enabled bool) error
- func (p *Pay) SettleTxFee(beneficiary string, devShareRatio *big.Int) (nodeFee *big.Int, devFees map[string]*big.Int, err error)
- func (p *Pay) SpawnFee(beneficiary, pid string, fee *big.Int) error
- func (p *Pay) SponsorBreakdown(sponsor string) map[string]*big.Int
- func (p *Pay) SponsorTotal(sponsor string) *big.Int
- func (p *Pay) TotalPending(beneficiary string) *big.Int
- func (p *Pay) UseOnce(beneficiary, pid string, fee *big.Int) error
- func (p *Pay) Withdraw(sponsor, beneficiary string, amount *big.Int) error
- type Registry
- func (r *Registry) Checkpoint() (data string, err error)
- func (r *Registry) GetId() (string, error)
- func (r *Registry) GetNode(accid string) (*registrySchema.Node, error)
- func (r *Registry) GetNodes() (nodes map[string]registrySchema.Node, err error)
- func (r *Registry) GetNodesByProcess(pid string) (nodes []registrySchema.Node, err error)
- func (r *Registry) GetProcesses(accid string) (procs []string, err error)
- func (r *Registry) GetTokenPid() (string, error)
- func (r *Registry) Register(node registrySchema.Node) error
- func (r *Registry) RegisterProcess(accid, pid string) error
- func (r *Registry) Restore(data string) error
- func (r *Registry) Unregister(accid string) error
- func (r *Registry) UnregisterProcess(accid, pid string) error
- type Token
- func (h *Token) BalanceOf(accId string) (*big.Int, error)
- func (h *Token) Balances() (map[string]*big.Int, error)
- func (h *Token) CacheInitial() bool
- func (h *Token) CacheInitialed()
- func (h *Token) Checkpoint() (data string, err error)
- func (h *Token) GetInfo() tokenSchema.Info
- func (h *Token) GetTotalSupply() (*big.Int, error)
- func (h *Token) Restore(data string) error
- func (h *Token) StakeOf(accId string) (*big.Int, error)
- func (h *Token) Stakes() (map[string]*big.Int, error)
- func (h *Token) UpdateBalance(accId string, amount *big.Int) error
- func (h *Token) UpdateStake(accId string, amount *big.Int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Outbox ¶
type Outbox struct {
// contains filtered or unexported fields
}
func (*Outbox) Commit ¶
func (o *Outbox) Commit(pid, target string, assign goarSchema.BundleItem) error
func (*Outbox) Peek ¶
func (o *Outbox) Peek(pid, target string) (item *goarSchema.BundleItem, err error)
func (*Outbox) Push ¶
func (o *Outbox) Push(pid, target string, message goarSchema.BundleItem) error
type Pay ¶ added in v0.2.0
type Pay struct {
// contains filtered or unexported fields
}
Pay provides an in-memory implementation of the payment settlement logic.
NOTE:
- This version is fully in-memory (maps + big.Int), no persistence.
- It is intended only for unit tests, logic verification, and prototyping.
- It is NOT suitable for production use.
For production environments, replace this with a persistent and transactional implementation (e.g. backed by a database).
func (*Pay) BeneficiaryBreakdown ¶ added in v0.2.0
func (*Pay) BeneficiaryTotal ¶ added in v0.2.0
func (*Pay) Checkpoint ¶ added in v0.2.0
func (*Pay) DailyUsage ¶ added in v0.4.0
func (*Pay) IncrDailyUsage ¶ added in v0.4.0
func (*Pay) IsExecuted ¶ added in v0.2.0
func (*Pay) IsWhitelist ¶ added in v0.2.0
func (*Pay) MarkExecuted ¶ added in v0.2.0
func (*Pay) ResetDailyUsage ¶ added in v0.4.0
func (*Pay) ResidencyFee ¶ added in v0.2.0
func (*Pay) SetWhitelist ¶ added in v0.2.0
func (*Pay) SettleTxFee ¶ added in v0.2.0
func (*Pay) SponsorBreakdown ¶ added in v0.2.0
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(id, tokenPid string, mainNode registrySchema.Node) *Registry
func (*Registry) Checkpoint ¶
func (*Registry) GetNodes ¶
func (r *Registry) GetNodes() (nodes map[string]registrySchema.Node, err error)
func (*Registry) GetNodesByProcess ¶
func (r *Registry) GetNodesByProcess(pid string) (nodes []registrySchema.Node, err error)
func (*Registry) GetProcesses ¶
func (*Registry) GetTokenPid ¶
func (*Registry) RegisterProcess ¶
func (*Registry) Unregister ¶
func (*Registry) UnregisterProcess ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func (*Token) CacheInitial ¶ added in v0.4.4
func (*Token) CacheInitialed ¶ added in v0.4.4
func (h *Token) CacheInitialed()
func (*Token) Checkpoint ¶
func (*Token) GetInfo ¶
func (h *Token) GetInfo() tokenSchema.Info
Click to show internal directories.
Click to hide internal directories.