Documentation
¶
Index ¶
- Constants
- type Country
- func (o *Country) Continent() string
- func (o *Country) CreatedAt() string
- func (o *Country) CreatedAtCarbon() *carbon.Carbon
- func (o *Country) Data() map[string]string
- func (o *Country) GetSoftDeletedAt() string
- func (o *Country) GetSoftDeletedAtCarbon() *carbon.Carbon
- func (o *Country) ID() string
- func (o *Country) IsoCode2() string
- func (o *Country) IsoCode3() string
- func (o *Country) MarkAsNotDirty(columns ...string)
- func (o *Country) Name() string
- func (o *Country) PhonePrefix() string
- func (o *Country) SetContinent(continent string) *Country
- func (o *Country) SetCreatedAt(createdAt string) *Country
- func (o *Country) SetID(id string) *Country
- func (o *Country) SetIsoCode2(isoCode2 string) *Country
- func (o *Country) SetIsoCode3(isoCode3 string) *Country
- func (o *Country) SetName(name string) *Country
- func (o *Country) SetPhonePrefix(phonePrefix string) *Country
- func (o *Country) SetSoftDeletedAt(softDeletedAt string) *Country
- func (o *Country) SetStatus(status string) *Country
- func (o *Country) SetUpdatedAt(updatedAt string) *Country
- func (o *Country) Status() string
- func (o *Country) UpdatedAt() string
- func (o *Country) UpdatedAtCarbon() *carbon.Carbon
- type CountryQueryOptions
- type NewStoreOptions
- type State
- func (o *State) CountryCode() string
- func (o *State) CreatedAt() string
- func (o *State) CreatedAtCarbon() *carbon.Carbon
- func (o *State) Data() map[string]string
- func (o *State) GetSoftDeletedAt() string
- func (o *State) GetSoftDeletedAtCarbon() *carbon.Carbon
- func (o *State) ID() string
- func (o *State) MarkAsNotDirty(columns ...string)
- func (o *State) Name() string
- func (o *State) SetCountryCode(countryCodeIso2 string) *State
- func (o *State) SetCreatedAt(createdAt string) *State
- func (o *State) SetID(id string) *State
- func (o *State) SetName(name string) *State
- func (o *State) SetSoftDeletedAt(softDeletedAt string) *State
- func (o *State) SetStateCode(stateCode string) *State
- func (o *State) SetStatus(status string) *State
- func (o *State) SetUpdatedAt(updatedAt string) *State
- func (o *State) StateCode() string
- func (o *State) Status() string
- func (o *State) UpdatedAt() string
- func (o *State) UpdatedAtCarbon() *carbon.Carbon
- type StateQueryOptions
- type StoreInterface
- type Timezone
- func (o *Timezone) CountryCode() string
- func (o *Timezone) CreatedAt() string
- func (o *Timezone) CreatedAtCarbon() *carbon.Carbon
- func (o *Timezone) Data() map[string]string
- func (o *Timezone) GetSoftDeletedAt() string
- func (o *Timezone) GetSoftDeletedAtCarbon() *carbon.Carbon
- func (o *Timezone) GlobalName() string
- func (o *Timezone) ID() string
- func (o *Timezone) MarkAsNotDirty(columns ...string)
- func (o *Timezone) Offset() string
- func (o *Timezone) SetCountryCode(countryCode string) *Timezone
- func (o *Timezone) SetCreatedAt(createdAt string) *Timezone
- func (o *Timezone) SetGlobalName(globalName string) *Timezone
- func (o *Timezone) SetID(id string) *Timezone
- func (o *Timezone) SetOffset(offset string) *Timezone
- func (o *Timezone) SetSoftDeletedAt(softDeletedAt string) *Timezone
- func (o *Timezone) SetStatus(status string) *Timezone
- func (o *Timezone) SetTimezone(timezone string) *Timezone
- func (o *Timezone) SetUpdatedAt(updatedAt string) *Timezone
- func (o *Timezone) SetZoneName(zoneName string) *Timezone
- func (o *Timezone) Status() string
- func (o *Timezone) Timezone() string
- func (o *Timezone) UpdatedAt() string
- func (o *Timezone) UpdatedAtCarbon() *carbon.Carbon
- func (o *Timezone) ZoneName() string
- type TimezoneQueryOptions
Constants ¶
View Source
const COLUMN_CONTINENT = "continent"
View Source
const COLUMN_COUNTRY_CODE = "country_code"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_GLOBAL_NAME = "global_name"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_ISO2_CODE = "iso2_code"
View Source
const COLUMN_ISO3_CODE = "iso3_code"
View Source
const COLUMN_NAME = "name"
View Source
const COLUMN_OFFSET = "offset"
View Source
const COLUMN_PHONE_PREFIX = "phone_prefix"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STATE_CODE = "state_code"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_TIMEZONE = "timezone"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const COLUMN_ZONE_NAME = "zone_name"
View Source
const COUNTRY_STATUS_ACTIVE = "active"
View Source
const COUNTRY_STATUS_INACTIVE = "inactive"
View Source
const MAX_DATETIME = "9999-12-31 23:59:59"
MAX_DATETIME is a far-future datetime used as the default soft-delete sentinel.
View Source
const STATE_STATUS_ACTIVE = "active"
View Source
const STATE_STATUS_INACTIVE = "inactive"
View Source
const TIMEZONE_STATUS_ACTIVE = "active"
View Source
const TIMEZONE_STATUS_INACTIVE = "inactive"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Country ¶
type Country struct {
orm.ShortID
StatusField string `db:"status"`
Iso2CodeField string `db:"iso2_code"`
Iso3CodeField string `db:"iso3_code"`
NameField string `db:"name"`
ContinentField string `db:"continent"`
PhonePrefixField string `db:"phone_prefix"`
CreatedAtField orm.CreatedAt
UpdatedAtField orm.UpdatedAt
soft_delete.SoftDeletesMaxDate
// contains filtered or unexported fields
}
func NewCountry ¶
func NewCountry() *Country
func (*Country) CreatedAtCarbon ¶ added in v1.5.0
func (*Country) GetSoftDeletedAt ¶ added in v1.5.0
func (*Country) GetSoftDeletedAtCarbon ¶ added in v1.5.0
func (*Country) MarkAsNotDirty ¶ added in v1.5.0
func (*Country) PhonePrefix ¶
func (*Country) SetContinent ¶
func (*Country) SetCreatedAt ¶
func (*Country) SetIsoCode2 ¶
func (*Country) SetIsoCode3 ¶
func (*Country) SetPhonePrefix ¶
func (*Country) SetSoftDeletedAt ¶ added in v1.5.0
func (*Country) SetUpdatedAt ¶
func (*Country) UpdatedAtCarbon ¶ added in v1.5.0
type CountryQueryOptions ¶
type NewStoreOptions ¶
type NewStoreOptions struct {
CountryTableName string
StateTableName string
TimezoneTableName string
DB *sql.DB
AutomigrateEnabled bool
AutoseedEnabled bool
}
NewStoreOptions define the options for creating a new geostore
type State ¶
type State struct {
orm.ShortID
StatusField string `db:"status"`
CountryCodeField string `db:"country_code"`
StateCodeField string `db:"state_code"`
NameField string `db:"name"`
CreatedAtField orm.CreatedAt
UpdatedAtField orm.UpdatedAt
soft_delete.SoftDeletesMaxDate
// contains filtered or unexported fields
}
func (*State) CountryCode ¶
func (*State) CreatedAtCarbon ¶ added in v1.5.0
func (*State) GetSoftDeletedAt ¶ added in v1.5.0
func (*State) GetSoftDeletedAtCarbon ¶ added in v1.5.0
func (*State) MarkAsNotDirty ¶ added in v1.5.0
func (*State) SetCountryCode ¶
func (*State) SetCreatedAt ¶
func (*State) SetSoftDeletedAt ¶ added in v1.5.0
func (*State) SetStateCode ¶
func (*State) SetUpdatedAt ¶
func (*State) UpdatedAtCarbon ¶ added in v1.5.0
type StateQueryOptions ¶
type StoreInterface ¶
type StoreInterface interface {
// GetCountryTableName returns the country table name
GetCountryTableName() string
// SetCountryTableName sets the country table name
SetCountryTableName(countryTableName string)
// GetStateTableName returns the state table name
GetStateTableName() string
// SetStateTableName sets the state table name
SetStateTableName(stateTableName string)
// GetTimezoneTableName returns the timezone table name
GetTimezoneTableName() string
// SetTimezoneTableName sets the timezone table name
SetTimezoneTableName(timezoneTableName string)
// MigrateUp creates all database tables
MigrateUp(ctx context.Context, tx ...*sql.Tx) error
// MigrateDown drops all database tables
MigrateDown(ctx context.Context, tx ...*sql.Tx) error
// Seed populates all tables with initial data
Seed(ctx context.Context, tx ...*sql.Tx) error
EnableDebug(debug bool)
CountryCreate(ctx context.Context, country *Country) error
CountryDelete(ctx context.Context, country *Country) error
CountryDeleteByID(ctx context.Context, countryID string) error
CountryFindByID(ctx context.Context, countryID string) (*Country, error)
CountryFindByIso2(ctx context.Context, iso2Code string) (*Country, error)
CountryList(ctx context.Context, options CountryQueryOptions) ([]Country, error)
CountrySoftDelete(ctx context.Context, country *Country) error
CountrySoftDeleteByID(ctx context.Context, countryID string) error
CountryUpdate(ctx context.Context, country *Country) error
StateCreate(ctx context.Context, state *State) error
StatesCreate(ctx context.Context, states []*State) error
StateList(ctx context.Context, options StateQueryOptions) ([]State, error)
TimezoneCreate(ctx context.Context, timezone *Timezone) error
TimezoneList(ctx context.Context, options TimezoneQueryOptions) ([]Timezone, error)
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (StoreInterface, error)
NewStore creates a new geostore
type Timezone ¶
type Timezone struct {
orm.ShortID
StatusField string `db:"status"`
TimezoneField string `db:"timezone"`
ZoneNameField string `db:"zone_name"`
GlobalNameField string `db:"global_name"`
CountryCodeField string `db:"country_code"`
OffsetField string `db:"offset"`
CreatedAtField orm.CreatedAt
UpdatedAtField orm.UpdatedAt
soft_delete.SoftDeletesMaxDate
// contains filtered or unexported fields
}
func NewTimezone ¶
func NewTimezone() *Timezone
func (*Timezone) CountryCode ¶
func (*Timezone) CreatedAtCarbon ¶
func (*Timezone) GetSoftDeletedAt ¶ added in v1.5.0
func (*Timezone) GetSoftDeletedAtCarbon ¶ added in v1.5.0
func (*Timezone) GlobalName ¶
func (*Timezone) MarkAsNotDirty ¶ added in v1.5.0
func (*Timezone) SetCountryCode ¶
func (*Timezone) SetCreatedAt ¶
func (*Timezone) SetGlobalName ¶
func (*Timezone) SetSoftDeletedAt ¶ added in v1.5.0
func (*Timezone) SetTimezone ¶
func (*Timezone) SetUpdatedAt ¶
func (*Timezone) SetZoneName ¶
func (*Timezone) UpdatedAtCarbon ¶
Click to show internal directories.
Click to hide internal directories.