repository

package
v0.0.0-...-8b4a9fc Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobNoSQL

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

func NewJobNoSQL

func NewJobNoSQL(db NoSQL) JobNoSQL

func (JobNoSQL) Create

func (j JobNoSQL) Create(ctx context.Context, job domain.Job) (domain.Job, error)

func (JobNoSQL) FindAll

func (j JobNoSQL) FindAll(ctx context.Context) ([]domain.Job, error)

type JobSQL

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

func NewJobSQL

func NewJobSQL(db SQL) JobSQL

func (JobSQL) Create

func (j JobSQL) Create(ctx context.Context, job domain.Job) (domain.Job, error)

func (JobSQL) FindAll

func (j JobSQL) FindAll(ctx context.Context) ([]domain.Job, error)

type NoSQL

type NoSQL interface {
	Store(context.Context, string, interface{}) error
	FindAll(context.Context, string, interface{}, interface{}) error
	StartSession() (Session, error)
}

type Row

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

type Rows

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

type SQL

type SQL interface {
	ExecuteContext(context.Context, string, ...interface{}) error
	QueryContext(context.Context, string, ...interface{}) (Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) Row
	BeginTx(ctx context.Context) (Tx, error)
}

type Session

type Session interface {
	WithTransaction(context.Context, func(context.Context) error) error
	EndSession(context.Context)
}

type Tx

type Tx interface {
	ExecuteContext(context.Context, string, ...interface{}) error
	QueryContext(context.Context, string, ...interface{}) (Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) Row
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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