1
0
Fork 0
mirror of https://github.com/Luzifer/go-holidays.git synced 2024-12-24 12:51:17 +00:00

Initial version with german holidays

This commit is contained in:
Knut Ahlers 2016-09-23 15:20:27 +02:00
commit 01edd918c0
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
24 changed files with 1137 additions and 0 deletions

1
cmd/holiday-api/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
holiday-api

View file

@ -0,0 +1,16 @@
FROM golang:alpine
MAINTAINER Knut Ahlers <knut@ahlers.me>
ADD . /go/src/github.com/Luzifer/go-holidays/cmd/holiday-api
WORKDIR /go/src/github.com/Luzifer/go-holidays/cmd/holiday-api
RUN set -ex \
&& apk add --update git ca-certificates \
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \
&& apk del --purge git
EXPOSE 3000
ENTRYPOINT ["/go/bin/holiday-api"]
CMD ["--"]

68
cmd/holiday-api/main.go Normal file
View file

@ -0,0 +1,68 @@
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strconv"
"time"
holidays "github.com/Luzifer/go-holidays"
"github.com/Luzifer/rconfig"
"github.com/gorilla/mux"
)
var (
cfg = struct {
Listen string `flag:"listen" default:":3000" description:"IP/Port to listen on"`
VersionAndExit bool `flag:"version" default:"false" description:"Prints current version and exits"`
}{}
version = "dev"
)
func init() {
if err := rconfig.Parse(&cfg); err != nil {
log.Fatalf("Unable to parse commandline options: %s", err)
}
if cfg.VersionAndExit {
fmt.Printf("holiday-api %s\n", version)
os.Exit(0)
}
}
func main() {
r := mux.NewRouter()
r.HandleFunc("/{country-code:[a-z-]+}/{year:[0-9]{4}}", handleHolidays)
r.HandleFunc("/{country-code:[a-z-]+}", handleHolidays)
http.ListenAndServe(cfg.Listen, r)
}
func handleHolidays(res http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
var (
countryCode = vars["country-code"]
year = time.Now().Year()
)
if y, ok := vars["year"]; ok {
var err error
if year, err = strconv.Atoi(y); err != nil {
http.Error(res, "You need to specify the year as a 4 character number", http.StatusBadRequest)
return
}
}
holidays, err := holidays.GetHolidays(countryCode, year)
if err != nil {
http.Error(res, "An error ocurred: "+err.Error(), http.StatusInternalServerError)
return
}
res.Header().Set("Content-Type", "application/json")
json.NewEncoder(res).Encode(holidays)
}

42
easter.go Normal file
View file

@ -0,0 +1,42 @@
package holidays
import "time"
func GregorianEasterSunday(year int) time.Time {
X := year
// Comments from german Wikipedia: https://de.wikipedia.org/wiki/Osterzyklus
// 1. die Säkularzahl: K = X div 100
K := X / 100
// 2. die säkulare Mondschaltung: M = 15 + (3K + 3) div 4 (8K + 13) div 25
M := 15 + (3*K+3)/4 - (8*K+13)/25
// 3. die säkulare Sonnenschaltung: S = 2 (3K + 3) div 4
S := 2 - (3*K+3)/4
// 4. den Mondparameter: A = X mod 19
A := X % 19
// 5. den Keim für den ersten Frühlingsvollmond: D = (19A + M) mod 30
D := (19*A + M) % 30
// 6. die kalendarische Korrekturgröße: R = D div 29 + (D div 28 D div 29) (A div 11)
R := D/29 + (D/28-D/29)*(A/11)
// 7. die Ostergrenze: OG = 21 + D R
OG := 21 + D - R
// 8. den ersten Sonntag im März: SZ = 7 (X + X div 4 + S) mod 7
SZ := 7 - (X+X/4+S)%7
// 9. die Entfernung des Ostersonntags von der
// Ostergrenze (Osterentfernung in Tagen): OE = 7 (OG SZ) mod 7
OE := 7 - (OG-SZ)%7
// 10. das Datum des Ostersonntags als Märzdatum
// (32. März = 1. April usw.): OS = OG + OE
OS := OG + OE
var month int = 3 // March
var day int = OS
if day > 31 {
day = day % 31
month++
}
return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.Local)
}

50
easter_test.go Normal file
View file

