Documentation
¶
Index ¶
- func Fatal(err error) bool
- func GetBodyRetry(url string, nbTries int) ([]byte, error)
- func HTTPGetWithAuth(ctx context.Context, url, authName, authPswd, authToken string) ([]byte, error)
- func HTTPPostWithAuth(ctx context.Context, url string, body io.Reader, ...) (*http.Response, error)
- func LayerFileName(tile common.Tile, layer Layer, ext Extension) string
- func MakeFatal(err error) error
- func MakeTemporary(err error) error
- func MergeErrors(priorityToError bool, err error, newErrs ...error) error
- func NewGeocubeClient(ctx context.Context, geocubeServer, apikey string, tlsConfig *tls.Config) (*geocube.Client, error)
- func Temporary(err error) bool
- func ToJSON(v interface{}, workingdir, filename string) error
- func UnmarshalGeometry(data []byte) (_ geom.Geometry, err error)
- type ErrFileNotFound
- type Extension
- type Layer
- type Storage
- type StorageStrategy
- func (ss *StorageStrategy) DeleteLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension) error
- func (ss *StorageStrategy) ImportLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension, ...) error
- func (ss *StorageStrategy) SaveLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension, ...) (string, error)
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBodyRetry ¶
GetBodyRetry: simple GET with N retry in case of temporary errors
func HTTPGetWithAuth ¶ added in v1.0.0
func HTTPPostWithAuth ¶ added in v1.0.0
func LayerFileName ¶
LayerFileName returns the name of the file given the tile, the layer and the extension
func MakeTemporary ¶
func MergeErrors ¶
MergeErrors, appending texts if priorityToErr is true, priority to the fatal error then to the temporary else, priority to no error, then to the temporary and finally to the fatal error.
func NewGeocubeClient ¶
func NewGeocubeClient(ctx context.Context, geocubeServer, apikey string, tlsConfig *tls.Config) (*geocube.Client, error)
NewGeocubeClient connects to the Geocube and returns a client
Types ¶
type ErrFileNotFound ¶
type ErrFileNotFound struct {
File string
}
ErrFileNotFound is an error returned by ImportLayer or DeleteLayer
func (ErrFileNotFound) Error ¶
func (e ErrFileNotFound) Error() string
type Layer ¶
type Layer string
Layer of an image
const ( Product Layer = "product" LayerPreprocessed Layer = "preprocessed" LayerCoregistrated Layer = "coregistred" LayerCoregExtract Layer = "coregextract" LayerCoherence Layer = "coherence" LayerBackscatterVV Layer = "sigma0_VV" LayerBackscatterVH Layer = "sigma0_VH" LayerCoherenceVV Layer = "coh_VV" LayerCoherenceVH Layer = "coh_VH" LayerPanchromatic Layer = "P" LayerMultiSpectral Layer = "MS" )
List of available layers
type Storage ¶
type Storage interface { // SaveLayer persists the layer into a storage and returns the uri SaveLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension, localdir string) (string, error) // ImportLayer imports the layer from the storage to the given localdir // Raise ErrFileNotFound ImportLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension, localdir string) error // DeleteLayer delete the layer from the storage // Raise ErrFileNotFound DeleteLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension) error }
Storage is a service to store and retrieve file from storage
type StorageStrategy ¶
type StorageStrategy struct {
// contains filtered or unexported fields
}
StorageStrategy implements Storage using geocube.Strategy
func NewStorageStrategy ¶
func NewStorageStrategy(ctx context.Context, storageURI string) (*StorageStrategy, error)
NewStorageStrategy creates a new StorageStrategy
func (*StorageStrategy) DeleteLayer ¶
func (ss *StorageStrategy) DeleteLayer(ctx context.Context, tile common.Tile, layer Layer, ext Extension) error
DeleteLayer implements Storage