database

package
v0.0.0-...-0fb5c5d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisDB

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

RedisDB is a database interaction manager for Redis

func NewRedisDB

func NewRedisDB(address string) (*RedisDB, error)

NewRedisDB creates a new database connection to Redis

func NewRedisDBWithOpts

func NewRedisDBWithOpts(address string) (*RedisDB, error)

NewRedisDBWithOpts creates a new database connection to Redis with url options

func (*RedisDB) CreateSecret

func (r *RedisDB) CreateSecret(hash string, s models.Secret) error

CreateSecret creates a new secret

func (*RedisDB) DeleteSecret

func (r *RedisDB) DeleteSecret(hash string) error

DeleteSecret removes existing secret

func (*RedisDB) GetSecret

func (r *RedisDB) GetSecret(hash string) (*models.Secret, error)

GetSecret returns a secret or errors

func (*RedisDB) UpdateSecret

func (r *RedisDB) UpdateSecret(hash string, s models.Secret) error

UpdateSecret decreases secret view counter

Jump to

Keyboard shortcuts

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