-
Notifications
You must be signed in to change notification settings - Fork 0
/
geocoder.go
43 lines (34 loc) · 878 Bytes
/
geocoder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package geocoder
import (
core "github.com/darlandieterich/go-geocoder/core"
model "github.com/darlandieterich/go-geocoder/model"
)
type Config model.GeocoderConfig
type Object model.Object
//New - declaration of default values
func New() Config {
return Config{
Language: "en",
Timeout: 3,
}
}
func (c *Config) Search(r model.GeocoderRequestSearch) *Object {
ca := (*core.Config)(c)
return (*Object)(ca.Search(r))
}
func (c *Config) Reverse(r model.GeocoderRequestReverse) *Object {
ca := (*core.Config)(c)
return (*Object)(ca.Reverse(r))
}
func (o *Object) Find(element string, value string) *Object {
co := (*core.Object)(o)
return (*Object)(co.Find(element, value))
}
func (o *Object) First() *Object {
co := (*core.Object)(o)
return (*Object)(co.First())
}
func (o *Object) Last() *Object {
co := (*core.Object)(o)
return (*Object)(co.Last())
}