@ -0,0 +1,50 @@
package holidays
import (
"testing"
"time"
)
func TestGregorianEasterSunday(t *testing.T) {
cases := [][3]int{
// Testcases from http://tlarsen2.tripod.com/thomaslarsen/easterdates.html
{23, 4, 2000}, {20, 4, 2025}, {10, 4, 2050}, {7, 4, 2075},
{15, 4, 2001}, {5, 4, 2026}, {2, 4, 2051}, {19, 4, 2076},
{31, 3, 2002}, {28, 3, 2027}, {21, 4, 2052}, {11, 4, 2077},
{20, 4, 2003}, {16, 4, 2028}, {6, 4, 2053}, {3, 4, 2078},
{11, 4, 2004}, {1, 4, 2029}, {29, 3, 2054}, {23, 4, 2079},
{27, 3, 2005}, {21, 4, 2030}, {18, 4, 2055}, {7, 4, 2080},
{16, 4, 2006}, {13, 4, 2031}, {2, 4, 2056}, {30, 3, 2081},
{8, 4, 2007}, {28, 3, 2032}, {22, 4, 2057}, {19, 4, 2082},
{23, 3, 2008}, {17, 4, 2033}, {14, 4, 2058}, {4, 4, 2083},
{12, 4, 2009}, {9, 4, 2034}, {30, 3, 2059}, {26, 3, 2084},
{4, 4, 2010}, {25, 3, 2035}, {18, 4, 2060}, {15, 4, 2085},
{24, 4, 2011}, {13, 4, 2036}, {10, 4, 2061}, {31, 3, 2086},
{8, 4, 2012}, {5, 4, 2037}, {26, 3, 2062}, {20, 4, 2087},
{31, 3, 2013}, {25, 4, 2038}, {15, 4, 2063}, {11, 4, 2088},
{20, 4, 2014}, {10, 4, 2039}, {6, 4, 2064}, {3, 4, 2089},
{5, 4, 2015}, {1, 4, 2040}, {29, 3, 2065}, {16, 4, 2090},
{27, 3, 2016}, {21, 4, 2041}, {11, 4, 2066}, {8, 4, 2091},
{16, 4, 2017}, {6, 4, 2042}, {3, 4, 2067}, {30, 3, 2092},
{1, 4, 2018}, {29, 3, 2043}, {22, 4, 2068}, {12, 4, 2093},
{21, 4, 2019}, {17, 4, 2044}, {14, 4, 2069}, {4, 4, 2094},
{12, 4, 2020}, {9, 4, 2045}, {30, 3, 2070}, {24, 4, 2095},
{4, 4, 2021}, {25, 3, 2046}, {19, 4, 2071}, {15, 4, 2096},
{17, 4, 2022}, {14, 4, 2047}, {10, 4, 2072}, {31, 3, 2097},
{9, 4, 2023}, {5, 4, 2048}, {26, 3, 2073}, {20, 4, 2098},
{31, 3, 2024}, {18, 4, 2049}, {15, 4, 2074}, {12, 4, 2099},
// Dates out of 2000 - 2099
{11, 4, 1700}, {8, 4, 1787}, {30, 3, 2206}, {26, 3, 2282},
// Dates way off anything known
{11, 4, 1902010}, {25, 4, 302010},
}
for _, dtc := range cases {
check := time.Date(dtc[2], time.Month(dtc[1]), dtc[0], 0, 0, 0, 0, time.Local)
if d := GregorianEasterSunday(dtc[2]); d != check {
t.Errorf("Easter sunday does not match for year %d: %#v != %#v", dtc[2], d, check)
}
}
}

103
holiday.go Normal file
View file

@ -0,0 +1,103 @@
package holidays
//go:generate go-bindata -pkg $GOPACKAGE -o holidays_data.go holidays/...
import (
"errors"
"fmt"
"path"
"sort"
"strings"
"time"
yaml "gopkg.in/yaml.v2"
)
var HolidayDataNotFoundError = errors.New("Holiday data not found for requested country-code")
// Holiday contains information about an holiday
type Holiday struct {
// Name contains the english representation of the holidays name
Name string
// LocalizedName contains a map of localizations of the name, key is a ISO 3166-2 country code without subdivision
LocalizedName map[string]string
// Date contains the date with time.Local zone
Date time.Time
}
type holidays []Holiday
func (h holidays) Len() int { return len(h) }
func (h holidays) Less(i, j int) bool { return h[i].Date.Before(h[j].Date) }
func (h holidays) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
// GetHolidays returns the holidays for the given ISO 3166-2 countryCode and year
func GetHolidays(countryCode string, year int) ([]Holiday, error) {
requiredFiles := []string{countryCode}
result := []Holiday{}
for len(requiredFiles) > 0 {
hdf, err := loadDataFile(requiredFiles[0])
if err != nil {
return result, err
}
requiredFiles = append(requiredFiles, hdf.Includes...)
easter := GregorianEasterSunday(year)
for _, h := range hdf.Holidays.Fixed {
result = append(result, Holiday{
Name: h.Name,
LocalizedName: h.LocalizedName,
Date: time.Date(year, time.Month(h.Month), h.Day, 0, 0, 0, 0, time.Local),
})
}
for _, h := range hdf.Holidays.EasterBased {
result = append(result, Holiday{
Name: h.Name,
LocalizedName: h.LocalizedName,
Date: easter.Add(time.Duration(h.Difference) * 24 * time.Hour),
})
}
requiredFiles = requiredFiles[1:]
}
sort.Sort(holidays(result))
return result, nil
}
type holidaysDataFileEntry struct {
Name string `yaml:"name"`
LocalizedName map[string]string `yaml:"localized"`
Month int `yaml:"month"`
Day int `yaml:"day"`
Difference int `yaml:"difference"`
}
type holidaysDataFile struct {
Includes []string `yaml:"includes"`
Holidays struct {
Fixed []holidaysDataFileEntry `yaml:"fixed"`
EasterBased []holidaysDataFileEntry `yaml:"easter_based"`
} `yaml:"holidays"`
}
func loadDataFile(countryCode string) (holidaysDataFile, error) {
r := holidaysDataFile{}
parts := strings.Split(countryCode, "-")
if len(parts) == 1 {
parts = append(parts, "_")
}
data, err := Asset(fmt.Sprintf(path.Join("holidays", parts[0], parts[1]) + ".yaml"))
if err != nil {
return r, HolidayDataNotFoundError
}
return r, yaml.Unmarshal(data, &r)
}

54
holidays/de/_.yaml Normal file
View file

