db

package
v0.0.0-...-6dea0d5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis contains client which operates with storage

func NewRedis

func NewRedis(host, password, port string) (*Redis, error)

NewRedis returns pointer to Redis structure with filled data

func (*Redis) CreateHero

func (r *Redis) CreateHero(id, name string) error

CreateHero creates new hero by ID and Name

func (*Redis) DeleteHero

func (r *Redis) DeleteHero(id string) error

DeleteHero deletes hero by ID

func (*Redis) GetHero

func (r *Redis) GetHero(id string) (storage.Hero, error)

GetHero gets hero by ID

func (*Redis) GetHeroes

func (r *Redis) GetHeroes() ([]storage.Hero, error)

GetHeroes gets all heroes

func (*Redis) Status

func (r *Redis) Status() (string, error)

Status checks storage connection status

Jump to

Keyboard shortcuts

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