store

package
v0.0.0-...-f1d225e Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CreateProject

func CreateProject(ctx context.Context, project *models.Project) error

func CreateUser

func CreateUser(ctx context.Context, user *models.User) error

func GetByID

func GetByID(ctx context.Context, dest interface{}, query string, id string) error

func GetByParams

func GetByParams(ctx context.Context, dest interface{}, query string, params map[string]interface{}) error

func GetUserByAPIKey

func GetUserByAPIKey(ctx context.Context, apiKey string) (*models.User, error)

func GetUserByID

func GetUserByID(ctx context.Context, id string) (*models.User, error)

func IsErrNoRows

func IsErrNoRows(err error) bool

IsErrNoRows returns if given error is a "no rows" error.

func NewContext

func NewContext(ctx context.Context, s Store) context.Context

func Sync

func Sync(ctx context.Context, query string, obj interface{}) error

func UUID

func UUID() string

func UserEmailExists

func UserEmailExists(ctx context.Context, email string) (bool, error)

func UsernameExists

func UsernameExists(ctx context.Context, username string) (bool, error)

Types

type DataStore

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

func Load

func Load(cfg configuration.Data) (*DataStore, error)

func NewDataStore

func NewDataStore(cfg configuration.Data) (*DataStore, error)

func (*DataStore) Close

func (s *DataStore) Close() error

func (*DataStore) Connection

func (s *DataStore) Connection() sqalx.Node

Connection returns SQLStore current connection.

func (*DataStore) Flush

func (s *DataStore) Flush() error

func (*DataStore) Ping

func (s *DataStore) Ping() error

Ping pings the storage to know if it's alive.

type Setter

type Setter interface {
	Set(string, interface{})
}

Setter defines a context that enables setting values.

type Store

type Store interface {
	Close() error
	Ping() error
	Flush() error
	Connection() sqalx.Node
}

func FromContext

func FromContext(c context.Context) Store

FromContext returns the Config associated with this context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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