@ -0,0 +1,54 @@
---
includes: []
holidays:
fixed:
- name: "New Year's Day"
localized:
de: "Neujahrstag"
month: 1
day: 1
- name: "Labor Day"
localized:
de: "Tag der Arbeit"
month: 5
day: 1
- name: "German Unity Day"
localized:
de: "Tag der Deutschen Einheit"
month: 10
day: 3
- name: "Christmas Day"
localized:
de: "Weihnachtstag"
month: 12
day: 25
- name: "Boxing Day"
localized:
de: "Zweiter Weihnachtsfeiertag"
month: 12
day: 26
easter_based:
- name: "Good Friday"
localized:
de: "Karfreitag"
difference: -2
- name: "Easter Sunday"
localized:
de: "Ostersonntag"
difference: 0
- name: "Easter Monday"
localized:
de: "Ostermontag"
difference: +1
- name: "Ascension Day"
localized:
de: "Christi Himmelfahrt"
difference: +39
- name: "Whit Monday"
localized:
de: "Pfingstmontag"
difference: +50

12
holidays/de/bb.yaml Normal file
View file

@ -0,0 +1,12 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Reformation Day"
localized:
de: "Reformationstag"
month: 10
day: 31

3
holidays/de/be.yaml Normal file
View file

@ -0,0 +1,3 @@
---
includes: ["de"]

23
holidays/de/bw.yaml Normal file
View file

@ -0,0 +1,23 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Epiphany"
localized:
de: "Heilige Drei Könige"
month: 1
day: 6
- name: "All Saints"
localized:
de: "Allerheiligen"
month: 11
day: 1
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

23
holidays/de/by.yaml Normal file
View file

@ -0,0 +1,23 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Epiphany"
localized:
de: "Heilige Drei Könige"
month: 1
day: 6
- name: "All Saints"
localized:
de: "Allerheiligen"
month: 11
day: 1
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

3
holidays/de/hb.yaml Normal file
View file

@ -0,0 +1,3 @@
---
includes: ["de"]

11
holidays/de/he.yaml Normal file
View file

@ -0,0 +1,11 @@
---
includes: ["de"]
holidays:
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

3
holidays/de/hh.yaml Normal file
View file

@ -0,0 +1,3 @@
---
includes: ["de"]

12
holidays/de/mv.yaml Normal file
View file

@ -0,0 +1,12 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Reformation Day"
localized:
de: "Reformationstag"
month: 10
day: 31

3
holidays/de/ni.yaml Normal file
View file

@ -0,0 +1,3 @@
---
includes: ["de"]

18
holidays/de/nw.yaml Normal file
View file

@ -0,0 +1,18 @@
---
includes: ["de"]
holidays:
fixed:
- name: "All Saints"
localized:
de: "Allerheiligen"
month: 11
day: 1
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

18
holidays/de/rp.yaml Normal file
View file

@ -0,0 +1,18 @@
---
includes: ["de"]
holidays:
fixed:
- name: "All Saints"
localized:
de: "Allerheiligen"
month: 11
day: 1
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

3
holidays/de/sh.yaml Normal file
View file

@ -0,0 +1,3 @@
---
includes: ["de"]

23
holidays/de/sl.yaml Normal file
View file

@ -0,0 +1,23 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Assumption Day"
localized:
de: "Mariä Himmelfahrt"
month: 8
day: 15
- name: "All Saints"
localized:
de: "Allerheiligen"
month: 11
day: 1
easter_based:
- name: "Corpus Christi"
localized:
de: "Fronleichnam"
difference: +60

12
holidays/de/sn.yaml Normal file
View file

@ -0,0 +1,12 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Reformation Day"
localized:
de: "Reformationstag"
month: 10
day: 31

17
holidays/de/st.yaml Normal file
View file

@ -0,0 +1,17 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Epiphany"
localized:
de: "Heilige Drei Könige"
month: 1
day: 6
- name: "Reformation Day"
localized:
de: "Reformationstag"
month: 10
day: 31

12
holidays/de/th.yaml Normal file
View file

@ -0,0 +1,12 @@
---
includes: ["de"]
holidays:
fixed:
- name: "Reformation Day"
localized:
de: "Reformationstag"
month: 10
day: 31

607
holidays_data.go Normal file
View file

