cache

package
v0.0.0-...-76ca6e9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigCache

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

func (*BigCache) GetLiquidityRules

func (c *BigCache) GetLiquidityRules(nodePubkey string) (map[uint64][]nodeguard.LiquidityRule, error)

func (*BigCache) MarshalLiquidityRules

func (c *BigCache) MarshalLiquidityRules(rules []nodeguard.LiquidityRule) ([]byte, error)

Marshals a slice of nodeguard.LiquidityRules to bytes

func (*BigCache) SetLiquidityRules

func (c *BigCache) SetLiquidityRules(nodePubkey string, rules []nodeguard.LiquidityRule) error

Implement BigCache methods according to the Cache Interface

func (*BigCache) UnmarshalLiquidityRules

func (c *BigCache) UnmarshalLiquidityRules(rulesBytes []byte) ([]nodeguard.LiquidityRule, error)

Unmarshals a slice of nodeguard.LiquidityRules from bytes

type Cache

type Cache interface {

	//Set a slice of LiquidityRules from nodeguard grpc response
	SetLiquidityRules(string, []nodeguard.LiquidityRule) error
	//Get a slice of nodeguard.LiquidityRules from cache returns map where the key is the channel id
	GetLiquidityRules(string) (map[uint64][]nodeguard.LiquidityRule, error)
}

func NewCache

func NewCache() (Cache, error)

Create a new BigCache

Jump to

Keyboard shortcuts

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