-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to reflect changes to whosonfirst/go-whosonfirst-spatial v0.9.0 (
#8) * snapshot: new branch to reflect changes to go-whosonfirst-spatial v0.9.0 * snapshot: replace all the flags code; compile but untested * snapshot: compiles again, still untested * update docs --------- Co-authored-by: sfomuseumbot <sfomuseumbot@localhost>
- Loading branch information
1 parent
6f62e5d
commit 8aed128
Showing
384 changed files
with
58,601 additions
and
19,868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
GOMOD=$(shell test -f "go.work" && echo "readonly" || echo "vendor") | ||
LDFLAGS=-s -w | ||
|
||
# https://developers.google.com/protocol-buffers/docs/reference/go-generated | ||
# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
|
||
proto: | ||
protoc --go_out=. --go_opt=paths=source_relative --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative spatial/spatial.proto | ||
|
||
cli: | ||
go build -mod vendor -o bin/server cmd/server/main.go | ||
go build -mod vendor -o bin/client cmd/client/main.go | ||
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/server cmd/server/main.go | ||
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/client cmd/client/main.go | ||
|
||
debug: | ||
go run -mod vendor cmd/server/main.go -mode directory:// /usr/local/data/sfomuseum-data-maps/data | ||
go run -mod $(GOMOD) -ldflags="$(LDFLAGS)" cmd/server/main.go \ | ||
-iterator-uri repo:// \ | ||
/usr/local/data/sfomuseum-data-maps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"flag" | ||
|
||
"github.com/sfomuseum/go-flags/flagset" | ||
) | ||
|
||
type RunOptions struct { | ||
Host string `json:"host"` | ||
Port int `json:"port"` | ||
Stdout bool `json:"stdout"` | ||
Null bool `json:"null"` | ||
Latitude float64 `json:"latitude"` | ||
Longitude float64 `json:"longitude"` | ||
Placetypes []string `json:"placetypes,omitempty"` | ||
Geometries string `json:"geometries,omitempty"` | ||
AlternateGeometries []string `json:"alternate_geometries,omitempty"` | ||
IsCurrent []int64 `json:"is_current,omitempty"` | ||
IsCeased []int64 `json:"is_ceased,omitempty"` | ||
IsDeprecated []int64 `json:"is_deprecated,omitempty"` | ||
IsSuperseded []int64 `json:"is_superseded,omitempty"` | ||
IsSuperseding []int64 `json:"is_superseding,omitempty"` | ||
InceptionDate string `json:"inception_date,omitempty"` | ||
CessationDate string `json:"cessation_date,omitempty"` | ||
Properties []string `json:"properties,omitempty"` | ||
Sort []string `json:"sort,omitempty"` | ||
} | ||
|
||
func RunOptionsFromFlagSet(ctx context.Context, fs *flag.FlagSet) (*RunOptions, error) { | ||
|
||
flagset.Parse(fs) | ||
|
||
err := flagset.SetFlagsFromEnvVars(fs, "WHOSONFIRST") | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
opts := &RunOptions{ | ||
Host: host, | ||
Port: port, | ||
Stdout: stdout, | ||
Null: null, | ||
Latitude: latitude, | ||
Longitude: longitude, | ||
Placetypes: placetypes, | ||
Geometries: geometries, | ||
AlternateGeometries: alt_geoms, | ||
IsCurrent: is_current, | ||
IsCeased: is_ceased, | ||
IsDeprecated: is_deprecated, | ||
IsSuperseded: is_superseded, | ||
IsSuperseding: is_superseding, | ||
InceptionDate: inception, | ||
CessationDate: cessation, | ||
Properties: props, | ||
Sort: sort_uris, | ||
} | ||
|
||
return opts, nil | ||
} |
Oops, something went wrong.