locations

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: ISC Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const LocationsResName = ResourceName(`locations`)

Variables

View Source
var LocationFields = append(EntityFields,
	`address1`,
	`address2`,
	`city`,
	`state`,
	`zip`,
	`lat`,
	`lng`)

Functions

This section is empty.

Types

type Address

type Address struct {
	Location
	EntityID EID    `json:"-" sql:",pk"`
	Label    string `json:"label"`
	// contains filtered or unexported fields
}

func NewAddress

func NewAddress(
	name string,
	desc string,
	ownerID EID,
	publiclyReadable bool,
	address1 string,
	address2 string,
	city string,
	state string,
	zip string,
	entityID EID,
	label string) *Address

func (*Address) Clone

func (add *Address) Clone() *Address

func (*Address) CreateQueries

func (a *Address) CreateQueries(db orm.DB) []*orm.Query

A single Address is not directly managed. Management is at the Addresses level.

func (*Address) DeleteQueries

func (a *Address) DeleteQueries(db orm.DB) []*orm.Query

func (*Address) GetEntityID

func (a *Address) GetEntityID() EID

func (*Address) GetLabel

func (a *Address) GetLabel() string

func (*Address) SetLabel

func (a *Address) SetLabel(l string)

func (*Address) UpdateQueries

func (a *Address) UpdateQueries(db orm.DB) []*orm.Query

only update label

type AddressInsertable

type AddressInsertable struct {
	*Address
	Idx int
	// contains filtered or unexported fields
}

type Addresses

type Addresses []*Address

func (*Addresses) Clone

func (adds *Addresses) Clone() *Addresses

func (*Addresses) CreateQueries

func (a *Addresses) CreateQueries(db orm.DB) []*orm.Query

func (*Addresses) DeleteQueries

func (a *Addresses) DeleteQueries(db orm.DB) []*orm.Query

func (*Addresses) PromoteChanges

func (adds *Addresses) PromoteChanges(changeDescs []string) []string

func (*Addresses) RetrieveByIDRaw

func (a *Addresses) RetrieveByIDRaw(id EID, db orm.DB) error

type Location

type Location struct {
	Entity
	Address1   string          `json:"address1"`
	Address2   string          `json:"address2"`
	City       string          `json:"city"`
	State      string          `json:"state"`
	Zip        string          `json:"zip"`
	Lat        sql.NullFloat64 `json:"lat" pg:",use_zero"`
	Lng        sql.NullFloat64 `json:"lng" pg:",use_zero"`
	ChangeDesc []string        `json:"changeDesc,omitempty" sql:"-"`
}

func NewLocation

func NewLocation(
	name string,
	desc string,
	ownerID EID,
	publiclyReadable bool,
	address1 string,
	address2 string,
	city string,
	state string,
	zip string) *Location

func (*Location) AddressString

func (loc *Location) AddressString() (string, error)

func (*Location) ArchiveQueries

func (l *Location) ArchiveQueries(db orm.DB) []*orm.Query

func (*Location) Clone

func (loc *Location) Clone() *Location

func (*Location) CreateQueries

func (l *Location) CreateQueries(db orm.DB) []*orm.Query

func (*Location) DeleteQueries

func (l *Location) DeleteQueries(db orm.DB) []*orm.Query

func (*Location) GetAddress1

func (l *Location) GetAddress1() string

func (*Location) GetAddress2

func (l *Location) GetAddress2() string

func (*Location) GetCity

func (l *Location) GetCity() string

func (*Location) GetLat

func (l *Location) GetLat() sql.NullFloat64

func (*Location) GetLng

func (l *Location) GetLng() sql.NullFloat64

func (*Location) GetState

func (l *Location) GetState() string

func (*Location) GetZip

func (l *Location) GetZip() string

func (*Location) IsAddressComplete

func (loc *Location) IsAddressComplete() bool

func (*Location) IsAddressEmpty

func (loc *Location) IsAddressEmpty() bool

func (*Location) IsComplete

func (loc *Location) IsComplete() bool

func (*Location) IsLatLngComplete

func (loc *Location) IsLatLngComplete() bool

func (*Location) IsLatLngEmpty

func (loc *Location) IsLatLngEmpty() bool

func (*Location) SetAddress1

func (l *Location) SetAddress1(a1 string)

func (*Location) SetAddress2

func (l *Location) SetAddress2(a2 string)

func (*Location) SetCity

func (l *Location) SetCity(c string)

func (*Location) SetState

func (l *Location) SetState(s string)

func (*Location) SetZip

func (l *Location) SetZip(z string)

func (*Location) UpdateQueries

func (l *Location) UpdateQueries(db orm.DB) []*orm.Query

Jump to

Keyboard shortcuts

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