Documentation ¶
Index ¶
- Constants
- Variables
- func CreateConfigDir() string
- func CreateOrOpenBleve() (bleve.Index, error)
- func FormatOrOpenCommuneInBrowser(db *sql.DB, index bleve.Index, commune *types.Commune, ...)
- func FormatOrOpenDistrictInBrowser(db *sql.DB, index bleve.Index, district *types.District, ...)
- func FormatOrOpenFokontanyInBrowser(db *sql.DB, index bleve.Index, fokontany *types.Fokontany, ...)
- func FormatOrOpenRegionInBrowser(db *sql.DB, index bleve.Index, region *types.Region, ...)
- func FormatResultOrOpenInBrowser(db *sql.DB, index bleve.Index, searchResults *bleve.SearchResult, ...)
- func FormatSearchResultOrOpenInBrowser(db *sql.DB, index bleve.Index, searchResults *types.SearchResult, ...)
- func FormatSearchResults(searchResults *types.SearchResult)
- func Init(db *sql.DB) (bleve.Index, error)
- func InitializeBleve(db *sql.DB) (bleve.Index, error)
- func NewCommuneService(db *sql.DB, index bleve.Index) svc.CommuneSvc
- func NewDistrictService(db *sql.DB, index bleve.Index) svc.DistrictSvc
- func NewFokontanyService(db *sql.DB, index bleve.Index) svc.FokontanySvc
- func NewRegionService(db *sql.DB, index bleve.Index) svc.RegionSvc
- func NewSearchService(db *sql.DB, index bleve.Index) svc.SearchSvc
- func OpenDatabaseConnection() (*sql.DB, error)
- func OpenPostgresConnection() (*sql.DB, error)
- func OpenSQLiteConnection() (*sql.DB, error)
- func StartHttpServer(db *sql.DB, index bleve.Index)
- type CommuneService
- type DistrictService
- type Feature
- type FeatureCollection
- type FokontanyService
- type Geometry
- type Polygon
- type Properties
- type RegionService
- type SearchService
Constants ¶
View Source
const PORT = 8010
Variables ¶
View Source
var Assets embed.FS
View Source
var DATABASE_PATH string = filepath.Join(CreateConfigDir(), "mada.bleve")
Functions ¶
func CreateConfigDir ¶
func CreateConfigDir() string
func CreateOrOpenBleve ¶
func CreateOrOpenBleve() (bleve.Index, error)
func FormatOrOpenCommuneInBrowser ¶ added in v0.3.2
func FormatOrOpenDistrictInBrowser ¶ added in v0.3.2
func FormatOrOpenFokontanyInBrowser ¶ added in v0.3.2
func FormatOrOpenRegionInBrowser ¶ added in v0.3.2
func FormatResultOrOpenInBrowser ¶ added in v0.3.2
func FormatSearchResultOrOpenInBrowser ¶ added in v0.3.2
func FormatSearchResultOrOpenInBrowser(db *sql.DB, index bleve.Index, searchResults *types.SearchResult, opt types.SearchOptions)
func FormatSearchResults ¶ added in v0.3.2
func FormatSearchResults(searchResults *types.SearchResult)
func InitializeBleve ¶
func NewCommuneService ¶
func NewCommuneService(db *sql.DB, index bleve.Index) svc.CommuneSvc
func NewDistrictService ¶
func NewDistrictService(db *sql.DB, index bleve.Index) svc.DistrictSvc
func NewFokontanyService ¶
func NewFokontanyService(db *sql.DB, index bleve.Index) svc.FokontanySvc
func NewSearchService ¶ added in v0.3.2
func OpenDatabaseConnection ¶ added in v0.3.2
func OpenPostgresConnection ¶ added in v0.2.0
func OpenSQLiteConnection ¶
func StartHttpServer ¶ added in v0.3.2
Types ¶
type CommuneService ¶
type CommuneService struct {
// contains filtered or unexported fields
}
func (*CommuneService) Count ¶ added in v0.3.2
func (c *CommuneService) Count() (count int, err error)
func (*CommuneService) List ¶
func (c *CommuneService) List(skip, limit int) (*bleve.SearchResult, error)
func (*CommuneService) ShowCommune ¶
func (c *CommuneService) ShowCommune(id string) (*types.Commune, error)
type DistrictService ¶
type DistrictService struct {
// contains filtered or unexported fields
}
func (*DistrictService) Count ¶ added in v0.3.2
func (d *DistrictService) Count() (c int, err error)
func (*DistrictService) List ¶
func (d *DistrictService) List(skip, limit int) (*bleve.SearchResult, error)
func (*DistrictService) ShowDistrict ¶
func (d *DistrictService) ShowDistrict(id string) (*types.District, error)
type FeatureCollection ¶ added in v0.4.0
type FokontanyService ¶
type FokontanyService struct {
// contains filtered or unexported fields
}
func (*FokontanyService) Count ¶ added in v0.3.2
func (f *FokontanyService) Count() (c int, err error)
func (*FokontanyService) List ¶
func (f *FokontanyService) List(skip, limit int) (*bleve.SearchResult, error)
func (*FokontanyService) ShowFokontany ¶
func (f *FokontanyService) ShowFokontany(id string) (*types.Fokontany, error)
type Geometry ¶
type Geometry struct { Type string `json:"type"` Coordinates [][][]geom.Coord `json:"coordinates"` }
type Polygon ¶
type Polygon struct { Type string `json:"type"` Name string `json:"name"` Country string `json:"country"` Region string `json:"region"` District string `json:"district"` Commune string `json:"commune"` Fokontany string `json:"fokontany"` Geometry Geometry `json:"geometry"` Province string `json:"province"` }
type Properties ¶
type Properties struct { Adm0en string `mapstructure:"ADM0_EN"` Adm0type string `mapstructure:"ADM0_TYPE"` Adm1en string `mapstructure:"ADM1_EN"` Adm1type string `mapstructure:"ADM1_TYPE"` Adm2en string `mapstructure:"ADM2_EN"` Adm2type string `mapstructure:"ADM2_TYPE"` Adm3en string `mapstructure:"ADM3_EN"` Adm3type string `mapstructure:"ADM3_TYPE"` Adm4en string `mapstructure:"ADM4_EN"` Adm4type string `mapstructure:"ADM4_TYPE"` OldProvin string `mapstructure:"OLD_PROVIN"` }
type RegionService ¶
type RegionService struct {
// contains filtered or unexported fields
}
func (*RegionService) Count ¶ added in v0.3.2
func (r *RegionService) Count() (c int, err error)
func (*RegionService) List ¶
func (r *RegionService) List(skip, limit int) (*bleve.SearchResult, error)
func (*RegionService) ShowRegion ¶
func (r *RegionService) ShowRegion(id string) (*types.Region, error)
type SearchService ¶ added in v0.3.2
type SearchService struct {
// contains filtered or unexported fields
}
func (*SearchService) Search ¶ added in v0.3.2
func (s *SearchService) Search(term string, opt types.SearchOptions) (*types.SearchResult, error)
func (*SearchService) SearchPoint ¶ added in v0.3.2
func (s *SearchService) SearchPoint(term string, opt types.SearchOptions) (result *types.SearchResult, err error)
Click to show internal directories.
Click to hide internal directories.