svc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 23 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
}

CubeInfo stores various information about the Cube

type CubeSlice

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

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

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 string, catalogWorkers int) (*Service, error)

New returns a new business service

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) 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, jobName, instanceID, layoutID string, tags map[string]string, fromTime, toTime time.Time) (string, error)

ConsolidateFromFilters implements GeocubeService

func (*Service) ConsolidateFromRecords

func (svc *Service) ConsolidateFromRecords(ctx context.Context, jobName, instanceID, layoutID string, recordsID []string) (string, error)

ConsolidateFromRecords implements GeocubeService

func (*Service) CreateAOI

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

CreateAOI 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, simulate bool, instancesID []string, recordsID []string) ([]string, error)

DeleteDatasets implements ServiceAdmin

func (*Service) DeleteInstance

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

DeleteInstance 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) 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, format string, headersOnly bool) (CubeInfo, <-chan CubeSlice, error)

GetCubeFromFilters implements GeocubeService 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, format string, headersOnly bool) (CubeInfo, <-chan CubeSlice, error)

GetCubeFromRecords implements GeocubeService panics if instancesID is empty

func (*Service) GetJob

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

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

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) 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, crsS string, resolution float32, width, height int32) ([]*grid.Cell, error)

TileAOI implements GeocubeService

func (*Service) UpdateDatasets

func (svc *Service) UpdateDatasets(ctx context.Context, simulate bool, instanceID 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

Jump to

Keyboard shortcuts

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