svc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsldDataset

type CsldDataset struct {
	ID            string
	Event         geocube.ConsolidationDataset
	Consolidation bool
	RecordID      string
}

type CubeInfo

type CubeInfo struct {
	NbImages      int
	NbDatasets    int
	Resampling    geocube.Resampling
	RefDataFormat geocube.DataFormat
}

CubeInfo stores various information about the Cube

type CubeSlice

type CubeSlice struct {
	Image        *geocube.Bitmap
	Err          error
	Records      []*geocube.Record
	Metadata     map[string]string
	DatasetsMeta SliceMeta
}

CubeSlice is a slice of a cube, an image corresponding to a group of record

type GetCubeOptions added in v1.0.1

type GetCubeOptions struct {
	Format      string
	HeadersOnly bool
	Resampling  geocube.Resampling
}

GetCubeOptions defines user-options for a GetCube

type Service

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

Service implements GeocubeService

func New

func New(ctx context.Context, db database.GeocubeDBBackend, eventPublisher messaging.Publisher, consolidationPublisher messaging.Publisher, ingestionStoragePath, cancelledConsolidationPath string, catalogWorkers int) (*Service, error)

New returns a new business service db : an interface to the database of metadata on the images indexed in the Geocube eventPublisher : message publisher to handle the asynchrone jobs. The messages will be pushed to a service implementing HandleEvent (see messaging configuration) consolidationPublisher : message publisher to handle the consolidation tasks. The messages will be pulled by Consolidation workers (see consolidater). ingestionStoragePath : location to store images created by the Geocube (consolidation or ingestion). Must be reachable by the Geocube with read/write/delete permissions. cancelledConsolidationPath : location to store temporary files to inform Consolidation Workers that a job is cancelled. Must be reachable by the Geocube with write permission and by the Consolidation Workers with read permission.

func (*Service) AddRecordsTags

func (svc *Service) AddRecordsTags(ctx context.Context, ids []string, tags geocube.Metadata) (int64, error)

AddRecordsTags add tags on list of records

func (*Service) CancelJob

func (svc *Service) CancelJob(ctx context.Context, jobID string, forceAnyState bool) error

CancelJob implements GeocubeService

func (*Service) CleanJobs

func (svc *Service) CleanJobs(ctx context.Context, nameLike string, state *geocube.JobState) (int, error)

CleanJobs implements GeocubeService

func (*Service) ConfigConsolidation

func (svc *Service) ConfigConsolidation(ctx context.Context, variableID string, params geocube.ConsolidationParams) error

ConfigConsolidation implements GeocubeService

func (*Service) ConsolidateFromFilters

func (svc *Service) ConsolidateFromFilters(ctx context.Context, job *geocube.Job, tags map[string]string, fromTime, toTime time.Time) error

ConsolidateFromFilters implements GeocubeService

func (*Service) ConsolidateFromRecords

func (svc *Service) ConsolidateFromRecords(ctx context.Context, job *geocube.Job, recordsID []string) error

ConsolidateFromRecords implements GeocubeService

func (*Service) ContinueJob added in v0.3.0

func (svc *Service) ContinueJob(ctx context.Context, jobID string) error

ContinueJob implements GeocubeService

func (*Service) CreateAOI

func (svc *Service) CreateAOI(ctx context.Context, aoi *geocube.AOI) error

CreateAOI implements GeocubeService

func (*Service) CreateGrid added in v0.3.0

func (svc *Service) CreateGrid(ctx context.Context, grid *geocube.Grid) error

CreateGrid implements GeocubeService

func (*Service) CreateLayout

func (svc *Service) CreateLayout(ctx context.Context, layout *geocube.Layout) error

CreateLayout implements GeocubeService

func (*Service) CreatePalette

func (svc *Service) CreatePalette(ctx context.Context, palette *geocube.Palette, replaceIfExists bool) error

CreatePalette implements GeocubeService

func (*Service) CreateRecords

func (svc *Service) CreateRecords(ctx context.Context, records []*geocube.Record) error

