storage

package
v0.0.0-...-17ece98 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurator

type Configurator func(*Storage) error

Configurator defines a function which can use to configure the Storage.

func Database

func Database(cnf config.DatabaseConfig) Configurator

Database returns database configurator.

type Storage

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

Storage is an implementation of Data Access Object.

func Must

func Must(configs ...Configurator) *Storage

Must returns a new instance of the Storage or panics if it cannot configure it.

func New

func New(configs ...Configurator) (*Storage, error)

New returns a new instance of the Storage or an error if it cannot configure it.

func (*Storage) CreateSchema

func (storage *Storage) CreateSchema(ctx context.Context, tokenID domain.ID, data query.CreateSchema) (types.Schema, error)

CreateSchema TODO issue#173

func (*Storage) CreateTemplate

func (storage *Storage) CreateTemplate(ctx context.Context, tokenID domain.ID, data query.CreateTemplate) (types.Template, error)

CreateTemplate TODO issue#173

func (*Storage) Database

func (storage *Storage) Database() *sql.DB

Database returns the current database handle.

func (*Storage) DeleteSchema

func (storage *Storage) DeleteSchema(ctx context.Context, tokenID domain.ID, data query.DeleteSchema) (types.Schema, error)

DeleteSchema TODO issue#173

func (*Storage) DeleteTemplate

func (storage *Storage) DeleteTemplate(ctx context.Context, tokenID domain.ID, data query.DeleteTemplate) (types.Template, error)

DeleteTemplate TODO issue#173

func (*Storage) Dialect

func (storage *Storage) Dialect() string

Dialect returns a supported database dialect.

func (*Storage) LogInput

func (storage *Storage) LogInput(ctx context.Context, event domain.InputEvent) error

LogInput stores an input event.

func (*Storage) ReadInputByFilter

func (storage *Storage) ReadInputByFilter(ctx context.Context, tokenID domain.ID, filter query.InputFilter) ([]types.Input, error)

ReadInputByFilter TODO issue#173

func (*Storage) ReadInputByID

func (storage *Storage) ReadInputByID(ctx context.Context, tokenID domain.ID, id domain.ID) (types.Input, error)

ReadInputByID TODO issue#173

func (*Storage) ReadSchema

func (storage *Storage) ReadSchema(ctx context.Context, tokenID domain.ID, data query.ReadSchema) (types.Schema, error)

ReadSchema TODO issue#173

func (*Storage) ReadTemplate

func (storage *Storage) ReadTemplate(ctx context.Context, tokenID domain.ID, data query.ReadTemplate) (types.Template, error)

ReadTemplate TODO issue#173

func (*Storage) Schema

func (storage *Storage) Schema(ctx context.Context, id domain.ID) (domain.Schema, error)

Schema returns the form schema by provided ID.

func (*Storage) StoreInput

func (storage *Storage) StoreInput(ctx context.Context, schemaID domain.ID, verified domain.InputData) (*types.Input, error)

StoreInput stores an user input data.

func (*Storage) Template

func (storage *Storage) Template(ctx context.Context, id domain.ID) (domain.Template, error)

Template returns the form template by provided ID.

func (*Storage) UpdateSchema

func (storage *Storage) UpdateSchema(ctx context.Context, tokenID domain.ID, data query.UpdateSchema) (types.Schema, error)

UpdateSchema TODO issue#173

func (*Storage) UpdateTemplate

func (storage *Storage) UpdateTemplate(ctx context.Context, tokenID domain.ID, data query.UpdateTemplate) (types.Template, error)

UpdateTemplate TODO issue#173

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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