instance

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const AddInstanceEventAction = "addInstanceEvent"

AddInstanceEventAction represents the action to add event

Variables

This section is empty.

Functions

This section is empty.

Types

type PublishCheck

type PublishCheck struct {
	Datastore store.Storer
}

PublishCheck Checks if an instance has been published

func (*PublishCheck) Check

func (d *PublishCheck) Check(handle func(http.ResponseWriter, *http.Request)) http.HandlerFunc

Check wraps a HTTP handle. Checks that the state is not published

type Store

type Store struct {
	store.Storer
	Host                string
	EnableDetachDataset bool
}

Store provides a backend for instances

func (*Store) Add

func (s *Store) Add(w http.ResponseWriter, r *http.Request)

Add an instance Note that this method doesn't need to acquire the instance lock because it creates a new instance, so it is not possible that any other call is concurrently trying to access the same instance

func (*Store) AddEvent

func (s *Store) AddEvent(w http.ResponseWriter, r *http.Request)

AddEvent details to an instance

func (*Store) Get

func (s *Store) Get(w http.ResponseWriter, r *http.Request)

Get a single instance by id Note that this method doesn't need to acquire the instance lock because it's a getter, which will fail if the ETag doesn't match, and cannot interfere with writers.

func (*Store) GetList

func (s *Store) GetList(w http.ResponseWriter, r *http.Request, limit, offset int) (results interface{}, totalCount int, err error)

GetList returns a list of instances, the total count of instances that match the query parameters and an error

func (*Store) Update

func (s *Store) Update(w http.ResponseWriter, r *http.Request)

Update a specific instance TODO: Refactor this to reduce the complexity

func (*Store) UpdateDimension

func (s *Store) UpdateDimension(w http.ResponseWriter, r *http.Request)

UpdateDimension updates label and/or description for a specific dimension within an instance

func (*Store) UpdateImportTask

func (s *Store) UpdateImportTask(w http.ResponseWriter, r *http.Request)

UpdateImportTask updates any task in the request body against an instance TODO: Refactor this to reduce the complexity

func (*Store) UpdateObservations

func (s *Store) UpdateObservations(w http.ResponseWriter, r *http.Request)

UpdateObservations increments the count of inserted_observations against an instance

Jump to

Keyboard shortcuts

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