CreateRecords implements GeocubeService

func (*Service) CreateVariable

func (svc *Service) CreateVariable(ctx context.Context, variable *geocube.Variable) error

CreateVariable implements GeocubeService

func (*Service) DeleteDatasets

func (svc *Service) DeleteDatasets(ctx context.Context, jobName string, instanceIDs, recordIDs, datasetPatterns []string, executionLevel geocube.ExecutionLevel) (*geocube.Job, error)

DeleteDatasets implements ServiceAdmin

func (*Service) DeleteGrid added in v0.3.0

func (svc *Service) DeleteGrid(ctx context.Context, name string) error

DeleteGrid implements GeocubeService

func (*Service) DeleteInstance

func (svc *Service) DeleteInstance(ctx context.Context, id string) error

DeleteInstance implements GeocubeService

func (*Service) DeleteLayout added in v0.3.0

func (svc *Service) DeleteLayout(ctx context.Context, name string) error

DeleteLayout implements GeocubeService

func (*Service) DeleteRecords

func (svc *Service) DeleteRecords(ctx context.Context, ids []string) (int64, error)

DeleteRecords implements GeocubeService

func (*Service) DeleteVariable

func (svc *Service) DeleteVariable(ctx context.Context, id string) error

DeleteVariable implements GeocubeService

func (*Service) FindContainerLayouts added in v0.5.1

func (svc *Service) FindContainerLayouts(ctx context.Context, instanceId string, aoi *geocube.AOI, recordIds []string, tags map[string]string, fromTime, toTime time.Time) ([]string, [][]string, error)

func (*Service) GetAOI

func (svc *Service) GetAOI(ctx context.Context, aoiID string) (*geocube.AOI, error)

GetAOI implements GeocubeService

func (*Service) GetConsolidationParams

func (svc *Service) GetConsolidationParams(ctx context.Context, ID string) (*geocube.ConsolidationParams, error)

GetConsolidationParams implements GeocubeService

func (*Service) GetCubeFromFilters

func (svc *Service) GetCubeFromFilters(ctx context.Context, recordTags geocube.Metadata, fromTime, toTime time.Time, instancesID []string, crs *godal.SpatialRef, pixToCRS *affine.Affine,
	width, height int, options GetCubeOptions) (CubeInfo, <-chan CubeSlice, error)

GetCubeFromFilters implements GeocubeService panics if instancesID is empty

func (*Service) GetCubeFromMetadatas added in v0.4.0

func (svc *Service) GetCubeFromMetadatas(ctx context.Context, metadatas []SliceMeta, grecords [][]*geocube.Record,
	refDf geocube.DataFormat, crs *godal.SpatialRef, pixToCRS *affine.Affine, width, height int, options GetCubeOptions) (CubeInfo, <-chan CubeSlice, error)

GetCubeFromDatasets implements GeocubeDownloaderService panics if instancesID is empty

func (*Service) GetCubeFromRecords

func (svc *Service) GetCubeFromRecords(ctx context.Context, grecordsID [][]string, instancesID []string, crs *godal.SpatialRef, pixToCRS *affine.Affine,
	width, height int, options GetCubeOptions) (CubeInfo, <-chan CubeSlice, error)

GetCubeFromRecords implements GeocubeService panics if instancesID is empty

func (*Service) GetJob

func (svc *Service) GetJob(ctx context.Context, jobID string, opts ...database.ReadJobOptions) (*geocube.Job, error)

GetJob implements GeocubeService GetJob retrieves only the Job but not the tasks

func (*Service) GetRecords added in v1.0.1

func (svc *Service) GetRecords(ctx context.Context, ids []string) ([]*geocube.Record, error)

GetRecords implements GeocubeService

func (*Service) GetVariable

func (svc *Service) GetVariable(ctx context.Context, variableID, instanceID, variableName string) (*geocube.Variable, error)

GetVariable implements GeocubeService Retrieves variable with the first not-empty parameter

func (*Service) GetXYZTile

