persister

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 10 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 an 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