@ -0,0 +1,607 @@
// Code generated by go-bindata.
// sources:
// holidays/de/_.yaml
// holidays/de/bb.yaml
// holidays/de/be.yaml
// holidays/de/bw.yaml
// holidays/de/by.yaml
// holidays/de/hb.yaml
// holidays/de/he.yaml
// holidays/de/hh.yaml
// holidays/de/mv.yaml
// holidays/de/ni.yaml
// holidays/de/nw.yaml
// holidays/de/rp.yaml
// holidays/de/sh.yaml
// holidays/de/sl.yaml
// holidays/de/sn.yaml
// holidays/de/st.yaml
// holidays/de/th.yaml
// DO NOT EDIT!
package holidays
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
if clErr != nil {
return nil, err
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
}
func (fi bindataFileInfo) Name() string {
return fi.name
}
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
return false
}
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
var _holidaysDe_Yaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\xd2\x4d\x6b\xdb\x40\x10\x06\xe0\xfb\xfe\x8a\xc1\x97\x1e\x8a\xc0\x1f\xb8\x50\xdd\xdc\xda\x75\xa1\x1f\x09\x24\xc1\x24\x21\x84\xb1\x76\xa4\x9d\x20\xcd\xc2\xee\x0a\x5b\xf9\xf5\x41\x76\x9c\x58\xb6\x62\x2b\xba\x2d\x1a\xde\x67\x35\x7a\xa3\x28\x52\x8a\x25\xc9\x4b\x4d\x3e\x86\xfb\x07\xa5\x8c\xcd\x59\x63\xe5\x63\xa5\x00\x52\x5e\x93\x8e\x15\x00\x40\x04\x82\x05\xc5\xd0\xfb\x4f\x2b\xb8\x25\x74\x5f\x3c\x4c\xb1\xea\x6d\x5e\x02\xe4\x36\xc1\x9c\x9f\x77\xd3\xf5\xa3\xb7\xd3\xe5\x13\x1a\xe7\x03\x66\xbb\xd1\xc2\x4a\x30\x31\x0c\x5e\x8f\x1a\xab\xdd\xe1\xcd\xf8\x8b\x4b\xeb\xba\xc4\x5f\x63\x06\x9a\x1c\x4c\xdc\x92\x38\x1c\x08\xe3\x13\xc2\x9c\x5c\x81\x02\x37\xc2\xa1\xfa\x0c\x34\xa5\x32\xf8\xc4\x90\xc0\x8c\xc5\x1c\x9b\x83\xfe\x3e\x3a\x6a\xa2\x3f\x8d\x63\x1f\x0a\xec\xb4\xb9\x05\xb1\x11\x4c\x4c\x68\xdb\xdd\x70\x5f\x19\x8e\x9b\xcc\x0f\xbb\x66\xc9\xba\x18\x77\x2b\xe2\x40\x0e\xde\xad\x94\x98\xdc\x59\xf0\x5b\x5d\x0e\x42\x1f\xc8\x3d\x2e\xd1\x1f\x75\x64\x6e\xad\x86\x5f\xae\x2e\xd2\xb9\x2b\xfc\x41\x97\x3a\xe2\x3d\x52\x73\x9a\x92\x23\x49\x28\x86\x68\xd8\x0c\x9e\x6d\x4c\xb8\x2a\xa5\x43\xf4\x45\x3d\xeb\xad\xc8\x07\xe1\xfd\xd6\xec\x7f\xb6\x73\x76\xbd\x9c\xf6\xe8\xaf\x07\x75\x9b\xf8\x84\xc4\xb3\x95\x2e\x7f\x65\x5b\x13\x86\xdf\x5c\x14\x94\xa7\x68\x5c\x68\x35\x46\xdf\x9b\xc8\xc2\x70\xe8\x78\xfd\xcb\x94\x25\xf3\xe1\xc4\x07\x8c\xfb\xea\x25\x00\x00\xff\xff\x4f\x39\x11\x5d\x1e\x04\x00\x00")
func holidaysDe_YamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDe_Yaml,
"holidays/de/_.yaml",
)
}
func holidaysDe_Yaml() (*asset, error) {
bytes, err := holidaysDe_YamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/_.yaml", size: 1054, mode: os.FileMode(436), modTime: time.Unix(1474632960, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeBbYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\xca\x31\x0a\x02\x31\x10\x85\xe1\x7e\x4e\xf1\x48\x1f\x70\xb1\x9b\xda\x13\xd8\x8a\xc5\xb0\x33\xeb\x0e\x64\x33\x60\x22\x18\x4f\x2f\x8a\xdb\xf8\xba\xc7\xff\xe5\x9c\x89\xbc\xce\xe5\xa1\xd6\x18\x97\xa4\x96\xae\x44\x6b\x14\x57\x19\x8d\x89\x80\xc5\x9f\xa6\x4c\x00\x90\x51\x65\x33\x46\x3a\xdb\x12\xf7\x4d\xba\x47\xc5\x49\x46\xfa\x56\xa0\xc4\x2c\xc5\x5f\x3b\xff\x4c\xff\x78\xeb\x72\xdb\xf9\x16\xb5\xaf\x8c\xe9\xf0\xfb\x2a\x83\x71\x9c\xe8\x1d\x00\x00\xff\xff\x65\x9d\xee\x7b\x96\x00\x00\x00")
func holidaysDeBbYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeBbYaml,
"holidays/de/bb.yaml",
)
}
func holidaysDeBbYaml() (*asset, error) {
bytes, err := holidaysDeBbYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/bb.yaml", size: 150, mode: os.FileMode(436), modTime: time.Unix(1474633579, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeBeYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd5\xd5\xe5\xe2\xca\xcc\x4b\xce\x29\x4d\x49\x2d\xb6\x52\x88\x56\x4a\x49\x55\x8a\xe5\x02\x04\x00\x00\xff\xff\x0a\x6b\x4d\xfd\x16\x00\x00\x00")
func holidaysDeBeYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeBeYaml,
"holidays/de/be.yaml",
)
}
func holidaysDeBeYaml() (*asset, error) {
bytes, err := holidaysDeBeYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/be.yaml", size: 22, mode: os.FileMode(436), modTime: time.Unix(1474633355, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeBwYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcf\xb1\x4a\xc4\x40\x10\x06\xe0\x7e\x9e\xe2\x27\xad\x04\xbc\xe6\x8a\xed\x8e\x53\x11\x2c\x2d\x45\x64\xcc\x4e\x6e\x07\x26\xb3\x61\x37\x07\xc6\x07\xf3\x05\x7c\x31\x89\x9a\xe2\xb4\xc8\x74\x33\xfc\xc3\xc7\xdf\xb6\x2d\x91\x7a\x67\xe7\x28\x35\xe0\xa9\x89\xd2\x3c\x13\xa5\x6c\x1a\x79\xae\x81\x08\xe8\xf5\x4d\x62\x20\x00\x68\xe1\x3c\x48\x40\x73\x3b\xea\x98\xd8\xe7\xe6\xfb\x0c\x58\xee\xd8\xf4\x7d\xcd\x2d\x13\x97\xdc\xbd\xa8\xe9\x49\x70\x53\x44\xf1\xf0\xf9\xe1\x7a\x92\xf5\x67\xc8\x3e\xa5\x80\xdd\xef\x1a\x79\x0e\xd8\x5f\x32\x07\x33\x3c\xb2\xfa\x54\xb7\xa0\x83\x99\x94\xf4\xa3\xf9\x5f\xe1\x82\xd8\x2d\x9d\x84\xeb\x24\xe5\xe5\x95\xeb\xbf\x6a\xc7\x5c\xc6\x73\xc5\x31\x15\xad\x93\x6e\xb9\x77\x25\xbb\x89\x76\xc9\x79\x58\xb3\x51\xfb\x5e\x8a\x78\x27\x01\x57\xfb\x6b\xfa\x0a\x00\x00\xff\xff\x6a\x7e\x58\x6c\x65\x01\x00\x00")
func holidaysDeBwYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeBwYaml,
"holidays/de/bw.yaml",
)
}
func holidaysDeBwYaml() (*asset, error) {
bytes, err := holidaysDeBwYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/bw.yaml", size: 357, mode: os.FileMode(436), modTime: time.Unix(1474631736, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeByYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcf\xb1\x4a\xc4\x40\x10\x06\xe0\x7e\x9e\xe2\x27\xad\x04\xbc\xe6\x8a\xed\x8e\x53\x11\x2c\x2d\x45\x64\xcc\x4e\x6e\x07\x26\xb3\x61\x37\x07\xc6\x07\xf3\x05\x7c\x31\x89\x9a\xe2\xb4\xc8\x74\x33\xfc\xc3\xc7\xdf\xb6\x2d\x91\x7a\x67\xe7\x28\x35\xe0\xa9\x89\xd2\x3c\x13\xa5\x6c\x1a\x79\xae\x81\x08\xe8\xf5\x4d\x62\x20\x00\x68\xe1\x3c\x48\x40\x73\x3b\xea\x98\xd8\xe7\xe6\xfb\x0c\x58\xee\xd8\xf4\x7d\xcd\x2d\x13\x97\xdc\xbd\xa8\xe9\x49\x70\x53\x44\xf1\xf0\xf9\xe1\x7a\x92\xf5\x67\xc8\x3e\xa5\x80\xdd\xef\x1a\x79\x0e\xd8\x5f\x32\x07\x33\x3c\xb2\xfa\x54\xb7\xa0\x83\x99\x94\xf4\xa3\xf9\x5f\xe1\x82\xd8\x2d\x9d\x84\xeb\x24\xe5\xe5\x95\xeb\xbf\x6a\xc7\x5c\xc6\x73\xc5\x31\x15\xad\x93\x6e\xb9\x77\x25\xbb\x89\x76\xc9\x79\x58\xb3\x51\xfb\x5e\x8a\x78\x27\x01\x57\xfb\x6b\xfa\x0a\x00\x00\xff\xff\x6a\x7e\x58\x6c\x65\x01\x00\x00")
func holidaysDeByYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeByYaml,
"holidays/de/by.yaml",
)
}
func holidaysDeByYaml() (*asset, error) {
bytes, err := holidaysDeByYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/by.yaml", size: 357, mode: os.FileMode(436), modTime: time.Unix(1474633085, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeHbYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd5\xd5\xe5\xe2\xca\xcc\x4b\xce\x29\x4d\x49\x2d\xb6\x52\x88\x56\x4a\x49\x55\x8a\xe5\x02\x04\x00\x00\xff\xff\x0a\x6b\x4d\xfd\x16\x00\x00\x00")
func holidaysDeHbYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeHbYaml,
"holidays/de/hb.yaml",
)
}
func holidaysDeHbYaml() (*asset, error) {
bytes, err := holidaysDeHbYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/hb.yaml", size: 22, mode: os.FileMode(436), modTime: time.Unix(1474633355, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeHeYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x34\xca\x31\x0a\xc3\x30\x0c\x46\xe1\x5d\xa7\xf8\xf1\x5a\x0c\x9d\x3a\x78\x0d\xf4\x12\xa5\x14\xd5\x52\xb0\xc0\xb1\x8b\x95\x0c\xed\xe9\x4b\x02\x79\xeb\xfb\x62\x8c\x44\xd6\x72\xdd\x44\x3d\xe1\x11\x44\xc3\x93\xa8\xf4\x6a\xc2\x5f\x4f\x44\x80\xb2\xaf\x3a\x5e\x6f\x76\x95\x44\x00\x10\xd1\x78\xd1\x84\x30\xf5\xf1\xd9\x1c\x53\x19\xe6\xab\x85\x63\x02\xb5\x67\xae\xf6\x3b\xf5\x9e\xec\xfa\x3e\x7a\xab\x6a\xb9\x34\x5e\x4e\x2b\x36\xcf\x3a\xb4\x65\x4d\xb8\xdc\xae\xf4\x0f\x00\x00\xff\xff\xd4\xe7\x49\xa5\x91\x00\x00\x00")
func holidaysDeHeYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeHeYaml,
"holidays/de/he.yaml",
)
}
func holidaysDeHeYaml() (*asset, error) {
bytes, err := holidaysDeHeYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/he.yaml", size: 145, mode: os.FileMode(436), modTime: time.Unix(1474633760, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeHhYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd5\xd5\xe5\xe2\xca\xcc\x4b\xce\x29\x4d\x49\x2d\xb6\x52\x88\x56\x4a\x49\x55\x8a\xe5\x02\x04\x00\x00\xff\xff\x0a\x6b\x4d\xfd\x16\x00\x00\x00")
func holidaysDeHhYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeHhYaml,
"holidays/de/hh.yaml",
)
}
func holidaysDeHhYaml() (*asset, error) {
bytes, err := holidaysDeHhYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/hh.yaml", size: 22, mode: os.FileMode(436), modTime: time.Unix(1474633355, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeMvYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\xca\x31\x0a\x02\x31\x10\x85\xe1\x7e\x4e\xf1\x48\x1f\x70\xb1\x9b\xda\x13\xd8\x8a\xc5\xb0\x33\xeb\x0e\x64\x33\x60\x22\x18\x4f\x2f\x8a\xdb\xf8\xba\xc7\xff\xe5\x9c\x89\xbc\xce\xe5\xa1\xd6\x18\x97\xa4\x96\xae\x44\x6b\x14\x57\x19\x8d\x89\x80\xc5\x9f\xa6\x4c\x00\x90\x51\x65\x33\x46\x3a\xdb\x12\xf7\x4d\xba\x47\xc5\x49\x46\xfa\x56\xa0\xc4\x2c\xc5\x5f\x3b\xff\x4c\xff\x78\xeb\x72\xdb\xf9\x16\xb5\xaf\x8c\xe9\xf0\xfb\x2a\x83\x71\x9c\xe8\x1d\x00\x00\xff\xff\x65\x9d\xee\x7b\x96\x00\x00\x00")
func holidaysDeMvYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeMvYaml,
"holidays/de/mv.yaml",
)
}
func holidaysDeMvYaml() (*asset, error) {
bytes, err := holidaysDeMvYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/mv.yaml", size: 150, mode: os.FileMode(436), modTime: time.Unix(1474633699, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeNiYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd5\xd5\xe5\xe2\xca\xcc\x4b\xce\x29\x4d\x49\x2d\xb6\x52\x88\x56\x4a\x49\x55\x8a\xe5\x02\x04\x00\x00\xff\xff\x0a\x6b\x4d\xfd\x16\x00\x00\x00")
func holidaysDeNiYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeNiYaml,
"holidays/de/ni.yaml",
)
}
func holidaysDeNiYaml() (*asset, error) {
bytes, err := holidaysDeNiYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/ni.yaml", size: 22, mode: os.FileMode(436), modTime: time.Unix(1474633355, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeNwYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcd\xb1\x4a\x05\x31\x10\x85\xe1\x7e\x9e\xe2\x90\x56\x02\x6e\x63\x91\x4e\x2e\xf8\x02\x96\x22\x32\x26\xb3\x66\x60\x76\x22\x49\x2e\x78\x7d\x7a\x59\xd9\xad\x2c\x9c\x6e\x38\x1f\xfc\x31\x46\x22\xf5\x6c\xd7\x22\x23\xe1\x25\x14\x09\xaf\x44\xb5\x99\x16\xbe\x8d\x44\x04\xac\xfa\x25\x25\x11\x00\x44\x38\x6f\x92\x10\x1e\xcd\xf0\xcc\xea\x73\x84\xdf\x01\xb0\x96\xd9\xf4\xfb\x94\xfb\x95\x43\x4a\xaf\xa2\xa6\x1f\xe2\x27\xde\x9a\xcf\x9a\xb0\x2c\xc7\x5f\xf8\x96\xb0\xec\x31\xe1\x31\xa5\xbf\xbd\xf3\xf8\xd3\xbc\xb4\xfe\x79\x1d\xb8\xd4\xae\x63\xea\x7f\xdd\xa7\xde\xdc\x44\x73\x75\xde\x4e\x5b\x74\x5d\xa5\x8b\x67\x49\xb8\x7b\xb8\xa7\x9f\x00\x00\x00\xff\xff\x01\x9e\x9b\x66\xfe\x00\x00\x00")
func holidaysDeNwYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeNwYaml,
"holidays/de/nw.yaml",
)
}
func holidaysDeNwYaml() (*asset, error) {
bytes, err := holidaysDeNwYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/nw.yaml", size: 254, mode: os.FileMode(436), modTime: time.Unix(1474633825, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeRpYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcd\xb1\x4a\x05\x31\x10\x85\xe1\x7e\x9e\xe2\x90\x56\x02\x6e\x63\x91\x4e\x2e\xf8\x02\x96\x22\x32\x26\xb3\x66\x60\x76\x22\x49\x2e\x78\x7d\x7a\x59\xd9\xad\x2c\x9c\x6e\x38\x1f\xfc\x31\x46\x22\xf5\x6c\xd7\x22\x23\xe1\x25\x14\x09\xaf\x44\xb5\x99\x16\xbe\x8d\x44\x04\xac\xfa\x25\x25\x11\x00\x44\x38\x6f\x92\x10\x1e\xcd\xf0\xcc\xea\x73\x84\xdf\x01\xb0\x96\xd9\xf4\xfb\x94\xfb\x95\x43\x4a\xaf\xa2\xa6\x1f\xe2\x27\xde\x9a\xcf\x9a\xb0\x2c\xc7\x5f\xf8\x96\xb0\xec\x31\xe1\x31\xa5\xbf\xbd\xf3\xf8\xd3\xbc\xb4\xfe\x79\x1d\xb8\xd4\xae\x63\xea\x7f\xdd\xa7\xde\xdc\x44\x73\x75\xde\x4e\x5b\x74\x5d\xa5\x8b\x67\x49\xb8\x7b\xb8\xa7\x9f\x00\x00\x00\xff\xff\x01\x9e\x9b\x66\xfe\x00\x00\x00")
func holidaysDeRpYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeRpYaml,
"holidays/de/rp.yaml",
)
}
func holidaysDeRpYaml() (*asset, error) {
bytes, err := holidaysDeRpYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/rp.yaml", size: 254, mode: os.FileMode(436), modTime: time.Unix(1474633869, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeShYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd5\xd5\xe5\xe2\xca\xcc\x4b\xce\x29\x4d\x49\x2d\xb6\x52\x88\x56\x4a\x49\x55\x8a\xe5\x02\x04\x00\x00\xff\xff\x0a\x6b\x4d\xfd\x16\x00\x00\x00")
func holidaysDeShYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeShYaml,
"holidays/de/sh.yaml",
)
}
func holidaysDeShYaml() (*asset, error) {
bytes, err := holidaysDeShYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/sh.yaml", size: 22, mode: os.FileMode(436), modTime: time.Unix(1474633279, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeSlYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcf\x31\x4a\xc5\x40\x10\x06\xe0\x7e\x4f\xf1\x93\x56\x02\xa6\x50\x64\xbb\xc7\x13\xb1\xb1\xb2\x14\x91\x31\x3b\x71\x07\x66\x77\x1f\x3b\x1b\x30\x9e\xc7\x9b\x78\x31\x89\x98\xc2\x67\x91\xe9\x86\xf9\x87\x8f\xbf\xef\x7b\xe7\x24\x8f\x3a\x07\x36\x8f\xa7\x2e\x70\xf7\xec\x5c\x2c\x2a\x81\x16\xf3\xce\x01\x93\xbc\x73\xf0\x0e\x00\x7a\x64\x4a\xec\xd1\x1d\xcc\xe6\x74\x6a\x52\x32\x6e\x69\xe9\x7e\x8e\x80\x96\x91\x54\x3e\xb6\xf4\x3a\x61\x4d\x3f\x50\x95\xaf\x4f\xdc\x4b\x4a\xac\x13\xc5\xda\xb6\x8f\x54\x72\x8b\x1e\x37\xbf\x6b\xa0\xc5\x63\xb8\x3a\xb3\x54\xf1\x48\x92\x9b\xed\x39\x07\x55\xae\x91\x45\xe5\x8d\xf3\x19\x31\x0c\x7f\x8c\xb5\x18\x93\x35\xae\x2f\xaf\x64\xff\xfa\x1d\x4b\x3d\xcd\x86\x63\xac\x62\x4d\xf6\xdc\xbb\x5a\xb2\xb2\x8c\x31\x53\xda\xb2\x41\xa6\x89\x2b\xe7\x91\x3d\x2e\xae\x2f\xdd\x77\x00\x00\x00\xff\xff\xc6\x9d\x45\x78\x6a\x01\x00\x00")
func holidaysDeSlYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeSlYaml,
"holidays/de/sl.yaml",
)
}
func holidaysDeSlYaml() (*asset, error) {
bytes, err := holidaysDeSlYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/sl.yaml", size: 362, mode: os.FileMode(436), modTime: time.Unix(1474633929, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeSnYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\xca\x31\x0a\x02\x31\x10\x85\xe1\x7e\x4e\xf1\x48\x1f\x70\xb1\x9b\xda\x13\xd8\x8a\xc5\xb0\x33\xeb\x0e\x64\x33\x60\x22\x18\x4f\x2f\x8a\xdb\xf8\xba\xc7\xff\xe5\x9c\x89\xbc\xce\xe5\xa1\xd6\x18\x97\xa4\x96\xae\x44\x6b\x14\x57\x19\x8d\x89\x80\xc5\x9f\xa6\x4c\x00\x90\x51\x65\x33\x46\x3a\xdb\x12\xf7\x4d\xba\x47\xc5\x49\x46\xfa\x56\xa0\xc4\x2c\xc5\x5f\x3b\xff\x4c\xff\x78\xeb\x72\xdb\xf9\x16\xb5\xaf\x8c\xe9\xf0\xfb\x2a\x83\x71\x9c\xe8\x1d\x00\x00\xff\xff\x65\x9d\xee\x7b\x96\x00\x00\x00")
func holidaysDeSnYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeSnYaml,
"holidays/de/sn.yaml",
)
}
func holidaysDeSnYaml() (*asset, error) {
bytes, err := holidaysDeSnYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/sn.yaml", size: 150, mode: os.FileMode(436), modTime: time.Unix(1474633699, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeStYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\xcd\xb1\x0a\xc2\x30\x10\xc6\xf1\xfd\x9e\xe2\x23\x7b\xc0\x22\x38\x64\xae\x20\xb8\xb9\x8a\xc3\xd1\x5c\xdb\x83\x34\x29\x6d\x05\xe3\x83\xf9\x02\xbe\x98\x54\x2c\x54\x17\x6f\xbb\xe3\x7f\xfc\xac\xb5\x44\x1a\xab\x70\xf5\x32\x3a\x9c\x8d\x17\x73\x21\x6a\x53\x50\xcf\x79\x74\x44\x40\xad\x37\xf1\x8e\x00\xc0\x22\x72\x27\x0e\x66\xdf\x6b\xdf\x72\xcc\xe6\x7d\x06\x42\xaa\x38\xe8\x7d\xe9\xe6\xf1\x73\x77\x10\x0d\xda\x08\xca\x41\x14\xc7\xe7\x23\x6a\x23\xcb\x4f\x97\xe2\xd4\x3a\x14\x9f\xd5\x73\x76\xd8\x7d\x33\x27\xa9\xd3\xd0\xf1\xa4\x29\xa2\xe4\xbf\xda\x2a\x1f\x27\x6e\x7e\xa1\xcd\x5a\xda\x16\xf4\x0a\x00\x00\xff\xff\xa7\x67\x32\xd5\xfd\x00\x00\x00")
func holidaysDeStYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeStYaml,
"holidays/de/st.yaml",
)
}
func holidaysDeStYaml() (*asset, error) {
bytes, err := holidaysDeStYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/st.yaml", size: 253, mode: os.FileMode(436), modTime: time.Unix(1474633756, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _holidaysDeThYaml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\xca\x31\x0a\x02\x31\x10\x85\xe1\x7e\x4e\xf1\x48\x1f\x70\xb1\x9b\xda\x13\xd8\x8a\xc5\xb0\x33\xeb\x0e\x64\x33\x60\x22\x18\x4f\x2f\x8a\xdb\xf8\xba\xc7\xff\xe5\x9c\x89\xbc\xce\xe5\xa1\xd6\x18\x97\xa4\x96\xae\x44\x6b\x14\x57\x19\x8d\x89\x80\xc5\x9f\xa6\x4c\x00\x90\x51\x65\x33\x46\x3a\xdb\x12\xf7\x4d\xba\x47\xc5\x49\x46\xfa\x56\xa0\xc4\x2c\xc5\x5f\x3b\xff\x4c\xff\x78\xeb\x72\xdb\xf9\x16\xb5\xaf\x8c\xe9\xf0\xfb\x2a\x83\x71\x9c\xe8\x1d\x00\x00\xff\xff\x65\x9d\xee\x7b\x96\x00\x00\x00")
func holidaysDeThYamlBytes() ([]byte, error) {
return bindataRead(
_holidaysDeThYaml,
"holidays/de/th.yaml",
)
}
func holidaysDeThYaml() (*asset, error) {
bytes, err := holidaysDeThYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "holidays/de/th.yaml", size: 150, mode: os.FileMode(436), modTime: time.Unix(1474633699, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not found", name)
}
// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
}
// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("AssetInfo %s not found", name)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"holidays/de/_.yaml": holidaysDe_Yaml,
"holidays/de/bb.yaml": holidaysDeBbYaml,
"holidays/de/be.yaml": holidaysDeBeYaml,
"holidays/de/bw.yaml": holidaysDeBwYaml,
"holidays/de/by.yaml": holidaysDeByYaml,
"holidays/de/hb.yaml": holidaysDeHbYaml,
"holidays/de/he.yaml": holidaysDeHeYaml,
"holidays/de/hh.yaml": holidaysDeHhYaml,
"holidays/de/mv.yaml": holidaysDeMvYaml,
"holidays/de/ni.yaml": holidaysDeNiYaml,
"holidays/de/nw.yaml": holidaysDeNwYaml,
"holidays/de/rp.yaml": holidaysDeRpYaml,
"holidays/de/sh.yaml": holidaysDeShYaml,
"holidays/de/sl.yaml": holidaysDeSlYaml,
"holidays/de/sn.yaml": holidaysDeSnYaml,
"holidays/de/st.yaml": holidaysDeStYaml,
"holidays/de/th.yaml": holidaysDeThYaml,
}
// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
// data/
// foo.txt
// img/
// a.png
// b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"holidays": &bintree{nil, map[string]*bintree{
"de": &bintree{nil, map[string]*bintree{
"_.yaml": &bintree{holidaysDe_Yaml, map[string]*bintree{}},
"bb.yaml": &bintree{holidaysDeBbYaml, map[string]*bintree{}},
"be.yaml": &bintree{holidaysDeBeYaml, map[string]*bintree{}},
"bw.yaml": &bintree{holidaysDeBwYaml, map[string]*bintree{}},
"by.yaml": &bintree{holidaysDeByYaml, map[string]*bintree{}},
"hb.yaml": &bintree{holidaysDeHbYaml, map[string]*bintree{}},
"he.yaml": &bintree{holidaysDeHeYaml, map[string]*bintree{}},
"hh.yaml": &bintree{holidaysDeHhYaml, map[string]*bintree{}},
"mv.yaml": &bintree{holidaysDeMvYaml, map[string]*bintree{}},
"ni.yaml": &bintree{holidaysDeNiYaml, map[string]*bintree{}},
"nw.yaml": &bintree{holidaysDeNwYaml, map[string]*bintree{}},
"rp.yaml": &bintree{holidaysDeRpYaml, map[string]*bintree{}},
"sh.yaml": &bintree{holidaysDeShYaml, map[string]*bintree{}},
"sl.yaml": &bintree{holidaysDeSlYaml, map[string]*bintree{}},
"sn.yaml": &bintree{holidaysDeSnYaml, map[string]*bintree{}},
"st.yaml": &bintree{holidaysDeStYaml, map[string]*bintree{}},
"th.yaml": &bintree{holidaysDeThYaml, map[string]*bintree{}},
}},
}},
}}
// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
}
func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}