store

package
v0.0.0-...-b9c64df Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StoreTypes map[string]Store = map[string]Store{
		"filestore": &FileStore{},
	}
)

Functions

This section is empty.

Types

type FileStore

type FileStore struct {
	BaseDir       string
	CleanInterval time.Duration
	// contains filtered or unexported fields
}

func (*FileStore) Close

func (s *FileStore) Close() error

func (*FileStore) Delete

func (s *FileStore) Delete(key string) error

func (*FileStore) Exists

func (s *FileStore) Exists(key string) (bool, error)

func (*FileStore) GetBytes

func (s *FileStore) GetBytes(key string) ([]byte, bool, error)

func (*FileStore) GetNRGBA

func (s *FileStore) GetNRGBA(key string) (*image.NRGBA, bool, error)

func (*FileStore) Initialize

func (s *FileStore) Initialize(config map[string]interface{}) error

func (*FileStore) SetBytes

func (s *FileStore) SetBytes(key string, data []byte, ttl time.Duration) error

type Store

type Store interface {
	Initialize(config map[string]interface{}) error
	GetBytes(id string) ([]byte, bool, error)
	GetNRGBA(id string) (*image.NRGBA, bool, error)
	Exists(id string) (bool, error)
	SetBytes(id string, data []byte, ttl time.Duration) error
	Delete(id string) error
	Close() error
}

Jump to

Keyboard shortcuts

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