adapters

package
v0.0.0-...-5f2bb2b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDatabase

func SetupDatabase(connString string) (*sql.DB, error)

Types

type DB

type DB struct {
	Client *dynamodb.Client
	Table  string
}

func NewDB

func NewDB(t string) DB

func (DB) TaxRate

func (db DB) TaxRate(zip string) (ZipcodeTaxRate, error)

type ZipcodeTaxRate

type ZipcodeTaxRate struct {
	Zipcode string  `dynamodbav:"zipcode"`
	Rate    float32 `dynamodbav:"rate"`
}

func (ZipcodeTaxRate) GetKey

func (zipcodeTax ZipcodeTaxRate) GetKey() map[string]types.AttributeValue

GetKey returns the composite primary key of the movie in a format that can be sent to DynamoDB.

func (ZipcodeTaxRate) String

func (zipcodeTax ZipcodeTaxRate) String() string

String returns the title, year, rating, and plot of a movie, formatted for the example.

Jump to

Keyboard shortcuts

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