-
Notifications
You must be signed in to change notification settings - Fork 3
/
descriptor.go
28 lines (25 loc) · 976 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 quebec
import (
"fmt"
"github.com/whitewater-guide/gorge/core"
)
var Descriptor = &core.ScriptDescriptor{
Name: "quebec",
Description: "Québec: Ministère de l'Environnement et de la Lutte contre les changements climatiques",
Mode: core.OneByOne,
DefaultOptions: func() interface{} {
return &optionsQuebec{}
},
Factory: func(name string, options interface{}) (core.Script, error) {
if _, ok := options.(*optionsQuebec); ok {
return &scriptQuebec{
name: name,
codesURL: "https://www.cehq.gouv.qc.ca/suivihydro/default.asp#region",
referenceListURL: "https://wateroffice.ec.gc.ca/station_metadata/reference_index_download_e.html",
stationURLFormat: "http://www.cehq.gouv.qc.ca/suivihydro/graphique.asp?NoStation=%s",
readingsURLFormat: "http://www.cehq.gouv.qc.ca/suivihydro/fichier_donnees.asp?NoStation=%s",
}, nil
}
return nil, fmt.Errorf("failed to cast %T", optionsQuebec{})
},
}