pg

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements WorkflowBackend

func (Backend) AOIs added in v1.0.0

func (b Backend) AOIs(ctx context.Context, aoi string) ([]string, error)

AOIs implements WorkflowBackend

func (Backend) CreateAOI

func (b Backend) CreateAOI(ctx context.Context, aoi string) error

CreateAOI implements WorkflowBackend

func (Backend) CreateScene

func (b Backend) CreateScene(ctx context.Context, sourceID, aoi string, status common.Status, data common.SceneAttrs) (int, error)

CreateScene implements WorkflowBackend

func (Backend) CreateTile

func (b Backend) CreateTile(ctx context.Context, sourceID string, sceneID int, data common.TileAttrs, aoi, prevTileSource, prevSceneSource, refTileSource, refSceneSource string) (int, error)

CreateTile implements WorkflowBackend

func (Backend) DeleteAOI added in v1.0.0

func (b Backend) DeleteAOI(ctx context.Context, aoi string) error

DeleteAOI implements WorkflowBackend

func (Backend) LeafTiles

func (b Backend) LeafTiles(ctx context.Context, aoi string) ([]common.Tile, error)

LeafTiles implements WorkflowBackend

func (Backend) RootTiles

func (b Backend) RootTiles(ctx context.Context, aoi string) ([]common.Tile, error)

RootTiles implements WorkflowBackend

func (Backend) Scene

func (b Backend) Scene(ctx context.Context, id int, scenesCache *map[int]db.Scene) (db.Scene, error)

Scene implements WorkflowBackend

func (Backend) SceneId added in v1.0.0

func (b Backend) SceneId(ctx context.Context, aoi, sourceID string) (int, error)

SceneId implements WorkflowBackend

func (Backend) Scenes

func (b Backend) Scenes(ctx context.Context, aoi string) ([]db.Scene, error)

Scenes implements WorkflowBackend

func (Backend) ScenesStatus

func (b Backend) ScenesStatus(ctx context.Context, aoi string) (db.Status, error)

ScenesStatus implements WorkflowBackend

func (Backend) SetTilesStatus

func (b Backend) SetTilesStatus(ctx context.Context, ids []int, status common.Status) error

SetTilesStatus implements WorkflowBackend

func (Backend) Tile

func (b Backend) Tile(ctx context.Context, tile int, loadScene bool) (db.Tile, common.Status, error)

Tile implements WorkflowBackend

func (Backend) Tiles

func (b Backend) Tiles(ctx context.Context, aoi string, sceneID int, status string, loadScene bool) ([]db.Tile, error)

Tiles implements WorkflowBackend

func (Backend) TilesStatus

func (b Backend) TilesStatus(ctx context.Context, aoi string) (db.Status, error)

TilesStatus implements WorkflowBackend

func (Backend) UpdateNextTilesPrevId

func (b Backend) UpdateNextTilesPrevId(ctx context.Context, oldPrevID int, newPrevID *int) ([]int, error)

UpdateNextTilesPrevId implements WorkflowBackend

func (Backend) UpdateNextTilesStatus

func (b Backend) UpdateNextTilesStatus(ctx context.Context, prevID int, status, sceneStatus, newStatus common.Status) ([]db.Tile, []int, error)

UpdateNextTilesStatus implements WorkflowBackend

func (Backend) UpdateRefTiles

func (b Backend) UpdateRefTiles(ctx context.Context, oldRefID int, newRefID int) error

UpdateRefTiles implements WorkflowBackend

func (Backend) UpdateScene

func (b Backend) UpdateScene(ctx context.Context, id int, status common.Status, message *string) error

UpdateScene implements WorkflowBackend

func (Backend) UpdateSceneAttrs added in v1.0.0

func (b Backend) UpdateSceneAttrs(ctx context.Context, id int, data common.SceneAttrs) error

UpdateSceneAttrs implements WorkflowBackend

func (Backend) UpdateSceneRootTilesStatus

func (b Backend) UpdateSceneRootTilesStatus(ctx context.Context, sceneID int, status, newStatus common.Status) ([]db.Tile, error)

UpdateSceneRootTilesStatus implements WorkflowBackend

func (Backend) UpdateSceneTilesStatus

func (b Backend) UpdateSceneTilesStatus(ctx context.Context, sceneID int, status, prevStatus, newStatus common.Status) ([]db.Tile, []db.Tile, []int, error)

UpdateSceneTilesStatus implements WorkflowBackend

func (Backend) UpdateTile

func (b Backend) UpdateTile(ctx context.Context, id int, status common.Status, message *string, resetPrev bool) error

UpdateTile implements WorkflowBackend

func (Backend) UpdateTileAttrs added in v1.0.0

func (b Backend) UpdateTileAttrs(ctx context.Context, id int, data common.TileAttrs) error

UpdateTileAttrs implements WorkflowBackend

type BackendDB

type BackendDB struct {
	*sql.DB
	Backend
}

BackendDB implements WorkflowDBBackend

func New

func New(ctx context.Context, dbConnection string) (*BackendDB, error)

New creates a new backend using Postgres

func (BackendDB) StartTransaction

func (bdb BackendDB) StartTransaction(ctx context.Context) (db.WorkflowTxBackend, error)

StartTransaction implements WorkflowDBBackend

type BackendTx

type BackendTx struct {
	*sql.Tx
	Backend
}

BackendTx implements WorkflowTxBackend

func (BackendTx) Rollback

func (btx BackendTx) Rollback() error

Rollback overloads sql.Tx.Rollback to be idempotent

Jump to

Keyboard shortcuts

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