add zip to configs
parent
0013db850c
commit
e19cd7095d
|
|
@ -48,6 +48,10 @@
|
||||||
"States": [
|
"States": [
|
||||||
"NC"
|
"NC"
|
||||||
],
|
],
|
||||||
|
"UseZips": true,
|
||||||
|
"Zips": [
|
||||||
|
"27006"
|
||||||
|
],
|
||||||
"IDs": {
|
"IDs": {
|
||||||
"Matrix": "@bel:m.bltrucks.top"
|
"Matrix": "@bel:m.bltrucks.top"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,10 @@
|
||||||
"States": [
|
"States": [
|
||||||
"NC"
|
"NC"
|
||||||
],
|
],
|
||||||
|
"UseZips": true,
|
||||||
|
"Zips": [
|
||||||
|
"27006"
|
||||||
|
],
|
||||||
"IDs": {
|
"IDs": {
|
||||||
"Matrix": "@bel:m.bltrucks.top"
|
"Matrix": "@bel:m.bltrucks.top"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,10 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
States []State
|
UseZips bool
|
||||||
IDs struct {
|
States []State
|
||||||
|
Zips []string
|
||||||
|
IDs struct {
|
||||||
Matrix string
|
Matrix string
|
||||||
}
|
}
|
||||||
Available Time
|
Available Time
|
||||||
|
|
@ -115,6 +117,20 @@ func Clients(t time.Time) map[string]Client {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AllZips() []string {
|
||||||
|
zipm := map[string]struct{}{}
|
||||||
|
for _, v := range Clients(time.Now().Add(time.Hour * 24 * 365)) {
|
||||||
|
for _, state := range v.Zips {
|
||||||
|
statem[state] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zips := make([]State, 0, len(statem)+1)
|
||||||
|
for k := range statem {
|
||||||
|
zips = append(zips, k)
|
||||||
|
}
|
||||||
|
return zips
|
||||||
|
}
|
||||||
|
|
||||||
func AllStates() []State {
|
func AllStates() []State {
|
||||||
statem := map[State]struct{}{}
|
statem := map[State]struct{}{}
|
||||||
for _, v := range Clients(time.Now().Add(time.Hour * 24 * 365)) {
|
for _, v := range Clients(time.Now().Add(time.Hour * 24 * 365)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue