supply

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package supply provides a cache of signets for pre-generating signets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignetSupply

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

SignetSupply is cache of signets for pre-generating signets.

func NewSignetSupply

func NewSignetSupply(cacheSize int) *SignetSupply

NewSignetSupply returns a new empty *SignetSupply. `cacheSize` specifies how many Signets to cache at maximum (min 1).

func (*SignetSupply) Fill

func (supply *SignetSupply) Fill(amount int) (full bool, lastErr error)

Fill fills all caches with new Signets in the specified amount (up to the cache size), and returns whether the caches are now full. This function is meant to be called periodically (when there is time) with small values for `amount` until the supply is full.

func (*SignetSupply) GetSignet

func (supply *SignetSupply) GetSignet(scheme string) (*jess.Signet, error)

GetSignet returns a new signet from the supply.

func (*SignetSupply) Status

func (supply *SignetSupply) Status() *Status

Status returns current status information.

type Status

type Status struct {
	TotalSize int
	FillLevel int
}

Status holds status information about a signet supply.

Jump to

Keyboard shortcuts

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