database

package
v0.0.0-...-033632b Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(provider string, user string, password string, dbHost string,
	dbPort int, dbname string) (UserData, TokenData, error)

Types

type TokenData

type TokenData interface {
	Init() error
	CreateToken(string) (string, error)
	ValidateToken(string, string) (int, error)
}

type TokenDataS

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

func (*TokenDataS) CreateToken

func (tokenData *TokenDataS) CreateToken(userId string) (string, error)

func (*TokenDataS) Init

func (tokenData *TokenDataS) Init() error

func (*TokenDataS) ValidateToken

func (tokenData *TokenDataS) ValidateToken(token string, username string) (int, error)

type UserData

type UserData interface {
	Init() error
	SaveUser(string, []byte) error
	DeleteUser(string) error
	GetUser(string) ([]byte, error)
}

type UserDataS

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

func (*UserDataS) DeleteUser

func (userData *UserDataS) DeleteUser(userId string) error

func (*UserDataS) GetUser

func (userData *UserDataS) GetUser(userId string) ([]byte, error)

func (*UserDataS) Init

func (userData *UserDataS) Init() error

func (*UserDataS) SaveUser

func (userData *UserDataS) SaveUser(userId string, passwordHash []byte) error

Jump to

Keyboard shortcuts

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