statestore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateArgs

type CreateArgs struct {
	Country   cspc.Country
	StateProv cspc.StateProvince
}

CreateArgs are the arguments for

func NewCreateArgs

func NewCreateArgs(country cspc.Country, stateProv cspc.StateProvince, username string) *CreateArgs

NewCreateArgs is an initializer for CreateArgs

type DB

type DB struct {
	*sql.DB
}

DB struct holds a pointer to a sql database

func NewDB

func NewDB(db *sql.DB) (*DB, error)

NewDB is an initializer for DB

func (*DB) FindByStateProvCode

func (d *DB) FindByStateProvCode(ctx context.Context, c cspc.Country, spc string) (cspc.StateProvince, error)

FindByStateProvCode returns a StateProvince struct given an Alpha 2 Code

type Selector

type Selector interface {
	FindByStateProvCode(ctx context.Context, c cspc.Country, spc string) (cspc.StateProvince, error)
}

Selector reads records from the db

type Transactor

type Transactor interface {
	CreateStateProvince(ctx context.Context, args *CreateArgs) error
}

Transactor performs DML actions against the DB

type Tx

type Tx struct {
	*sql.Tx
}

Tx stores a sql.Tx which will be used for all DML operations

func NewTx

func NewTx(tx *sql.Tx) (*Tx, error)

NewTx initializes a pointer to a Tx struct that holds a *sql.Tx

func (*Tx) CreateStateProvince

func (t *Tx) CreateStateProvince(ctx context.Context, args *CreateArgs) error

CreateStateProvince inserts a record in the lookup.state_prov_cd_lkup table

Jump to

Keyboard shortcuts

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