store

package
v0.0.87 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ID    string
	Name  string
	Value string
}

func (Configuration) StringifiedJSON

func (rv Configuration) StringifiedJSON() (string, error)

type Configurations added in v0.0.80

type Configurations []Configuration

func (Configurations) Len added in v0.0.80

func (c Configurations) Len() int

func (Configurations) Less added in v0.0.80

func (c Configurations) Less(i, j int) bool

func (Configurations) StringifiedJSON added in v0.0.80

func (c Configurations) StringifiedJSON() (string, error)

func (Configurations) Swap added in v0.0.80

func (c Configurations) Swap(i, j int)

type DBWrapper

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

func NewDbWrapper

func NewDbWrapper(db *sql.DB) DBWrapper

func (DBWrapper) Close

func (w DBWrapper) Close()

func (DBWrapper) Exec

func (w DBWrapper) Exec(query string, args ...interface{}) (sql.Result, error)

func (DBWrapper) Query

func (w DBWrapper) Query(query string, args ...interface{}) (IRows, error)

func (DBWrapper) QueryRow

func (w DBWrapper) QueryRow(query string, args ...interface{}) IRow

func (DBWrapper) SetMaxIdleConns

func (w DBWrapper) SetMaxIdleConns(n int)

func (DBWrapper) SetMaxOpenConns

func (w DBWrapper) SetMaxOpenConns(n int)

type DbProvider

type DbProvider interface {
	Db() (IDb, error)
}

func NewConcreteDbProvider

func NewConcreteDbProvider(sql ISql, config config.DBConfig) DbProvider

type IDb

type IDb interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (IRows, error)
	QueryRow(query string, args ...interface{}) IRow
	SetMaxOpenConns(n int)
	SetMaxIdleConns(n int)
	Close()
}

type IRow

type IRow interface {
	Scan(dest ...interface{}) error
}

type IRows

type IRows interface {
	Next() bool
	Close() error
	Scan(dest ...interface{}) error
}

type ISql

type ISql interface {
	Open(driverName, dataSourceName string, migrations []migration.Migrator) (IDb, error)
}

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() MemoryStore

func (MemoryStore) Delete

func (store MemoryStore) Delete(name string) (int, error)

func (MemoryStore) GetByID

func (store MemoryStore) GetByID(id string) (Configuration, error)

func (MemoryStore) GetByName

func (store MemoryStore) GetByName(name string) (Configurations, error)

func (MemoryStore) Put

func (store MemoryStore) Put(name string, value string) (string, error)

type RowWrapper

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

func NewRowWrapper

func NewRowWrapper(row *sql.Row) RowWrapper

func (RowWrapper) Scan

func (w RowWrapper) Scan(dest ...interface{}) error

type RowsWrapper

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

func NewRowsWrapper

func NewRowsWrapper(rows *sql.Rows) RowsWrapper

func (RowsWrapper) Close added in v0.0.80

func (w RowsWrapper) Close() error

func (RowsWrapper) Next

func (w RowsWrapper) Next() bool

func (RowsWrapper) Scan added in v0.0.80

func (w RowsWrapper) Scan(dest ...interface{}) error

type SQLWrapper

type SQLWrapper struct {
}

func NewSQLWrapper

func NewSQLWrapper() SQLWrapper

func (SQLWrapper) Open

func (w SQLWrapper) Open(driverName, dataSourceName string, migrations []migration.Migrator) (IDb, error)

type Store

type Store interface {
	Put(key string, value string) (string, error)
	GetByName(name string) (Configurations, error)
	GetByID(id string) (Configuration, error)
	Delete(key string) (int, error)
}

func CreateStore

func CreateStore(config config.ServerConfig) (Store, error)

func NewMysqlStore

func NewMysqlStore(dbProvider DbProvider) Store

func NewPostgresStore

func NewPostgresStore(dbProvider DbProvider) Store

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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