persister

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBigIntFromString

func GetBigIntFromString(data interface{}) *big.Int

GetBigIntFromString will try to convert an interface type in a string and the corresponding *big.Int

func GetString

func GetString(data interface{}) string

GetString will try to convert an interface type in a string in case of failure wil return 0

func GetUint64

func GetUint64(data interface{}) uint64

GetUint64 will try to convert an interface type in a uint64 in case of failure wil return 0

Types

type PersistentStatusHandler

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

PersistentStatusHandler is a status handler that will save metrics in storage

func NewPersistentStatusHandler

func NewPersistentStatusHandler(
	marshalizer marshal.Marshalizer,
	uint64ByteSliceConverter typeConverters.Uint64ByteSliceConverter,
) (*PersistentStatusHandler, error)

NewPersistentStatusHandler will return an instance of the persistent status handler

func (*PersistentStatusHandler) AddUint64

func (psh *PersistentStatusHandler) AddUint64(key string, value uint64)

AddUint64 - will increase the value of a key with a value

func (*PersistentStatusHandler) Close

func (psh *PersistentStatusHandler) Close()

Close method - won't do anything

func (*PersistentStatusHandler) Decrement

func (psh *PersistentStatusHandler) Decrement(key string)

Decrement - will decrement the value of a key

func (*PersistentStatusHandler) Increment

func (psh *PersistentStatusHandler) Increment(key string)

Increment - will increment the value of a key

func (*PersistentStatusHandler) IsInterfaceNil

func (psh *PersistentStatusHandler) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PersistentStatusHandler) SetInt64Value

func (psh *PersistentStatusHandler) SetInt64Value(key string, value int64)

SetInt64Value method - will update the value for a key

func (*PersistentStatusHandler) SetStorage

func (psh *PersistentStatusHandler) SetStorage(store storage.Storer) error

SetStorage will set storage for persistent status handler

func (*PersistentStatusHandler) SetStringValue

func (psh *PersistentStatusHandler) SetStringValue(key string, value string)

SetStringValue method - will update the value of a key

func (*PersistentStatusHandler) SetUInt64Value

func (psh *PersistentStatusHandler) SetUInt64Value(key string, value uint64)

SetUInt64Value method - will update the value for a key

Jump to

Keyboard shortcuts

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