server

package
v0.0.0-...-3e288c8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeEndpointOfDoneProcess

func MakeEndpointOfDoneProcess(s Service) endpoint.Endpoint

MakeEndpointOfDoneProcess creates the endpoint for s.DoneProcess.

func MakeEndpointOfObtainProcess

func MakeEndpointOfObtainProcess(s Service) endpoint.Endpoint

MakeEndpointOfObtainProcess creates the endpoint for s.ObtainProcess.

func MakeEndpointOfPlaceStack

func MakeEndpointOfPlaceStack(s Service) endpoint.Endpoint

MakeEndpointOfPlaceStack creates the endpoint for s.PlaceStack.

func MakeEndpointOfPurgeStack

func MakeEndpointOfPurgeStack(s Service) endpoint.Endpoint

MakeEndpointOfPurgeStack creates the endpoint for s.PurgeStack.

func MakeEndpointOfStartProcess

func MakeEndpointOfStartProcess(s Service) endpoint.Endpoint

MakeEndpointOfStartProcess creates the endpoint for s.StartProcess.

func MakeEndpointOfUpdateStateProcess

func MakeEndpointOfUpdateStateProcess(s Service) endpoint.Endpoint

MakeEndpointOfUpdateStateProcess creates the endpoint for s.UpdateStateProcess.

func NewHTTPRouter

func NewHTTPRouter(svc Service, codecs httpcodec.Codecs, opts ...httpoption.Option) chi.Router

func NewHTTPRouterWithOAS

func NewHTTPRouterWithOAS(svc Service, codecs httpcodec.Codecs, schema oas2.Schema) chi.Router

func OASv2APIDoc

func OASv2APIDoc(schema oas2.Schema) string

func ValidateDoneProcessRequest

func ValidateDoneProcessRequest(newSchema func(*DoneProcessRequest) validating.Schema) httpoption.Validator

ValidateDoneProcessRequest creates a validator for DoneProcessRequest.

func ValidateObtainProcessRequest

func ValidateObtainProcessRequest(newSchema func(*ObtainProcessRequest) validating.Schema) httpoption.Validator

ValidateObtainProcessRequest creates a validator for ObtainProcessRequest.

func ValidatePlaceStackRequest

func ValidatePlaceStackRequest(newSchema func(*PlaceStackRequest) validating.Schema) httpoption.Validator

ValidatePlaceStackRequest creates a validator for PlaceStackRequest.

func ValidatePurgeStackRequest

func ValidatePurgeStackRequest(newSchema func(*PurgeStackRequest) validating.Schema) httpoption.Validator

ValidatePurgeStackRequest creates a validator for PurgeStackRequest.

func ValidateStartProcessRequest

func ValidateStartProcessRequest(newSchema func(*StartProcessRequest) validating.Schema) httpoption.Validator

ValidateStartProcessRequest creates a validator for StartProcessRequest.

func ValidateUpdateStateProcessRequest

func ValidateUpdateStateProcessRequest(newSchema func(*UpdateStateProcessRequest) validating.Schema) httpoption.Validator

ValidateUpdateStateProcessRequest creates a validator for UpdateStateProcessRequest.

Types

type DoneProcessRequest

type DoneProcessRequest struct {
	ProcessIdentity structures.ProcessIdentity `json:"process_identity"`
}

type DoneProcessResponse

type DoneProcessResponse struct {
	Process *structures.Process `json:"process"`
	Err     error               `json:"-"`
}

func (*DoneProcessResponse) Body

func (r *DoneProcessResponse) Body() interface{}

func (*DoneProcessResponse) Failed

func (r *DoneProcessResponse) Failed() error

Failed implements endpoint.Failer.

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(codecs httpcodec.Codecs, httpClient *http.Client, baseURL string) (*HTTPClient, error)

func (*HTTPClient) DoneProcess

func (c *HTTPClient) DoneProcess(ctx context.Context, processIdentity structures.ProcessIdentity) (process *structures.Process, err error)

func (*HTTPClient) ObtainProcess

func (c *HTTPClient) ObtainProcess(ctx context.Context, processId string) (process *structures.Process, err error)

func (*HTTPClient) PlaceStack

func (c *HTTPClient) PlaceStack(ctx context.Context, definition structures.StackDefinition) (stack *structures.Stack, err error)

func (*HTTPClient) PurgeStack

