api

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRouter

func GetRouter(config configuration.Config, command ControllerWithMetrics) http.Handler

GetRouter @title Smart-Service-Repository API @version 0.1 @license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html @host localhost:8080 @BasePath / @securityDefinitions.apikey Bearer @in header @name Authorization

func Start

func Start(ctx context.Context, config configuration.Config, ctrl ControllerWithMetrics) (err error)

Types

type Anything

type Anything = interface{}

type Bulk

type Bulk struct{}

func (*Bulk) Bulk

func (this *Bulk) Bulk(config configuration.Config, router *httprouter.Router, ctrl Controller)

Bulk godoc @Summary bulk write of variables and read of values @Description bulk write of variables and read of values @Tags bulk @Accept json @Produce json @Param message body model.BulkRequest true "model.BulkRequest; 'get' contains a list of value keys; 'set' contains a list of model.Variable" @Success 200 {object} model.BulkResponse @Failure 500 @Router /bulk [post]

type Controller

type Controller interface {
	List(userid string, query model.VariablesQueryOptions) ([]model.VariableWithUnixTimestamp, error)
	Get(userid string, key string) (model.VariableWithUnixTimestamp, error)
	Set(userid string, variable model.Variable) error
	Delete(userid string, key string) error
	Bulk(userid string, bulk model.BulkRequest) (model.BulkResponse, error)
	DeleteProcessDefinition(userid string, definitionId string) error
	DeleteProcessInstance(userid string, instanceId string) error
	Count(userid string, query model.VariablesQueryOptions) (model.Count, error)
}

type ControllerWithMetrics added in v0.0.2

type ControllerWithMetrics interface {
	Controller
	GetMetrics() *metrics.Metrics
}

type EndpointMethod

type EndpointMethod = func(config configuration.Config, router *httprouter.Router, ctrl Controller)

type ProcessDefinitions

type ProcessDefinitions struct{}

func (*ProcessDefinitions) DeleteDefinition

func (this *ProcessDefinitions) DeleteDefinition(config configuration.Config, router *httprouter.Router, ctrl Controller)

DeleteDefinition godoc @Summary deletes all variables associated with the definitionId @Description deletes all variables associated with the definitionId; requesting user must be admin @Tags values, variables, process-definitions @Param definitionId path string true "definitionId associated with value" @Success 204 @Failure 400 @Failure 500 @Router /process-definitions/{definitionId} [delete]

func (*ProcessDefinitions) DeleteInstance

func (this *ProcessDefinitions) DeleteInstance(config configuration.Config, router *httprouter.Router, ctrl Controller)

DeleteInstance godoc @Summary deletes all variables associated with the instanceId @Description deletes all variables associated with the instanceId; requesting user must be admin @Tags values, variables, process-instances @Param instanceId path string true "instanceId associated with value" @Success 204 @Failure 400 @Failure 500 @Router /process-instances/{instanceId} [delete]

func (*ProcessDefinitions) Set

func (this *ProcessDefinitions) Set(config configuration.Config, router *httprouter.Router, ctrl Controller)

Set godoc @Summary set the value associated with the given key @Description set the value associated with the given key @Tags values, process-definitions @Accept json @Param key path string true "key of value" @Param definitionId path string true "definitionId associated with value" @Param message body Anything true "Anything" @Success 204 @Failure 400 @Failure 500 @Router /process-definitions/{definitionId}/values/{key} [put]

func (*ProcessDefinitions) SetWithInstance

func (this *ProcessDefinitions) SetWithInstance(config configuration.Config, router *httprouter.Router, ctrl Controller)

SetWithInstance godoc @Summary set the value associated with the given key @Description set the value associated with the given key @Tags values, process-definitions, process-instances @Accept json @Param key path string true "key of value" @Param definitionId path string true "definitionId associated with value" @Param instanceId path string true "instanceId associated with value" @Param message body Anything true "Anything" @Success 204 @Failure 400 @Failure 500 @Router /process-definitions/{definitionId}/process-instances/{instanceId}/values/{key} [put]

type SwaggerEndpoints

type SwaggerEndpoints struct{}

func (*SwaggerEndpoints) Swagger

func (this *SwaggerEndpoints) Swagger(config configuration.Config, router *httprouter.Router, ctrl Controller)

type Values

type Values struct{}

func (*Values) Delete

func (this *Values) Delete(config configuration.Config, router *httprouter.Router, ctrl Controller)

Delete godoc @Summary delete the value associated with the given key @Description delete the value associated with the given key @Tags values @Param key path string true "key of value" @Success 204 @Failure 400 @Failure 500 @Router /values/{key} [delete]

func (*Values) Get

func (this *Values) Get(config configuration.Config, router *httprouter.Router, ctrl Controller)

Get godoc @Summary returns the value associated with the given key @Description returns the value associated with the given key @Tags values @Param key path string true "key of value" @Produce json @Success 200 {object} Anything @Failure 400 @Failure 500 @Router /values/{key} [get]

func (*Values) Set

func (this *Values) Set(config configuration.Config, router *httprouter.Router, ctrl Controller)

Set godoc @Summary set the value associated with the given key @Description set the value associated with the given key @Tags values @Accept json @Param key path string true "key of value" @Param message body Anything true "Anything" @Success 204 @Failure 400 @Failure 500 @Router /values/{key} [put]

type Variables

type Variables struct{}

func (*Variables) Count

func (this *Variables) Count(config configuration.Config, router *httprouter.Router, ctrl Controller)

Count godoc @Summary counts variables @Description counts variables @Tags variables, count @Param process_instance_id query string false "filter by process instance id" @Param process_definition_id query string false "filter by process definition id" @Produce json @Success 200 {object} model.Count @Failure 400 @Failure 500 @Router /count/variables [get]

func (*Variables) Delete

func (this *Variables) Delete(config configuration.Config, router *httprouter.Router, ctrl Controller)

Delete godoc @Summary delete the variables associated with the given key @Description delete the variables associated with the given key @Tags variables @Param key path string true "key of variable/value" @Success 204 @Failure 400 @Failure 500 @Router /variables/{key} [delete]

func (*Variables) Get

func (this *Variables) Get(config configuration.Config, router *httprouter.Router, ctrl Controller)

Get godoc @Summary returns the variable associated with the given key @Description returns the variable associated with the given key @Tags variables @Param key path string true "key of variable/value" @Produce json @Success 200 {object} model.VariableWithUnixTimestamp @Failure 400 @Failure 500 @Router /variables/{key} [get]

func (*Variables) List

func (this *Variables) List(config configuration.Config, router *httprouter.Router, ctrl Controller)

List godoc @Summary returns a list of variables @Description returns a list of variables @Tags variables @Param limit query integer false "limits size of result; 0 means unlimited" @Param offset query integer false "offset to be used in combination with limit" @Param sort query string false "describes the sorting in the form of key.asc" @Param process_instance_id query string false "filter by process instance id" @Param process_definition_id query string false "filter by process definition id" @Produce json @Success 200 {array} model.VariableWithUnixTimestamp @Failure 400 @Failure 500 @Router /variables [get]

func (*Variables) Set

func (this *Variables) Set(config configuration.Config, router *httprouter.Router, ctrl Controller)

Set godoc @Summary set the variable associated with the given key @Description set the variable associated with the given key @Tags variables @Accept json @Param key path string true "key of variable/value" @Param message body model.Variable true "model.Variable" @Success 204 @Failure 400 @Failure 500 @Router /variables/{key} [put]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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