countystore

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 {
	StateProv cspc.StateProvince
	County    cspc.County
}

CreateArgs are the arguments for CreateCounty

func NewCreateArgs

func NewCreateArgs(stateProv cspc.StateProvince, county cspc.County) *CreateArgs

NewCreateArgs is an initializer for the CreateArgs struct

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) FindByCountyCode

func (d *DB) FindByCountyCode(ctx context.Context, s cspc.StateProvince, cc string) (cspc.County, error)

FindByCountyCode returns a County struct given a StateProvince and a County Code

type Selector

type Selector interface {
	FindByCountyCode(ctx context.Context, s cspc.StateProvince, cc string) (cspc.County, error)
}

Selector reads records from the db

type Transactor

type Transactor interface {
	CreateCounty(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) CreateCounty

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

CreateCounty inserts a record in the lookup.county_lkup table

Jump to

Keyboard shortcuts

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