storage

package
v0.0.0-...-c094c7e Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.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 Storage

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

Storage is a key-value storage for the faucet.

func New

func New(dbType string, dataDir string, waitPeriod time.Duration, dbPrefix []byte) (*Storage, error)

New creates a new storage instance.

func (*Storage) AddFundedUserWithWaitTime

func (st *Storage) AddFundedUserWithWaitTime(userID []byte, authType string) error

AddFundedUserWithWaitTime adds the given userID to the funded list, with the current time as the wait period end time.

func (*Storage) CheckFundedUserWithWaitTime

func (st *Storage) CheckFundedUserWithWaitTime(userID []byte, authType string) (bool, time.Time)

checkIsFundedUserID checks if the given text is funded and returns true if it is, within the wait period time window. Otherwise, it returns false.

func (*Storage) Close

func (st *Storage) Close() error

Close closes the storage.

func (*Storage) Delete

func (st *Storage) Delete(key []byte) error

Delete removes an existing value based on the given key

func (*Storage) Get

func (st *Storage) Get(key []byte) ([]byte, error)

Get gets the value for the given key.

func (*Storage) Set

func (st *Storage) Set(key, value []byte) error

Set sets the given key to the given value.

Jump to

Keyboard shortcuts

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