Documentation
¶
Index ¶
- func Authenticate(authorization string) (bool, string)
- func Authorize(token, role string) bool
- func DeleteRecurring(key string) error
- func DropIndex() int
- func GetKey(key string) (string, error)
- func GetMockConnCount() (count int)
- func GetSceneMetadata(id string) (*geojson.Feature, error)
- func HarvestPlanet(options HarvestOptions)
- func IndexSize() int64
- func MakeMockRedisCli(outputs []string) *redis.Client
- func MockDialer() (net.Conn, error)
- func PlanetRecurring(host string, options HarvestOptions) (string, string, error)
- func RedisClient() (*redis.Client, error)
- func RedisConvArray() string
- func RedisConvErrStr(val string) string
- func RedisConvInt(val int) string
- func RedisConvStatus(val string) string
- func RedisConvString(val string) string
- func RedisError(red *redis.Client, err error)
- func RemoveFeature(feature *geojson.Feature) error
- func SaveFeatureProperties(id string, properties map[string]interface{}) error
- func SetIDAM(idam IDAM)
- func SetImageCatalogPrefix(prefix string)
- func SetKey(key, value string) error
- func SetMockConnCount(count int)
- func StoreFeature(feature *geojson.Feature, reharvest bool) (string, error)
- func StoreRecurring(key string, options HarvestOptions) error
- type FeatureLayer
- type HarvestFilter
- type HarvestOptions
- type IDAM
- type PlanetLinks
- type PlanetResponse
- type SceneDescriptors
- type SearchOptions
- type TestIDAM
- type VcapCredentials
- type VcapRedis
- type VcapServices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
Authenticate returns true and a token if the authorization string is valid
func DeleteRecurring ¶
DeleteRecurring removes all trace of a recurring harvest from storage
func DropIndex ¶
func DropIndex() int
DropIndex drops the main index containing all known catalog entries, deletes the underlying entries, and returns the number of images
func GetSceneMetadata ¶
GetSceneMetadata returns the image metadata as a GeoJSON feature
func MakeMockRedisCli ¶
MakeMockRedisCli creates the mock redis client
func MockDialer ¶
MockDialer sets up a mock dialer for the mock redis
func PlanetRecurring ¶
func PlanetRecurring(host string, options HarvestOptions) (string, string, error)
PlanetRecurring establishes the workflow management for a recurring harvest and returns the event ID and trigger ID
func RedisClient ¶
RedisClient is a factory method for a Redis instance
func RedisConvArray ¶
func RedisConvArray() string
RedisConvArray returns a specific string for testing purposes
func RedisConvErrStr ¶
RedisConvErrStr converts an error string for redis use
func RedisConvStatus ¶
RedisConvStatus converts a status string for redis use
func RedisConvString ¶
RedisConvString converts a string for redis use
func RedisError ¶
RedisError closes down the connection so that other operations can fail somewhat gracefully. We should never fail in normal settings.
func RemoveFeature ¶
RemoveFeature removes a feature from the catalog and any known caches
func SaveFeatureProperties ¶
SaveFeatureProperties retrieves the requested feature from the database, Updates properties with the contents of the map provided, and re-saves
func SetImageCatalogPrefix ¶
func SetImageCatalogPrefix(prefix string)
SetImageCatalogPrefix sets the prefix for this instance when it is necessary to override the default
func StoreFeature ¶
StoreFeature stores a feature into the catalog using a key based on the feature's ID
func StoreRecurring ¶
func StoreRecurring(key string, options HarvestOptions) error
StoreRecurring adds the details of a recurring harvest to storage for later retrieval
Types ¶
type FeatureLayer ¶
type FeatureLayer struct {
WfsURL string `json:"wfsurl"`
FeatureType string `json:"featureType"`
GeoJSON map[string]interface{} `json:"geojson"`
TileMap map[string]*geos.Geometry `json:"-"`
}
FeatureLayer describes features
func (*FeatureLayer) Disjoint ¶
func (fl *FeatureLayer) Disjoint(input *geos.Geometry) (bool, error)
Disjoint returns true if the layer is disjoint with the geometry provided
func (*FeatureLayer) Intersects ¶
func (fl *FeatureLayer) Intersects(input *geos.Geometry) (bool, error)
Intersects returns true if the layer is disjoint with the geometry provided
func (*FeatureLayer) PrepareGeometries ¶
func (fl *FeatureLayer) PrepareGeometries() error
PrepareGeometries establishes Geos geometries for later processing, Returning an error on failure
type HarvestFilter ¶
type HarvestFilter struct {
WhiteList FeatureLayer `json:"whitelist"`
BlackList FeatureLayer `json:"blacklist"`
}
HarvestFilter constrains harvesting
func (*HarvestFilter) PrepareGeometries ¶
func (hf *HarvestFilter) PrepareGeometries() error
PrepareGeometries establishes Geos geometries for later processing, Returning an error on failure
type HarvestOptions ¶
type HarvestOptions struct {
Event bool `json:"event,omitempty"`
Reharvest bool `json:"reharvest,omitempty"`
PlanetKey string `json:"PL_API_KEY"`
PiazzaGateway string `json:"pzGateway"`
PiazzaAuthorization string `json:"pzAuth"`
Filter HarvestFilter `json:"filter"`
Cap int `json:"cap"`
URLRoot string `json:"urlRoot"`
Recurring bool `json:"recurring"`
RequestPageSize int `json:"requestPageSize"`
EventTypeID string
// contains filtered or unexported fields
}
HarvestOptions are options for a harvesting operation
type IDAM ¶
type IDAM interface {
// contains filtered or unexported methods
}
IDAM is an interface for providing authentication and authorization
type PlanetLinks ¶
type PlanetLinks struct {
Self string `json:"self"`
Prev string `json:"prev"`
Next string `json:"next"`
First string `json:"first"`
}
PlanetLinks represents the links JSON structure.
type PlanetResponse ¶
type PlanetResponse struct {
Count string `json:"auth"`
Links PlanetLinks `json:"links"`
}
PlanetResponse represents the response JSON structure.
type SceneDescriptors ¶
type SceneDescriptors struct {
Count int `json:"count"`
TotalCount int `json:"totalCount"`
StartIndex int `json:"startIndex"`
SubIndex string `json:"subIndex"`
Scenes *geojson.FeatureCollection `json:"images"` // Changing this to "scenes" may break clients
}
SceneDescriptors is the response to a Discover query
func GetScenes ¶
func GetScenes(input *geojson.Feature, options SearchOptions) (SceneDescriptors, string, error)
GetScenes returns scenes for the given set matching the criteria in the input and options
type SearchOptions ¶
type SearchOptions struct {
NoCache bool
MinimumIndex int
MaximumIndex int
Count int
Rigorous bool
}
SearchOptions is the options for a search request
type TestIDAM ¶
type TestIDAM struct {
}
TestIDAM is an IDAM solely for testing purposes. Very permissive. TODO: Move to a test file once we have a real test solution to use
type VcapCredentials ¶
type VcapCredentials struct {
Host string `json:"host"`
Password string `json:"password"`
Port int `json:"port"`
}
VcapCredentials is the credentials element of VCAP_SERVICES
type VcapRedis ¶
type VcapRedis struct {
// Label string `json:"label"`
// Name string `json:"name"`
// Plan string `json:"plan"`
// Tags []string `json:"tags"`
Credentials VcapCredentials `json:"credentials"`
}
VcapRedis is the p-redis element of VCAP_SERVICES
type VcapServices ¶
type VcapServices struct {
Redis []VcapRedis `json:"p-redis"`
}
VcapServices is the container for the VCAP_SERVICES environment variable
func (VcapServices) RedisOptions ¶
func (services VcapServices) RedisOptions() *redis.Options
RedisOptions is a factory method for redis.Options If the object is not complete, a default of 127.0.0.1:6379 is returned