repository

package
v0.0.0-...-a64fb18 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountReader

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

AccountReader exposes account read database operations

func NewAccountReader

func NewAccountReader(conn *sql.DB) *AccountReader

NewAccountReader build a new AccountReader struct with its dependencies

func (AccountReader) FindOneByID

func (a AccountReader) FindOneByID(id *domain.ID) (*domain.Account, error)

FindOneByID finds and return one account based in the informed ID

type AccountWriter

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

AccountWriter exposes account write database operations

func NewAccountWriter

func NewAccountWriter(conn *sql.DB) *AccountWriter

NewAccountWriter build a new AccountWriter struct with its dependencies

func (AccountWriter) Store

func (a AccountWriter) Store(acc *domain.Account) (*domain.ID, error)

Store stores an account in the storage

type ErrDuplicateEntry

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

ErrDuplicateEntry represents a duplicate entry error

func NewErrDuplicatedEntry

func NewErrDuplicatedEntry(field string, value string) *ErrDuplicateEntry

NewErrDuplicatedEntry creates an ErrDuplicateEntry struct

func (ErrDuplicateEntry) Error

func (e ErrDuplicateEntry) Error() string

Error returns the formatted error message

func (ErrDuplicateEntry) Field

func (e ErrDuplicateEntry) Field() string

Field returns the field value

func (ErrDuplicateEntry) Value

func (e ErrDuplicateEntry) Value() string

Value returns the duplicate value

type ErrForeignKeyConstraint

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

ErrForeignKeyConstraint represents an foreign key error occurred in the storage

func NewErrForeignKeyConstraint

func NewErrForeignKeyConstraint(table string, constraint string, foreignKey string, references string) *ErrForeignKeyConstraint

NewErrForeignKeyConstraint builds a ErrForeignKeyConstraint struct

func (ErrForeignKeyConstraint) Error

func (e ErrForeignKeyConstraint) Error() string

Error returns the formatted error message

func (ErrForeignKeyConstraint) ForeignKey

func (e ErrForeignKeyConstraint) ForeignKey() string

ForeignKey returns the foreign key value

type ErrLoadInvalidData

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

ErrLoadInvalidData represents an error when occurred an error to load data

func NewErrLoadInvalidData

func NewErrLoadInvalidData(field string) *ErrLoadInvalidData

NewErrLoadInvalidData creates an ErrLoadInvalidData struct

func (ErrLoadInvalidData) Error

func (e ErrLoadInvalidData) Error() string

Error returns the formatted error message

type ErrRegisterNotFound

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

ErrRegisterNotFound represents an error when the register was not found

func NewErrRegisterNotFound

func NewErrRegisterNotFound(field, value string) *ErrRegisterNotFound

NewErrRegisterNotFound creates an ErrDuplicateEntry struct

func (ErrRegisterNotFound) Error

func (e ErrRegisterNotFound) Error() string

Error returns the formatted error message

func (ErrRegisterNotFound) Field

func (e ErrRegisterNotFound) Field() string

Field returns the field not found

func (ErrRegisterNotFound) Value

func (e ErrRegisterNotFound) Value() string

Value returns the duplicate value

type Transaction

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

Transaction exposes transaction database operations

func NewTransaction

func NewTransaction(conn *sql.DB) *Transaction

NewTransaction build a new Transaction struct with its dependencies

func (Transaction) Store

func (t Transaction) Store(transaction *domain.Transaction) (*domain.ID, error)

Store stores a transaction in the storage

Jump to

Keyboard shortcuts

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