cache

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 NewOutbox

func NewOutbox() *Outbox

func (*Outbox) Checkpoint

func (o *Outbox) Checkpoint(pid string) (string, error)

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

func (*Outbox) Restore

func (o *Outbox) Restore(data string) 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 NewPay added in v0.2.0

func NewPay() *Pay

func (*Pay) AllPending added in v0.2.0

func (p *Pay) AllPending() map[string]*big.Int

func (*Pay) BeneficiaryBreakdown added in v0.2.0

func (p *Pay) BeneficiaryBreakdown(beneficiary string) map[string]*big.Int

func (*Pay) BeneficiaryTotal added in v0.2.0

func (p *Pay) BeneficiaryTotal(beneficiary string) *big.Int

func (*Pay) CanCover added in v0.2.0

func (p *Pay) CanCover(beneficiary string, delta *big.Int) bool

func (*Pay) Checkpoint added in v0.2.0

func (p *Pay) Checkpoint() (data string, err error)

func (*Pay) DailyUsage added in v0.4.0

func (p *Pay) DailyUsage(accid string) int64

func (*Pay) Deposit added in v0.2.0

func (p *Pay) Deposit(sponsor, beneficiary string, amount *big.Int) error

func (*Pay) IncrDailyUsage added in v0.4.0

func (p *Pay) IncrDailyUsage(accid string) error

func (*Pay) IsExecuted added in v0.2.0

func (p *Pay) IsExecuted(txHash string) bool

func (*Pay) IsWhitelist added in v0.2.0

func (p *Pay) IsWhitelist(accid string) bool

func (*Pay) MarkExecuted added in v0.2.0

func (p *Pay) MarkExecuted(txHash string) error

func (*Pay) ResetDailyUsage added in v0.4.0

func (p *Pay) ResetDailyUsage() error

func (*Pay) ResidencyFee added in v0.2.0

func (p *Pay) ResidencyFee(pid string, fee *big.Int) error

func (*Pay) Restore added in v0.2.0

func (p *Pay) Restore(data string) error

func (*Pay) SetWhitelist added in v0.2.0

func (p *Pay) SetWhitelist(accid string, enabled bool) error

func (*Pay) SettleTxFee added in v0.2.0

func (p *Pay) SettleTxFee(beneficiary string, devShareRatio *big.Int) (nodeFee *big.Int, devFees map[string]*big.Int, err error)

func (*Pay) SpawnFee added in v0.2.0

func (p *Pay) SpawnFee(beneficiary, pid string, fee *big.Int) error

func (*Pay) SponsorBreakdown added in v0.2.0

func (p *Pay) SponsorBreakdown(sponsor string) map[string]*big.Int

func (*Pay) SponsorTotal added in v0.2.0

func (p *Pay) SponsorTotal(sponsor string) *big.Int

func (*Pay) TotalPending added in v0.2.0

func (p *Pay) TotalPending(beneficiary string) *big.Int

func (*Pay) UseOnce added in v0.2.0

func (p *Pay) UseOnce(beneficiary, pid string, fee *big.Int) error

func (*Pay) Withdraw added in v0.2.0

func (p *Pay) Withdraw(sponsor, beneficiary string, amount *big.Int) error

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 (r *Registry) Checkpoint() (data string, err error)

func (*Registry) GetId

func (r *Registry) GetId() (string, error)

func (*Registry) GetNode

func (r *Registry) GetNode(accid string) (*registrySchema.Node, error)

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 (r *Registry) GetProcesses(accid string) (procs []string, err error)

func (*Registry) GetTokenPid

func (r *Registry) GetTokenPid() (string, error)

func (*Registry) Register

func (r *Registry) Register(node registrySchema.Node) error

func (*Registry) RegisterProcess

func (r *Registry) RegisterProcess(accid, pid string) error

func (*Registry) Restore

func (r *Registry) Restore(data string) error

func (*Registry) Unregister

func (r *Registry) Unregister(accid string) error

func (*Registry) UnregisterProcess

func (r *Registry) UnregisterProcess(accid, pid string) error

type Token

type Token struct {
	// contains filtered or unexported fields
}

func NewToken

func NewToken(info tokenSchema.Info, bals, stakes map[string]*big.Int) *Token

func (*Token) BalanceOf

func (h *Token) BalanceOf(accId string) (*big.Int, error)

func (*Token) Balances

func (h *Token) Balances() (map[string]*big.Int, error)

func (*Token) CacheInitial added in v0.4.4

func (h *Token) CacheInitial() bool

func (*Token) CacheInitialed added in v0.4.4

func (h *Token) CacheInitialed()

func (*Token) Checkpoint

func (h *Token) Checkpoint() (data string, err error)

func (*Token) GetInfo

func (h *Token) GetInfo() tokenSchema.Info

func (*Token) GetTotalSupply

func (h *Token) GetTotalSupply() (*big.Int, error)

func (*Token) Restore

func (h *Token) Restore(data string) error

func (*Token) StakeOf

func (h *Token) StakeOf(accId string) (*big.Int, error)

func (*Token) Stakes

func (h *Token) Stakes() (map[string]*big.Int, error)

func (*Token) UpdateBalance

func (h *Token) UpdateBalance(accId string, amount *big.Int) error

func (*Token) UpdateStake

func (h *Token) UpdateStake(accId string, amount *big.Int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL