netcache

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpired = fmt.Errorf("expired")

Functions

func Del

func Del(k string) error

Del - deletes a value from db

func Set

func Set(k string, newValue *CValue) error

Set - sets a value to a key in db

Types

type CValue

type CValue struct {
	Network    string      `json:"network,omitempty"`
	Value      string      `json:"value"`
	Host       models.Host `json:"host"`
	Pass       string      `json:"pass,omitempty"`
	User       string      `json:"user,omitempty"`
	ALL        bool        `json:"all,omitempty"`
	Expiration time.Time   `json:"expiration"`
}

CValue - the cache object for a network

func Get

func Get(k string) (*CValue, error)

Get - gets a value from db, if expired, return err

Jump to

Keyboard shortcuts

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