Documentation ¶
Index ¶
- Constants
- func CompressionStrings() []string
- func DTypeStrings() []string
- func DatasetStatusStrings() []string
- func GDALURI(uri, subdir string) string
- func IsError(err error, code ErrorCode) bool
- func JobStateStrings() []string
- func JobStatusStrings() []string
- func JobTypeStrings() []string
- func MarshalConsolidationEvent(evt ConsolidationEvent) ([]byte, error)
- func MarshalEvent(evt Event) ([]byte, error)
- func NewDependencyStillExists(entity1, entity2, keyID, id, desc string, a ...interface{}) error
- func NewEntityAlreadyExists(entity, keyID, id, desc string, a ...interface{}) error
- func NewEntityNotFound(entity, keyID, id, desc string, a ...interface{}) error
- func NewShouldNeverHappen(desc string, a ...interface{}) error
- func NewUnhandledEvent(desc string, a ...interface{}) error
- func NewValidationError(desc string, a ...interface{}) error
- func ResamplingStrings() []string
- func StorageClassStrings() []string
- func TaskStateStrings() []string
- type AOI
- type Bitmap
- type Cell
- type Compression
- type ConsolidationContainer
- type ConsolidationDataset
- type ConsolidationEvent
- type ConsolidationParams
- func (p *ConsolidationParams) Clean()
- func (p *ConsolidationParams) Deleted()
- func (p ConsolidationParams) IsActive() bool
- func (p ConsolidationParams) IsClean() bool
- func (p ConsolidationParams) IsDeleted() bool
- func (p ConsolidationParams) IsDirty() bool
- func (p ConsolidationParams) IsNew() bool
- func (p ConsolidationParams) IsToDelete() bool
- func (c *ConsolidationParams) ToProtobuf() *pb.ConsolidationParams
- type ConsolidationRecord
- type Container
- func (c *Container) AddDataset(d *Dataset) error
- func (c *Container) Clean(all bool)
- func (c *Container) Delete() error
- func (p *Container) Deleted()
- func (p Container) IsActive() bool
- func (p Container) IsClean() bool
- func (p Container) IsDeleted() bool
- func (p Container) IsDirty() bool
- func (p Container) IsNew() bool
- func (p Container) IsToDelete() bool
- func (c *Container) RemoveDataset(datasetID string) (bool, error)
- func (c *Container) SetStorageClass(storageClass StorageClass) error
- type CustomGrid
- type CustomGridInitializer
- type DType
- func (i DType) IsADType() bool
- func (dtype DType) IsFloatingPointFormat() bool
- func (i DType) MarshalJSON() ([]byte, error)
- func (i *DType) Scan(value interface{}) error
- func (dtype DType) Size() int
- func (i DType) String() string
- func (dtype DType) ToGDAL() godal.DataType
- func (i *DType) UnmarshalJSON(data []byte) error
- func (i DType) Value() (driver.Value, error)
- type DataFormat
- type DataMapping
- type Dataset
- func (p *Dataset) Clean()
- func (p *Dataset) Deleted()
- func (d *Dataset) GDALURI() string
- func (p Dataset) IsActive() bool
- func (p Dataset) IsClean() bool
- func (p Dataset) IsDeleted() bool
- func (p Dataset) IsDirty() bool
- func (p Dataset) IsNew() bool
- func (p Dataset) IsToDelete() bool
- func (d *Dataset) SetDataType(dtype DType) error
- func (d *Dataset) SetOverviews(hasOverviews bool) error
- func (d *Dataset) SetShape(shape *geom.MultiPolygon, crsS string) error
- func (d *Dataset) ValidateWithVariable(v *Variable) error
- type DatasetStatus
- func (i DatasetStatus) IsADatasetStatus() bool
- func (i DatasetStatus) MarshalJSON() ([]byte, error)
- func (i *DatasetStatus) Scan(value interface{}) error
- func (i DatasetStatus) String() string
- func (i *DatasetStatus) UnmarshalJSON(data []byte) error
- func (i DatasetStatus) Value() (driver.Value, error)
- type ErrorCode
- type Event
- type ExecutionLevel
- type GeocubeError
- type Grid
- type Job
- func (j *Job) CancelTask(index int)
- func (j *Job) Clean(all bool)
- func (j *Job) ClearPersistedLogs()
- func (j *Job) CreateConsolidationTask(evt ConsolidationEvent) error
- func (j *Job) CreateDeletionTask(containerURI string) error
- func (j *Job) DeleteAllTasks()
- func (j *Job) DeleteTask(index int)
- func (p *Job) Deleted()
- func (p Job) IsActive() bool
- func (p Job) IsClean() bool
- func (p Job) IsDeleted() bool
- func (p Job) IsDirty() bool
- func (p Job) IsNew() bool
- func (p Job) IsToDelete() bool
- func (j *Job) LockDatasets(datasetsID []string, flag LockFlag)
- func (j *Job) LogErr(err string)
- func (j *Job) LogMsg(severity LogSeverity, msg string)
- func (j *Job) LogMsgf(severity LogSeverity, msg string, args ...interface{})
- func (j *Job) OCCTime() time.Time
- func (j *Job) ReleaseDatasets(flag LockFlag)
- func (j *Job) ResetTasks(states []TaskState)
- func (j *Job) SetParams(params ConsolidationParams) error
- func (j *Job) ToDelete(all bool) bool
- func (j *Job) ToProtobuf(offset int) (*pb.Job, error)
- func (j *Job) Trigger(evt JobEvent) error
- func (j *Job) UpdateTask(evt TaskEvent) error
- type JobEvent
- type JobLog
- type JobLogs
- type JobParams
- type JobPayload
- type JobState
- type JobStateInfo
- type JobStatus
- type JobType
- type Layout
- type LockFlag
- type LockedDatasets
- func (l *LockedDatasets) Clean()
- func (p *LockedDatasets) Deleted()
- func (p LockedDatasets) IsActive() bool
- func (p LockedDatasets) IsClean() bool
- func (p LockedDatasets) IsDeleted() bool
- func (p LockedDatasets) IsDirty() bool
- func (p LockedDatasets) IsNew() bool
- func (p LockedDatasets) IsToDelete() bool
- func (l LockedDatasets) NewIDs() []string
- type LogSeverity
- type Metadata
- type Palette
- func (p *Palette) Clean()
- func (p *Palette) Deleted()
- func (p Palette) IsActive() bool
- func (p Palette) IsClean() bool
- func (p Palette) IsDeleted() bool
- func (p Palette) IsDirty() bool
- func (p Palette) IsNew() bool
- func (p Palette) IsToDelete() bool
- func (p Palette) PaletteN(n int) color.Palette
- func (p Palette) Validate() error
- type Range
- type Record
- type Resampling
- func (i Resampling) IsAResampling() bool
- func (i Resampling) MarshalJSON() ([]byte, error)
- func (i *Resampling) Scan(value interface{}) error
- func (i Resampling) String() string
- func (r Resampling) ToGDAL() godal.ResamplingAlg
- func (i *Resampling) UnmarshalJSON(data []byte) error
- func (i Resampling) Value() (driver.Value, error)
- type StorageClass
- type StreamedCell
- type Task
- func (p *Task) Clean()
- func (t *Task) ConsolidationOutput() (*ConsolidationContainer, []ConsolidationRecord, error)
- func (p *Task) Deleted()
- func (t *Task) DeletionPayload() (string, error)
- func (p Task) IsActive() bool
- func (p Task) IsClean() bool
- func (p Task) IsDeleted() bool
- func (p Task) IsDirty() bool
- func (p Task) IsNew() bool
- func (p Task) IsToDelete() bool
- type TaskEvent
- type TaskState
- type TaskStatus
- type URN
- type Variable
- func (v *Variable) AddInstance(vi *VariableInstance) error
- func (v *Variable) CheckInstanceExists(instanceID string) error
- func (v *Variable) Clean(all bool)
- func (p *Variable) Deleted()
- func (p Variable) IsActive() bool
- func (p Variable) IsClean() bool
- func (p Variable) IsDeleted() bool
- func (p Variable) IsDirty() bool
- func (p Variable) IsNew() bool
- func (p Variable) IsToDelete() bool
- func (v *Variable) SetConsolidationParams(params ConsolidationParams) error
- func (v *Variable) ToDelete(instanceID string)
- func (v *Variable) ToProtobuf() *pb.Variable
- func (v *Variable) Update(name, unit, description, palette *string, resampling *Resampling) error
- func (v *Variable) UpdateInstance(instanceID string, name *string, newMetadata map[string]string, ...) error
- type VariableInstance
- func (p *VariableInstance) Clean()
- func (p *VariableInstance) Deleted()
- func (p VariableInstance) IsActive() bool
- func (p VariableInstance) IsClean() bool
- func (p VariableInstance) IsDeleted() bool
- func (p VariableInstance) IsDirty() bool
- func (p VariableInstance) IsNew() bool
- func (p VariableInstance) IsToDelete() bool
Constants ¶
const ( NO_OVERVIEW = 0 OVERVIEWS_DEFAULT_MIN_SIZE = -1 )
const ( DetailNotFoundEntity = 0 DetailNotFoundKeyID = 1 DetailNotFoundID = 2 DetailAlreadyExistsEntity = 0 DetailAlreadyExistsKeyID = 1 DetailAlreadyExistsID = 2 DetailDependencyStillExistsEntity1 = 0 DetailDependencyStillExistsEntity2 = 1 DetailDependencyStillExistsKeyID = 2 DetailDependencyStillExistsID = 3 )
Access details
Variables ¶
This section is empty.
Functions ¶
func CompressionStrings ¶ added in v0.5.1
func CompressionStrings() []string
CompressionStrings returns a slice of all String values of the enum
func DTypeStrings ¶ added in v0.5.1
func DTypeStrings() []string
DTypeStrings returns a slice of all String values of the enum
func DatasetStatusStrings ¶ added in v0.5.1
func DatasetStatusStrings() []string
DatasetStatusStrings returns a slice of all String values of the enum
func JobStateStrings ¶ added in v0.5.1
func JobStateStrings() []string
JobStateStrings returns a slice of all String values of the enum
func JobStatusStrings ¶ added in v0.5.1
func JobStatusStrings() []string
JobStatusStrings returns a slice of all String values of the enum
func JobTypeStrings ¶ added in v0.5.1
func JobTypeStrings() []string
JobTypeStrings returns a slice of all String values of the enum
func MarshalConsolidationEvent ¶
func MarshalConsolidationEvent(evt ConsolidationEvent) ([]byte, error)
MarshalConsolidationEvent is used to send a ConsolidationEvent over pubsub
func MarshalEvent ¶
MarshalEvent returns bytes representation of a job-related event
func NewDependencyStillExists ¶
NewDependencyStillExists creates a new error stating that a dependency between entity still exists and prevents deletion
func NewEntityAlreadyExists ¶
NewEntityAlreadyExists creates a new error stating that an entity already exists
func NewEntityNotFound ¶
NewEntityNotFound creates a new error stating that an entity has not been found
func NewShouldNeverHappen ¶
NewShouldNeverHappen creates a new error that should never happen...
func NewUnhandledEvent ¶
NewUnhandledEvent creates a new error stating that an event cannot be handled
func NewValidationError ¶
NewValidationError creates a new validation error
func ResamplingStrings ¶ added in v0.5.1
func ResamplingStrings() []string
ResamplingStrings returns a slice of all String values of the enum
func StorageClassStrings ¶ added in v0.5.1
func StorageClassStrings() []string
StorageClassStrings returns a slice of all String values of the enum
func TaskStateStrings ¶ added in v0.5.1
func TaskStateStrings() []string
TaskStateStrings returns a slice of all String values of the enum
Types ¶
type AOI ¶
type AOI struct { ID string Geometry *wkb.MultiPolygon // contains filtered or unexported fields }
An AOI is by definition in *planar geometry* with *CRS 4326* (lonlat).
func NewAOIFromMultiPolygon ¶ added in v0.3.0
NewAOIFromMultiPolygon creates an AOI from a multi polygon Only returns ValidationError
func NewAOIFromProtobuf ¶
NewAOIFromProtobuf creates an AOI from protobuf Only returns ValidationError
func (*AOI) HashGeometry ¶
HashGeometry computes and returns a hash version of the geometry The hashing is computed only once, hence the geometry must not be changed.
func (*AOI) ToProtobuf ¶
ToProtobuf converts an aoi to the protobuf. Could be optimized using flat_coordinates
type Bitmap ¶
type Bitmap struct { // Bytes is the []byte representation of the image Bytes []byte // Bands is the number of interlaced bands Bands int // Rect is the image's bounds. Rect image.Rectangle // Datatype of the pixel DType DType // For conversion between dtype and byte ByteOrder binary.ByteOrder }
Bitmap decribes any image as a bitmap of bytes
func NewBitmapFromDataset ¶
NewBitmapFromDataset creates a new bitmap from the dataset, copying the memory
func NewBitmapHeader ¶
NewBitmapHeader creates a new empty image (pixels are not allocated)
type Cell ¶ added in v0.3.0
type Cell struct { ID string CRS string SRID int // Retrieved from CRS (not always possible) Coordinates proj.GeographicRing }
type Compression ¶
type Compression int32
Compression defines how the data is compressed in the file
const ( CompressionNO Compression = iota CompressionLOSSLESS CompressionLOSSY )
Supported compression
func CompressionString ¶
func CompressionString(s string) (Compression, error)
CompressionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func CompressionValues ¶
func CompressionValues() []Compression
CompressionValues returns all values of the enum
func (Compression) IsACompression ¶
func (i Compression) IsACompression() bool
IsACompression returns "true" if the value is listed in the enum definition. "false" otherwise
func (Compression) MarshalJSON ¶
func (i Compression) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for Compression
func (*Compression) Scan ¶
func (i *Compression) Scan(value interface{}) error
func (Compression) String ¶
func (i Compression) String() string
func (*Compression) UnmarshalJSON ¶
func (i *Compression) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for Compression
type ConsolidationContainer ¶
type ConsolidationContainer struct { URI string // "gs://bucket/mucog/random_name.TIF" DatasetFormat DataMapping CRS string // "+init=epsg:XXXX" or WKT Transform [6]float64 // [x0, 10, 0, y_0, 0, -10] Pixels of the image to coordinates in the CRS Width, Height int // 4096, 4096 Cutline string // POLYGON(coords) BandsCount int // 3 BlockXSize int // 256 BlockYSize int // 256 InterlacingPattern string // L=0>T>I>P;I>L=1:>T>P (see github.com/airbusgeo/mucog) OverviewsMinSize int // Maximum width or height of the smallest overview level. 0=NO_OVERVIEW, -1=OVERVIEWS_DEFAULT_MIN_SIZE (=256) ResamplingAlg Resampling // "bilinear" OvrResamplingAlg Resampling // "regular" Compression Compression // "NO", "LOSSLESS", "LOSSY" StorageClass StorageClass // "COLDLINE" }
ConsolidationContainer contains all the information to create the output of the consolidation
func NewConsolidationContainer ¶
func NewConsolidationContainer(URI string, variable *Variable, params *ConsolidationParams, layout *Layout, cell *grid.Cell) (*ConsolidationContainer, error)
NewConsolidationContainer initializes a new ConsolidationContainer
type ConsolidationDataset ¶
type ConsolidationDataset struct { URI string // "gs://...." Subdir string // "GTIFF_DIR:1" Bands []int64 // [1, 2, 3] Overviews bool // true (in case of reconsolidation, do not regenerate overviews if already exist) DatasetFormat DataMapping }
ConsolidationDataset contains all the information on a dataset to consolidate it
func NewConsolidationDataset ¶
func NewConsolidationDataset(d *Dataset) *ConsolidationDataset
NewConsolidationDataset initializes a new ConsolidationDataset
func (*ConsolidationDataset) InGroupOfContainers ¶
func (d *ConsolidationDataset) InGroupOfContainers(c *ConsolidationContainer) bool
InGroupOfContainers returns true if the dataset is in the group of containers with the base name
func (*ConsolidationDataset) NeedsReconsolidation ¶
func (d *ConsolidationDataset) NeedsReconsolidation(c *ConsolidationContainer) bool
NeedsReconsolidation returns true if the dataset must be reconsolidated Cannot check whether the compression, resampling_alg
type ConsolidationEvent ¶
type ConsolidationEvent struct { JobID string TaskID string Records []ConsolidationRecord Container ConsolidationContainer }
ConsolidationEvent is an event sent to the consolidater to start a consolidation task
func UnmarshalConsolidationEvent ¶
func UnmarshalConsolidationEvent(r io.Reader) (*ConsolidationEvent, error)
UnmarshalConsolidationEvent is used to retrieve a ConsolidationEvent from pubsub
type ConsolidationParams ¶
type ConsolidationParams struct { DFormat DataFormat Exponent float64 Compression Compression ResamplingAlg Resampling StorageClass StorageClass // contains filtered or unexported fields }
ConsolidationParams defines the parameters for the consolidation
func NewConsolidationParamsFromProtobuf ¶
func NewConsolidationParamsFromProtobuf(pbp *pb.ConsolidationParams) (*ConsolidationParams, error)
NewConsolidationParamsFromProtobuf creates a consolidation params from protobuf Only returns validationError
func (*ConsolidationParams) Clean ¶
func (p *ConsolidationParams) Clean()
Clean sets the status Clean (everything has been persisted)
func (*ConsolidationParams) Deleted ¶
func (p *ConsolidationParams) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (ConsolidationParams) IsActive ¶
func (p ConsolidationParams) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (ConsolidationParams) IsClean ¶
func (p ConsolidationParams) IsClean() bool
IsClean tests whether everything has been persisted
func (ConsolidationParams) IsDeleted ¶
func (p ConsolidationParams) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (ConsolidationParams) IsDirty ¶
func (p ConsolidationParams) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (ConsolidationParams) IsNew ¶
func (p ConsolidationParams) IsNew() bool
IsNew tests whether the entity has never been persisted
func (ConsolidationParams) IsToDelete ¶
func (p ConsolidationParams) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (*ConsolidationParams) ToProtobuf ¶
func (c *ConsolidationParams) ToProtobuf() *pb.ConsolidationParams
ToProtobuf converts a consolidationParams to protobuf
type ConsolidationRecord ¶
type ConsolidationRecord struct { ID string DateTime string //"2018-01-01 12:00:00" Datasets []ConsolidationDataset ValidShape *proj.Shape }
ConsolidationRecord contains the date and the list of datasets to consolidate
type Container ¶
type Container struct { ID int URI string Managed bool StorageClass StorageClass Datasets []*Dataset // contains filtered or unexported fields }
func NewContainerFromConsolidation ¶
func NewContainerFromConsolidation(oc *ConsolidationContainer) (*Container, error)
NewContainerFromConsolidation creates a new container from the output of a consolidation task Only returns ValidationError
func NewContainerFromProtobuf ¶
NewContainerFromProtobuf creates a new container from protobuf Only returns validationError
func (*Container) AddDataset ¶
AddDataset to a container If the dataset already exists and is exactly the same, no errors are returned Only returns EntityAlreadyExists
func (*Container) Clean ¶
Clean set the status Clean to the container and (if "all") all its datasets
func (*Container) Delete ¶
Delete set the status Delete to the container iif it is not managed and all the datasets are inactive
func (*Container) Deleted ¶
func (p *Container) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Container) IsActive ¶
func (p Container) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Container) IsClean ¶
func (p Container) IsClean() bool
IsClean tests whether everything has been persisted
func (Container) IsDeleted ¶
func (p Container) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Container) IsDirty ¶
func (p Container) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Container) IsNew ¶
func (p Container) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Container) IsToDelete ¶
func (p Container) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (*Container) RemoveDataset ¶
RemoveDataset from a container Returns true if the container is empty Only returns EntityNotFound
func (*Container) SetStorageClass ¶
func (c *Container) SetStorageClass(storageClass StorageClass) error
SetStorageClass of the container. It is only possible when the container is new.
type CustomGrid ¶ added in v0.3.0
type CustomGrid struct { Name string Flags []string Parameters map[string]string // contains filtered or unexported fields }
CustomGrid is a grid where each cell is defined either by Parameters["subgrid"] or by Parameters["resolution"]
func (*CustomGrid) Cell ¶ added in v0.3.0
func (cg *CustomGrid) Cell(uri string) (*gridlib.Cell, error)
Cell implements gridlib.Grid and returns a Cell with the provided URI (format : CellID/subGridID))
func (*CustomGrid) Covers ¶ added in v0.3.0
func (cg *CustomGrid) Covers(ctx context.Context, geomAOI *geom.MultiPolygon) (<-chan gridlib.StreamedURI, error)
Covers implements gridlib.Grid
type CustomGridInitializer ¶ added in v0.3.0
type DType ¶
type DType int
DType is one of supported DataTypes for raster
const ( DTypeUNDEFINED DType = iota // reserved for bool DTypeUINT8 DTypeUINT16 DTypeUINT32 DTypeINT8 DTypeINT16 DTypeINT32 DTypeFLOAT32 DTypeFLOAT64 DTypeCOMPLEX64 )
Supported DataTypes
func DTypeFromGDal ¶
DTypeFromGDal convert gdal.DataType to DType
func DTypeFromString ¶
DTypeFromString convert string dtype to DType
func DTypeString ¶
DTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (DType) IsADType ¶
IsADType returns "true" if the value is listed in the enum definition. "false" otherwise
func (DType) IsFloatingPointFormat ¶
func (DType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for DType
func (*DType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for DType
type DataFormat ¶
DataFormat describes the internal format of a raster
func NewDataFormatFromProtobuf ¶
func NewDataFormatFromProtobuf(pbdf *pb.DataFormat) *DataFormat
func (DataFormat) Equals ¶
func (df DataFormat) Equals(df2 DataFormat) bool
func (DataFormat) NoDataDefined ¶
func (df DataFormat) NoDataDefined() bool
NoDataDefined returns True if the user has defined a NoData value. When NoData is not defined, its value is NaN, whatever the DataType
func (DataFormat) ToProtobuf ¶ added in v0.3.0
func (df DataFormat) ToProtobuf() *pb.DataFormat
type DataMapping ¶
type DataMapping struct { DataFormat RangeExt Range // External range maps to Internal range Exponent float64 // For non-linear mapping from RangeInt to RangeExt }
DataMapping describes the mapping between an internal format and a external range vi in [Range.Min, Range.Max], ve in [RangeExt.Min, RangeExt.Max] are linked as follows: ve = RangeExt.Min + (RangeExt.Max - RangeExt.Min) * ((vi - Range.Min)/(Range.Max - Range.Min))^Exponent
func (DataMapping) Equals ¶
func (dm DataMapping) Equals(dm2 DataMapping) bool
type Dataset ¶
type Dataset struct { ID string RecordID string InstanceID string ContainerURI string ContainerSubDir string Bands []int64 DataMapping DataMapping Status DatasetStatus Shape proj.Shape ///< Valid shape in the crs of the dataset (may be smaller than the extent when there is nodata) GeogShape proj.GeographicShape ///< Approximation of the valid shape in geographic coordinates GeomShape proj.GeometricShape ///< Approximation of the valid shape in 4326 coordinates Overviews bool // contains filtered or unexported fields }
func IncompleteDatasetFromConsolidation ¶
func IncompleteDatasetFromConsolidation(c *ConsolidationContainer, instanceID string) (*Dataset, error)
IncompleteDatasetFromConsolidation returns a dataset partially initialized from the ConsolidationContainer of a consolidation task Only returns validationError
func NewDatasetFromIncomplete ¶
func NewDatasetFromIncomplete(d Dataset, consolidationRecord ConsolidationRecord, subdir string) (*Dataset, error)
NewDatasetFromIncomplete creates a new dataset from dataset created by NewIncompleteDatasetFromConsolidation Only returns ValidationError
func NewDatasetFromProtobuf ¶
NewDatasetFromProtobuf creates a new dataset from protobuf Only returns validationError
func (*Dataset) Clean ¶
func (p *Dataset) Clean()
Clean sets the status Clean (everything has been persisted)
func (*Dataset) Deleted ¶
func (p *Dataset) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Dataset) IsActive ¶
func (p Dataset) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Dataset) IsClean ¶
func (p Dataset) IsClean() bool
IsClean tests whether everything has been persisted
func (Dataset) IsDeleted ¶
func (p Dataset) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Dataset) IsDirty ¶
func (p Dataset) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Dataset) IsNew ¶
func (p Dataset) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Dataset) IsToDelete ¶
func (p Dataset) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (*Dataset) SetDataType ¶
SetDataType sets the datatype flag of a new dataset
func (*Dataset) SetOverviews ¶
SetOverviews sets the overviews flag of a new dataset
func (*Dataset) SetShape ¶
SetShape sets the shape in a given CRS and bounding boxes of a new dataset
func (*Dataset) ValidateWithVariable ¶
ValidateWithVariable validates the instance using the full definition of the variable Only returns ValidationError
type DatasetStatus ¶
type DatasetStatus int
const ( DatasetStatusACTIVE DatasetStatus = iota DatasetStatusTODELETE DatasetStatusINACTIVE )
func DatasetStatusString ¶
func DatasetStatusString(s string) (DatasetStatus, error)
DatasetStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func DatasetStatusValues ¶
func DatasetStatusValues() []DatasetStatus
DatasetStatusValues returns all values of the enum
func (DatasetStatus) IsADatasetStatus ¶
func (i DatasetStatus) IsADatasetStatus() bool
IsADatasetStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (DatasetStatus) MarshalJSON ¶
func (i DatasetStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for DatasetStatus
func (*DatasetStatus) Scan ¶
func (i *DatasetStatus) Scan(value interface{}) error
func (DatasetStatus) String ¶
func (i DatasetStatus) String() string
func (*DatasetStatus) UnmarshalJSON ¶
func (i *DatasetStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for DatasetStatus
type ExecutionLevel ¶ added in v0.3.0
type ExecutionLevel int32
const ( ExecutionSynchronous ExecutionLevel = iota // Job is done synchronously ExecutionAsynchronous // Job is done asynchronously, but without any pause StepByStepCritical // Job is done asynchronously, step-by-step, pausing at every critical steps StepByStepMajor // Job is done asynchronously, step-by-step, pausing at every major steps StepByStepAll // Job is done asynchronously, step-by-step, pausing at every steps StepByStepNever // For a JobState to never be paused )
ExecutionLevel
type GeocubeError ¶
type GeocubeError struct {
// contains filtered or unexported fields
}
func AsError ¶
func AsError(err error, code ErrorCode) (GeocubeError, bool)
AsError tests whether error is a GeocubeError and returns it
func (GeocubeError) Code ¶
func (e GeocubeError) Code() ErrorCode
Code returns the code of the error
func (GeocubeError) Desc ¶
func (e GeocubeError) Desc() string
Desc returns a description of the error
func (GeocubeError) Detail ¶
func (e GeocubeError) Detail(i int) string
Detail returns a detail of the error (see const above)
type Grid ¶ added in v0.3.0
func NewGridFromProtobuf ¶ added in v0.3.0
NewGridFromProtobuf creates a grid from protobuf and validates it Only returns validationError
func (*Grid) ToProtobuf ¶ added in v0.3.0
ToProtobuf converts a consolidationParams to protobuf
type Job ¶
type Job struct { State JobState ID string Name string Type JobType CreationTime time.Time LastUpdateTime time.Time Payload JobPayload Logs JobLogs LogsCount int NewLogs JobLogs // logs that are not yet persisted in bdd ActiveTasks int FailedTasks int ExecutionLevel ExecutionLevel Waiting bool // These following fields may not be loaded Tasks []*Task Params JobParams LockedDatasets [int32(LockFlagNB)]LockedDatasets // contains filtered or unexported fields }
func NewConsolidationJob ¶
func NewConsolidationJob(jobName, layout, instanceID string, executionLevel ExecutionLevel) (*Job, error)
NewConsolidationJob creates a new consolidation Job
func NewDeletionJob ¶ added in v0.3.0
func NewDeletionJob(jobName string, executionLevel ExecutionLevel) *Job
NewDeletionJob creates a new Job to delete datasets and containers
func (*Job) CancelTask ¶
CancelTask sets the cancel state to the task with the given index
func (*Job) Clean ¶
Clean overrides persistentState.Clean and set the status Clean to the job "all" also sets the status to the locked datasets and all its tasks
func (*Job) ClearPersistedLogs ¶ added in v0.6.0
func (j *Job) ClearPersistedLogs()
func (*Job) CreateConsolidationTask ¶
func (j *Job) CreateConsolidationTask(evt ConsolidationEvent) error
CreateConsolidationTask adds a new consolidation task with the event provided
func (*Job) CreateDeletionTask ¶ added in v0.3.0
CreateDeletionTask adds a new deletion task with the container uri provided
func (*Job) DeleteAllTasks ¶
func (j *Job) DeleteAllTasks()
DeleteAllTasks set the status ToDelete to all the tasks
func (*Job) DeleteTask ¶
DeleteTask set the status ToDelete to one task
func (*Job) Deleted ¶
func (p *Job) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Job) IsActive ¶
func (p Job) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Job) IsClean ¶
func (p Job) IsClean() bool
IsClean tests whether everything has been persisted
func (Job) IsDeleted ¶
func (p Job) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Job) IsDirty ¶
func (p Job) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Job) IsNew ¶
func (p Job) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Job) IsToDelete ¶
func (p Job) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (*Job) LockDatasets ¶
LockDatasets set the status New to the lock of the datasets (flag = LockFlagINIT/LockFlagTODELETE/LockFlagNEW) and adds the datasets
func (*Job) LogMsg ¶ added in v0.3.0
func (j *Job) LogMsg(severity LogSeverity, msg string)
LogMsg updates and append the log status of Job
func (*Job) LogMsgf ¶ added in v0.3.0
func (j *Job) LogMsgf(severity LogSeverity, msg string, args ...interface{})
LogMsgf updates and append the log status of Job
func (*Job) ReleaseDatasets ¶
ReleaseDatasets set the status ToDelete to the lock of the datasets (any flags)
func (*Job) ResetTasks ¶ added in v0.6.0
ResetTasks sets the pending state to all the tasks and the job status
func (*Job) SetParams ¶ added in v0.3.0
func (j *Job) SetParams(params ConsolidationParams) error
func (*Job) ToDelete ¶
ToDelete sets the status ToDelete to the job iif tasks are also ToDelete or empty If all, also delete tasks Return success
func (*Job) ToProtobuf ¶
ToProtobuf converts a job to protobuf
func (*Job) Trigger ¶
Trigger handles the event and change the state of the job Only returns UnhandledEvent
func (*Job) UpdateTask ¶
UpdateTask updates the status of the task depending on the event The task must exists and in pending state
type JobEvent ¶
JobEvent is the event sent during the job when one of the job steps is finished JobEvent implements Event
type JobLog ¶ added in v0.3.0
type JobLog struct { Severity LogSeverity `json:"severity,omitempty"` Msg string `json:"message,omitempty"` Status string `json:"status,omitempty"` Date time.Time `json:"time,omitempty"` }
type JobLogs ¶ added in v0.3.0
type JobLogs []JobLog
type JobPayload ¶
type JobPayload struct { Layout string `json:"layout,omitempty"` InstanceID string `json:"instance_id,omitempty"` ParamsID string `json:"params_id,omitempty"` }
JobPayload contains all the information to process a job
func (*JobPayload) Scan ¶
func (jp *JobPayload) Scan(value interface{}) error
Scan implements the sql.Scanner interface for a jobPayload. This method simply decodes a JSON-encoded value into the struct fields.
type JobState ¶
type JobState int32
const ( JobStateNEW JobState = iota JobStateCREATED JobStateCONSOLIDATIONINPROGRESS JobStateCONSOLIDATIONDONE JobStateCONSOLIDATIONINDEXED JobStateCONSOLIDATIONEFFECTIVE JobStateCONSOLIDATIONFAILED JobStateCONSOLIDATIONRETRYING JobStateCONSOLIDATIONFORCERETRYING JobStateCONSOLIDATIONCANCELLING JobStateDELETIONINPROGRESS JobStateDELETIONEFFECTIVE JobStateDELETIONFAILED JobStateDONE JobStateFAILED JobStateINITIALISATIONFAILED JobStateCANCELLATIONFAILED JobStateABORTED JobStateROLLBACKFAILED JobStateDONEBUTUNTIDY )
func JobStateString ¶
JobStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func JobStateValues ¶
func JobStateValues() []JobState
JobStateValues returns all values of the enum
func (JobState) IsAJobState ¶
IsAJobState returns "true" if the value is listed in the enum definition. "false" otherwise
func (JobState) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for JobState
func (*JobState) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for JobState
type JobStateInfo ¶ added in v0.3.0
type JobStateInfo struct { Level ExecutionLevel RetryForced bool // if event = RetryForced, retry the current state (other behaviors can be defined in the trigger...() functions ) }
type JobStatus ¶
type JobStatus int32
JobStatus defines an event emitted when a step of a job is finished
const ( JobCreated JobStatus = iota OrdersPrepared PrepareOrdersFailed SendOrdersFailed ConsolidationDone ConsolidationFailed ConsolidationRetryFailed ConsolidationIndexed ConsolidationIndexingFailed DatasetsSwapped SwapDatasetsFailed DeletionStarted StartDeletionFailed DeletionReady DeletionNotReady RemovalDone DeletionDone RemovalFailed DeletionFailed CancelledByUser CancelledByUserForced CancellationFailed CancellationDone RollbackFailed RollbackDone Retried RetryForced Continue )
Possible status of a finished step
func JobStatusString ¶ added in v0.3.0
JobStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func JobStatusValues ¶ added in v0.3.0
func JobStatusValues() []JobStatus
JobStatusValues returns all values of the enum
func (JobStatus) IsAJobStatus ¶ added in v0.3.0
IsAJobStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (JobStatus) MarshalJSON ¶ added in v0.3.0
MarshalJSON implements the json.Marshaler interface for JobStatus
func (*JobStatus) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON implements the json.Unmarshaler interface for JobStatus
type JobType ¶
type JobType int32
func JobTypeString ¶
JobTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (JobType) IsAJobType ¶
IsAJobType returns "true" if the value is listed in the enum definition. "false" otherwise
func (JobType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for JobType
func (*JobType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for JobType
type Layout ¶
type Layout struct { Name string // External layout: Grid:Cell (CRS) GridFlags []string GridParameters Metadata // Internal layout: Cell, tile BlockXSize, BlockYSize int MaxRecords int OverviewsMinSize int InterlacingPattern string // contains filtered or unexported fields }
func NewLayoutFromProtobuf ¶
NewLayoutFromProtobuf creates a layout from protobuf and validates it Only returns validationError if ignoreName=True, do not validate Name
func (*Layout) Covers ¶
func (l *Layout) Covers(ctx context.Context, aoi *geom.MultiPolygon, removeDuplicate bool) (<-chan StreamedCell, error)
Covers returns all the cells of the layout covered by the AOI
func (*Layout) InitGrid ¶ added in v0.3.0
func (l *Layout) InitGrid(ctx context.Context, initializer CustomGridInitializer) error
InitGrid if necessary
func (*Layout) MucogInterlacingPattern ¶ added in v0.6.0
MucogInterlacingPattern replaces [R]ecord by [I]mage, [B]and by [P]lane and [Z]oom by [L]evel (see github.com/airbusgeo/mucog)
func (*Layout) ToProtobuf ¶
ToProtobuf converts a layout to protobuf
type LockedDatasets ¶
type LockedDatasets struct {
// contains filtered or unexported fields
}
func (*LockedDatasets) Clean ¶
func (l *LockedDatasets) Clean()
Clean overrides persistenceState.Clean()
func (*LockedDatasets) Deleted ¶
func (p *LockedDatasets) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (LockedDatasets) IsActive ¶
func (p LockedDatasets) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (LockedDatasets) IsClean ¶
func (p LockedDatasets) IsClean() bool
IsClean tests whether everything has been persisted
func (LockedDatasets) IsDeleted ¶
func (p LockedDatasets) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (LockedDatasets) IsDirty ¶
func (p LockedDatasets) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (LockedDatasets) IsNew ¶
func (p LockedDatasets) IsNew() bool
IsNew tests whether the entity has never been persisted
func (LockedDatasets) IsToDelete ¶
func (p LockedDatasets) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (LockedDatasets) NewIDs ¶
func (l LockedDatasets) NewIDs() []string
NewIDs returns the ID of the datasets to be locked Only the new ids are available (those who are already locked are not available)
type LogSeverity ¶ added in v0.3.0
type LogSeverity string
const ( DEBUG LogSeverity = "DEBUG" INFO LogSeverity = "INFO" WARN LogSeverity = "WARN" ERROR LogSeverity = "ERROR" )
type Metadata ¶
Metadata adds information to the entity
type Palette ¶
type Palette struct { Name string Points []colorPoint // contains filtered or unexported fields }
Palette is a mapping between [0, 1] to RGBA color
func NewPaletteFromPb ¶
NewPaletteFromPb creates a new palette from pb Returns ValidationError
func (*Palette) Clean ¶
func (p *Palette) Clean()
Clean sets the status Clean (everything has been persisted)
func (*Palette) Deleted ¶
func (p *Palette) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Palette) IsActive ¶
func (p Palette) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Palette) IsClean ¶
func (p Palette) IsClean() bool
IsClean tests whether everything has been persisted
func (Palette) IsDeleted ¶
func (p Palette) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Palette) IsDirty ¶
func (p Palette) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Palette) IsNew ¶
func (p Palette) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Palette) IsToDelete ¶
func (p Palette) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
type Record ¶
type Record struct { ID string Name URN Time time.Time Tags Metadata AOI AOI // contains filtered or unexported fields }
func NewRecordFromProtobuf ¶
NewRecordFromProtobuf creates a new record from protobuf and validates it Only returns ValidationError
func RecordFromProtobuf ¶ added in v0.4.0
RecordFromProtobuf creates a new record from protobuf and validates it Only returns ValidationError
func (*Record) Clean ¶
func (p *Record) Clean()
Clean sets the status Clean (everything has been persisted)
func (*Record) Deleted ¶
func (p *Record) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Record) IsActive ¶
func (p Record) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Record) IsClean ¶
func (p Record) IsClean() bool
IsClean tests whether everything has been persisted
func (Record) IsDeleted ¶
func (p Record) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Record) IsDirty ¶
func (p Record) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Record) IsNew ¶
func (p Record) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Record) IsToDelete ¶
func (p Record) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
type Resampling ¶
type Resampling int32
Resampling defines how the raster is resampled when its size has to be changed
const ( ResamplingNEAR Resampling ResamplingBILINEAR ResamplingCUBIC ResamplingCUBICSPLINE ResamplingLANCZOS ResamplingAVERAGE ResamplingMODE ResamplingMAX ResamplingMIN ResamplingMED ResamplingQ1 ResamplingQ3 )
Supported values for resampling (gdal resampling methods)
func ResamplingString ¶
func ResamplingString(s string) (Resampling, error)
ResamplingString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ResamplingValues ¶
func ResamplingValues() []Resampling
ResamplingValues returns all values of the enum
func (Resampling) IsAResampling ¶
func (i Resampling) IsAResampling() bool
IsAResampling returns "true" if the value is listed in the enum definition. "false" otherwise
func (Resampling) MarshalJSON ¶
func (i Resampling) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for Resampling
func (*Resampling) Scan ¶
func (i *Resampling) Scan(value interface{}) error
func (Resampling) String ¶
func (i Resampling) String() string
func (Resampling) ToGDAL ¶
func (r Resampling) ToGDAL() godal.ResamplingAlg
func (*Resampling) UnmarshalJSON ¶
func (i *Resampling) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for Resampling
type StorageClass ¶
type StorageClass int
const ( StorageClassSTANDARD StorageClass = iota StorageClassINFREQUENT StorageClassARCHIVE StorageClassDEEPARCHIVE StorageClassUNDEFINED )
func StorageClassString ¶
func StorageClassString(s string) (StorageClass, error)
StorageClassString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func StorageClassValues ¶
func StorageClassValues() []StorageClass
StorageClassValues returns all values of the enum
func ToGcStorageClass ¶
func ToGcStorageClass(s string) (StorageClass, error)
ToGcStorageClass returns the geocube storage class equivalent
func ToStorageClass ¶
func ToStorageClass(s string) (StorageClass, error)
ToStorageClass returns the geocube sorage class equivalent
func (StorageClass) IsAStorageClass ¶
func (i StorageClass) IsAStorageClass() bool
IsAStorageClass returns "true" if the value is listed in the enum definition. "false" otherwise
func (StorageClass) MarshalJSON ¶
func (i StorageClass) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for StorageClass
func (*StorageClass) Scan ¶
func (i *StorageClass) Scan(value interface{}) error
func (StorageClass) String ¶
func (i StorageClass) String() string
func (*StorageClass) UnmarshalJSON ¶
func (i *StorageClass) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for StorageClass
type StreamedCell ¶ added in v0.3.0
type Task ¶
type Task struct { ID string State TaskState Payload []byte // contains filtered or unexported fields }
func (*Task) Clean ¶
func (p *Task) Clean()
Clean sets the status Clean (everything has been persisted)
func (*Task) ConsolidationOutput ¶
func (t *Task) ConsolidationOutput() (*ConsolidationContainer, []ConsolidationRecord, error)
ConsolidationOutput retrieves the output of the consolidation payload
func (*Task) Deleted ¶
func (p *Task) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (*Task) DeletionPayload ¶ added in v0.3.0
DeletionPayload retrieves the deletion payload
func (Task) IsActive ¶
func (p Task) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Task) IsClean ¶
func (p Task) IsClean() bool
IsClean tests whether everything has been persisted
func (Task) IsDeleted ¶
func (p Task) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Task) IsDirty ¶
func (p Task) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Task) IsNew ¶
func (p Task) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Task) IsToDelete ¶
func (p Task) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
type TaskEvent ¶
type TaskEvent struct { JobID string TaskID string Status TaskStatus Error string }
TaskEvent is the event sent from the consolidater when a consolidation task is finished TaskEvent implements Event
func NewTaskEvent ¶
func NewTaskEvent(jobID, taskID string, eventStatus TaskStatus, err error) *TaskEvent
NewTaskEvent returns a new task event
type TaskState ¶
type TaskState int32
const ( // TaskStateFAILED when the execution encountered an error TaskStateFAILED TaskState = iota // TaskStateCANCELLED when the task is cancelled by the server or there is no operation to perform (consolidation task: no container is created) TaskStateCANCELLED // TaskStateDONE when the task is finished and successful TaskStateDONE // TaskStatePENDING when the task is in progress TaskStatePENDING // TaskStateNEW when the task is created and waiting for being sent TaskStateNEW )
func TaskStateString ¶
TaskStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func TaskStateValues ¶
func TaskStateValues() []TaskState
TaskStateValues returns all values of the enum
func (TaskState) IsATaskState ¶
IsATaskState returns "true" if the value is listed in the enum definition. "false" otherwise
func (TaskState) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for TaskState
func (*TaskState) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for TaskState
type TaskStatus ¶
type TaskStatus int32
TaskStatus is the status of a finished task
const ( TaskSuccessful TaskStatus = iota TaskFailed // TaskIgnored if there is nothing to perform TaskIgnored // TaskCancelled if the task has been cancelled externally (nothing has been done) TaskCancelled // TaskSent TaskSent )
Possible status of a finished task
func (TaskStatus) String ¶
func (ts TaskStatus) String() string
type URN ¶
type URN string
URN (Unique Ressource Name) for Record, VariableDefinition, Palette... format: Seg1/Seg2/... (allowing special caracters: "-:_")
type Variable ¶
type Variable struct { ID string Name string Instances map[string]*VariableInstance Unit string // Description [mutable] Description string // Storage [immutable] Bands []string DFormat DataFormat // Views [mutable] Palette string // Default resampling algorithm [mutable] Resampling Resampling // Consolidation parameters ConsolidationParams ConsolidationParams // contains filtered or unexported fields }
Variable described data
func NewVariableFromProtobuf ¶
NewVariableFromProtobuf creates a variable from protobuf and validates it Only returns validationError
func (*Variable) AddInstance ¶
func (v *Variable) AddInstance(vi *VariableInstance) error
AddInstance adds a new instance if possible
func (*Variable) CheckInstanceExists ¶
CheckInstanceExists checks that the instance belongs to the variable
func (*Variable) Clean ¶
Clean sets the status Clean to the variable and (if "all") all its instances
func (*Variable) Deleted ¶
func (p *Variable) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (Variable) IsActive ¶
func (p Variable) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (Variable) IsClean ¶
func (p Variable) IsClean() bool
IsClean tests whether everything has been persisted
func (Variable) IsDeleted ¶
func (p Variable) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (Variable) IsDirty ¶
func (p Variable) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (Variable) IsNew ¶
func (p Variable) IsNew() bool
IsNew tests whether the entity has never been persisted
func (Variable) IsToDelete ¶
func (p Variable) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
func (*Variable) SetConsolidationParams ¶
func (v *Variable) SetConsolidationParams(params ConsolidationParams) error
SetConsolidationParams sets the consolidation parameters Only returns ValidationError
func (*Variable) ToDelete ¶
ToDelete sets the status ToDelete to one instance or to all instances and the variable itselfs
func (*Variable) ToProtobuf ¶
ToProtobuf converts a variable to a protobuf
type VariableInstance ¶
type VariableInstance struct { ID string Name string Metadata Metadata // contains filtered or unexported fields }
VariableInstance is an instance of the VariableDefinition
func NewInstance ¶
func NewInstance(name string, metadata map[string]string) (*VariableInstance, error)
NewInstance creates a variable instance and validates it
func (*VariableInstance) Clean ¶
func (p *VariableInstance) Clean()
Clean sets the status Clean (everything has been persisted)
func (*VariableInstance) Deleted ¶
func (p *VariableInstance) Deleted()
Deleted sets the status Deleted (the entity is not longer reachable)
func (VariableInstance) IsActive ¶
func (p VariableInstance) IsActive() bool
IsActive returns true if the entity is New, Clean or Dirty
func (VariableInstance) IsClean ¶
func (p VariableInstance) IsClean() bool
IsClean tests whether everything has been persisted
func (VariableInstance) IsDeleted ¶
func (p VariableInstance) IsDeleted() bool
IsDeleted returns true if the entity is deleted
func (VariableInstance) IsDirty ¶
func (p VariableInstance) IsDirty() bool
IsDirty tests whether the entity has to be persisted
func (VariableInstance) IsNew ¶
func (p VariableInstance) IsNew() bool
IsNew tests whether the entity has never been persisted
func (VariableInstance) IsToDelete ¶
func (p VariableInstance) IsToDelete() bool
IsToDelete tests whether the entity has to be deleted
Source Files ¶
- compression_enumer.go
- consolidation_event.go
- consolidation_params.go
- container.go
- customgrid.go
- dataformat.go
- dataset.go
- datasetstatus_enumer.go
- datatype.go
- dtype_enumer.go
- geocubeerrors.go
- grid.go
- image.go
- job.go
- jobstate_enumer.go
- jobstatus_enumer.go
- jobtype_enumer.go
- layout.go
- metadata.go
- palette.go
- record.go
- resampling_enumer.go
- state.go
- storageclass_enumer.go
- task.go
- taskstate_enumer.go
- urn.go
- variable.go