gbdx

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath   = "https://geobigdata.io/"
	TokenPath  = "auth/v1/oauth/token"
	SearchPath = "catalog/v2/search"
)

Paths to the GBDX api endpoints

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, username string, password string) (*http.Client, error)

NewClient returns an oauth2 client configured for token access

Types

type CatalogSearch

type CatalogSearch struct {
	// contains filtered or unexported fields
}

CatalogSearch retrieves data from the gbdx endpoint

func NewCatalogSearch

func NewCatalogSearch(client *http.Client, wkt string) (c *CatalogSearch, err error)

NewCatalogSearch takes a oauth2 client and a WKT string of a single polygon and gets results from the catalog search endpoint for all matching records (max 1000) inside the WKT I'd probably split this up in IRL and definitely clean up the error handling

func (*CatalogSearch) EncodeJSON

func (c *CatalogSearch) EncodeJSON(w io.Writer) error

EncodeJSON writes the results to an io.Writer as unescaped json. The client is responsible for setting any headers including the return code if required

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL