datastorage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

dataStorage implements the storage ( wow :) )

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCacheGCInterval = 60                                 //seconds
	DefaultCacheTTL        = time.Second * time.Duration(86400) //seconds
	ErrNFound              = errors.New("template not found")
)

Functions

This section is empty.

Types

type MemoryDataStorage

type MemoryDataStorage struct {
	DefaultCacheGCInterval uint //seconds
	DefaultCacheTTL        time.Duration
	// contains filtered or unexported fields
}

func NewMemoryDataStorage

func NewMemoryDataStorage() *MemoryDataStorage

func (*MemoryDataStorage) Get

func (t *MemoryDataStorage) Get(uid string) (payload interface{}, createdAt time.Time, ttl time.Duration, err error)

func (*MemoryDataStorage) Put

func (t *MemoryDataStorage) Put(uid string, payload interface{}, ttl *time.Duration) error

Jump to

Keyboard shortcuts

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