backend

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Pop returns false if key doesn't exists
	Pop(key string) (Data, bool, error)
	Set(key string, value Data) error
	Cleanup() error
	Close() error
}

func NewBackend

func NewBackend(backendUrl string, ttl, timeout time.Duration) (Backend, error)

type Data

type Data struct {
	RaisedTimeSeconds int64  `json:"rts" db:"rts"`
	RaisedTimeNanos   int64  `json:"rtn" db:"rtn"`
	ID                string `json:"id" db:"id"`
}

func (Data) Time

func (d Data) Time() time.Time

func (Data) ToBytes

func (d Data) ToBytes() ([]byte, error)

Jump to

Keyboard shortcuts

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