storage

package
v0.0.0-...-a8cf2a2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStorage

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

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) Create

func (m *MemoryStorage) Create(file *models.File) error

func (*MemoryStorage) Delete

func (m *MemoryStorage) Delete(id int64) error

func (*MemoryStorage) GetAll

func (m *MemoryStorage) GetAll() ([]models.File, error)

func (*MemoryStorage) GetById

func (m *MemoryStorage) GetById(id int64) (*models.File, error)

func (*MemoryStorage) Update

func (m *MemoryStorage) Update(file *models.File) error

type PostgresStorage

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

func NewPostgresStorage

func NewPostgresStorage(connString string) (*PostgresStorage, error)

func (*PostgresStorage) Create

func (p *PostgresStorage) Create(user *models.User) error

func (*PostgresStorage) Delete

func (p *PostgresStorage) Delete(id int64) error

func (*PostgresStorage) GetAll

func (p *PostgresStorage) GetAll() ([]models.User, error)

func (*PostgresStorage) GetById

func (p *PostgresStorage) GetById(id int64) (*models.User, error)

func (*PostgresStorage) Update

func (p *PostgresStorage) Update(user *models.User) error

type RedisStorage

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

func NewRedisStorage

func NewRedisStorage() (*RedisStorage, error)

func (*RedisStorage) Del

func (r *RedisStorage) Del(keys ...string) error

func (*RedisStorage) Get

func (r *RedisStorage) Get(key string) (string, error)

func (*RedisStorage) Set

func (r *RedisStorage) Set(key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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