func (svc *Service) GetXYZTile(ctx context.Context, recordsID []string, instanceID string, a, b, z int) ([]byte, error)

GetXYZTile implements GeocubeService

func (*Service) HandleEvent

func (svc *Service) HandleEvent(ctx context.Context, evt geocube.Event) error

HandleEvent handles TaskEvent and JobEvent for a job

func (*Service) IndexExternalDatasets

func (svc *Service) IndexExternalDatasets(ctx context.Context, newcontainer *geocube.Container, datasets []*geocube.Dataset) error

IndexExternalDatasets implements GeocubeService Index datasets that are not fully known. Checks that the container is reachable and get some missing informations.

func (*Service) InstantiateVariable

func (svc *Service) InstantiateVariable(ctx context.Context, variableID string, instance *geocube.VariableInstance) error

InstantiateVariable implements GeocubeService

func (*Service) ListGrids added in v0.3.0

func (svc *Service) ListGrids(ctx context.Context, nameLike string) ([]*geocube.Grid, error)

ListGrids implements GeocubeService

func (*Service) ListJobs

func (svc *Service) ListJobs(ctx context.Context, nameLike string) ([]*geocube.Job, error)

ListJobs implements GeocubeService ListJobs retrieves only the Job but not the tasks

func (*Service) ListLayouts

func (svc *Service) ListLayouts(ctx context.Context, nameLike string) ([]*geocube.Layout, error)

ListLayouts implements GeocubeService

func (*Service) ListRecords

func (svc *Service) ListRecords(ctx context.Context, name string, tags geocube.Metadata, fromTime, toTime time.Time, aoi *geocube.AOI, page, limit int, loadAOI bool) ([]*geocube.Record, error)

ListRecords implements GeocubeService

func (*Service) ListVariables

func (svc *Service) ListVariables(ctx context.Context, namelike string, page, limit int) ([]*geocube.Variable, error)

ListVariables implements GeocubeService

func (*Service) RemoveRecordsTags

func (svc *Service) RemoveRecordsTags(ctx context.Context, ids []string, tagsKey []string) (int64, error)

RemoveRecordsTags remove tags on list of records

func (*Service) RetryJob

func (svc *Service) RetryJob(ctx context.Context, jobID string, forceAnyState bool) error

RetryJob implements GeocubeService

func (*Service) TidyPending

func (svc *Service) TidyPending(ctx context.Context, aois, records, variables, instances, containers, params bool, simulate bool) ([]int64, error)

TidyPending implements ServiceAdmin

func (*Service) TileAOI

func (svc *Service) TileAOI(ctx context.Context, aoi *geocube.AOI, layoutName string, layout *geocube.Layout) (<-chan geocube.StreamedCell, error)

TileAOI implements GeocubeService

func (*Service) UpdateDatasets

func (svc *Service) UpdateDatasets(ctx context.Context, simulate bool, instanceID string, recordIds []string, dmapping geocube.DataMapping) (map[string]int64, error)

UpdateDatasets implements ServiceAdmin

func (*Service) UpdateInstance

func (svc *Service) UpdateInstance(ctx context.Context, id string, name *string, newMetadata map[string]string, delMetadataKeys []string) error

UpdateInstance implements GeocubeService

func (*Service) UpdateVariable

func (svc *Service) UpdateVariable(ctx context.Context, variableID string, name, unit, description, palette *string, resampling *geocube.Resampling) error

UpdateVariable implements GeocubeService

type SliceMeta added in v0.3.0

type SliceMeta struct {
	Datasets []*internalImage.Dataset
}

SliceMeta info to provide direct access to raw images

func NewSliceMetaFromProtobuf added in v0.6.0

func NewSliceMetaFromProtobuf(pbmeta *pb.DatasetMeta) *SliceMeta

NewSliceMetaFromProtobuf creates SliceMeta from protobuf

func (*SliceMeta) ToProtobuf added in v0.3.0

func (s *SliceMeta) ToProtobuf() *pb.DatasetMeta

ToProtobuf

Jump to

Keyboard shortcuts

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