func (c *HTTPClient) PurgeStack(ctx context.Context, s structures.StackIdentity) (stack *structures.Stack, err error)

func (*HTTPClient) StartProcess

func (c *HTTPClient) StartProcess(ctx context.Context, definition structures.ProcessDefinition) (process *structures.Process, err error)

func (*HTTPClient) UpdateStateProcess

func (c *HTTPClient) UpdateStateProcess(ctx context.Context, updater structures.ProcessUpdater) (process *structures.Process, err error)

type ObtainProcessRequest

type ObtainProcessRequest struct {
	ProcessId string `json:"-"`
}

type ObtainProcessResponse

type ObtainProcessResponse struct {
	Process *structures.Process `json:"process"`
	Err     error               `json:"-"`
}

func (*ObtainProcessResponse) Body

func (r *ObtainProcessResponse) Body() interface{}

func (*ObtainProcessResponse) Failed

func (r *ObtainProcessResponse) Failed() error

Failed implements endpoint.Failer.

type PlaceStackRequest

type PlaceStackRequest struct {
	Definition structures.StackDefinition `json:"definition"`
}

type PlaceStackResponse

type PlaceStackResponse struct {
	Stack *structures.Stack `json:"stack"`
	Err   error             `json:"-"`
}

func (*PlaceStackResponse) Body

func (r *PlaceStackResponse) Body() interface{}

func (*PlaceStackResponse) Failed

func (r *PlaceStackResponse) Failed() error

Failed implements endpoint.Failer.

type PurgeStackRequest

type PurgeStackRequest struct {
	S structures.StackIdentity `json:"s"`
}

type PurgeStackResponse

type PurgeStackResponse struct {
	Stack *structures.Stack `json:"stack"`
	Err   error             `json:"-"`
}

func (*PurgeStackResponse) Body

func (r *PurgeStackResponse) Body() interface{}

func (*PurgeStackResponse) Failed

func (r *PurgeStackResponse) Failed() error

Failed implements endpoint.Failer.

type Service

type Service interface {
	//kun:op POST /stack/deploy
	//kun:body definition
	//kun:success statusCode=200 body=stack
	PlaceStack(ctx context.Context, definition structures.StackDefinition) (*structures.Stack, error)

	//kun:op POST /stack/purge
	//kun:body s
	//kun:success statusCode=200 body=stack
	PurgeStack(ctx context.Context, s structures.StackIdentity) (*structures.Stack, error)

	//kun:op GET /process/{processId}
	//kun:success statusCode=200 body=process
	ObtainProcess(ctx context.Context, processId string) (*structures.Process, error)

	//kun:op POST /process/start
	//kun:body definition
	//kun:success statusCode=200 body=process
	StartProcess(ctx context.Context, definition structures.ProcessDefinition) (*structures.Process, error)

	//kun:op POST /process/update
	//kun:body updater
	//kun:success statusCode=200 body=process
	UpdateStateProcess(ctx context.Context, updater structures.ProcessUpdater) (*structures.Process, error)

	//kun:op POST /process/done
	//kun:body processIdentity
	//kun:success statusCode=200 body=process
	DoneProcess(ctx context.Context, processIdentity structures.ProcessIdentity) (*structures.Process, error)
}

type StartProcessRequest

type StartProcessRequest struct {
	Definition structures.ProcessDefinition `json:"definition"`
}

type StartProcessResponse

type StartProcessResponse struct {
	Process *structures.Process `json:"process"`
	Err     error               `json:"-"`
}

func (*StartProcessResponse) Body

func (r *StartProcessResponse) Body() interface{}

func (*StartProcessResponse) Failed

func (r *StartProcessResponse) Failed() error

Failed implements endpoint.Failer.

type UpdateStateProcessRequest

type UpdateStateProcessRequest struct {
	Updater structures.ProcessUpdater `json:"updater"`
}

type UpdateStateProcessResponse

type UpdateStateProcessResponse struct {
	Process *structures.Process `json:"process"`
	Err     error               `json:"-"`
}

func (*UpdateStateProcessResponse) Body

func (r *UpdateStateProcessResponse) Body() interface{}

func (*UpdateStateProcessResponse) Failed

func (r *UpdateStateProcessResponse) Failed() error

Failed implements endpoint.Failer.

Jump to

Keyboard shortcuts

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