dataobjects

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomersSerialize

func CustomersSerialize(c Customers, filename string) error

func GetConnection

func GetConnection() (*sql.DB, error)

Types

type Customer

type Customer struct {
	Id        int
	Name      string
	City      string
	State     string
	Country   string
	Mail      string
	CreatedAt Dato
	UpdatedAt Dato
}

func CustomersDeserialize

func CustomersDeserialize(filename string) ([]Customer, error)

func (*Customer) AddCustomer

func (c *Customer) AddCustomer(db *sql.DB) (int64, error)

func (*Customer) FindAll

func (c *Customer) FindAll(db *sql.DB) (Customers, error)

func (*Customer) FindAllPrepared

func (c *Customer) FindAllPrepared(db *sql.DB) (Customers, error)

func (*Customer) FindById

func (c *Customer) FindById(db *sql.DB, id int64) (Customer, error)

func (*Customer) FindToJson

func (c *Customer) FindToJson(db *sql.DB, state string) (Customers, error)

func (*Customer) UpdateCustomer

func (c *Customer) UpdateCustomer(db *sql.DB, id int64) (int64, error)

type Customers

type Customers []Customer

type Dato

type Dato struct {
	sql.NullTime
}

func (Dato) MarshalJSON

func (d Dato) MarshalJSON() ([]byte, error)

func (*Dato) UnmarshalJSON

func (d *Dato) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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