Documentation
¶
Index ¶
Constants ¶
View Source
const ( WithSnappy = true NoSnappy = false )
Variables ¶
View Source
var ( EncUnknown = encoding{} EncMsgPack = encoding{1} EncJSON = encoding{2} EncProtobuf = encoding{3} )
Functions ¶
func EncodingFromString ¶
func PrintMemUsage ¶
func PrintMemUsage()
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func MemoryStorage ¶
func (*Memory) CreateTimezones ¶
func (*Memory) LoadTimezones ¶
type Polygon ¶
type PolygonIndex ¶
type PolygonIndex struct {
Id uint64 `json:"-"`
Tzid string `json:"tzid"`
Max Coord `json:"max"`
Min Coord `json:"min"`
}
func (*PolygonIndex) FromPB ¶
func (dst *PolygonIndex) FromPB(src *pb.PolygonIndex)
func (*PolygonIndex) ToPB ¶
func (src *PolygonIndex) ToPB(dst *pb.PolygonIndex)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreateTimezones ¶
func (*Store) InsertPolygons ¶
func (*Store) LoadTimezones ¶
type Timezone ¶
func TimezonesFromGeoJSON ¶
type TimezoneGeoJSON ¶
type TimezoneGeoJSON struct {
Type string `json:"type"`
Features []struct {
Type string `json:"type"`
Properties struct {
Tzid string `json:"tzid"`
} `json:"properties"`
Geometry struct {
Item string `json:"type"`
Coordinates []interface{} `json:"coordinates"`
} `json:"geometry"`
} `json:"features"`
}
type TimezoneInterface ¶
type TimezoneInterface interface {
CreateTimezones(jsonFilename string) error
LoadTimezones() error
Query(q Coord) (string, error)
Close()
}
var Tz TimezoneInterface
func BoltdbStorage ¶
func BoltdbStorage(snappy bool, filename string, encoding encoding) TimezoneInterface
func LoadTimezones ¶
func LoadTimezones(config Config) (TimezoneInterface, error)
Click to show internal directories.
Click to hide internal directories.