-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdescriptor.go
28 lines (25 loc) · 919 Bytes
/
descriptor.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
package chile
import (
"fmt"
"github.com/whitewater-guide/gorge/core"
)
var Descriptor = &core.ScriptDescriptor{
Name: "chile",
Description: "Chile: The Ministry of Public Works, The Water Division (DGA)",
Mode: core.OneByOne,
DefaultOptions: func() interface{} {
return &optionsChile{}
},
Factory: func(name string, options interface{}) (core.Script, error) {
if _, ok := options.(*optionsChile); ok {
return &scriptChile{
name: name,
selectFormURL: "http://dgasatel.mop.cl/filtro_paramxestac_new2.asp",
webmapIDPageURL: "https://www.arcgis.com/sharing/rest/content/items/d508beb3a88f43d28c17a8ec9fac5ef0/data?f=json",
webmapURLFormat: "https://www.arcgis.com/sharing/rest/content/items/%s/data?f=json",
xlsURL: "http://dgasatel.mop.cl/cons_det_instan_xls.asp",
}, nil
}
return nil, fmt.Errorf("failed to cast %T", optionsChile{})
},
}