api

package
v0.0.0-...-d12a4ab Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: LGPL-2.1 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHttpApiSimpleHandler

type DefaultHttpApiSimpleHandler struct {
	HandlerName              string
	HttpMethodList           []HttpMethod
	RequestPayloadFormat     RequestFormat
	ResponsePayloadFormat    ResponseFormat
	URL                      string
	RequestPayloadObjectType reflect.Type
}

func (*DefaultHttpApiSimpleHandler) ContentTypes

func (*DefaultHttpApiSimpleHandler) Handle

func (d *DefaultHttpApiSimpleHandler) Handle(request *HttpRequest, msbHandler MsbHandler) *HttpResponse

func (*DefaultHttpApiSimpleHandler) HttpMethods

func (d *DefaultHttpApiSimpleHandler) HttpMethods() []HttpMethod

func (*DefaultHttpApiSimpleHandler) Name

func (*DefaultHttpApiSimpleHandler) RequestType

func (d *DefaultHttpApiSimpleHandler) RequestType() reflect.Type

func (*DefaultHttpApiSimpleHandler) UrlMapping

func (d *DefaultHttpApiSimpleHandler) UrlMapping() string

type HandleResult

type HandleResult struct {
	Result interface{}
}

type HttpApiSimpleHandler

type HttpApiSimpleHandler interface {
	Name() string
	HttpMethods() []HttpMethod
	ContentTypes() (RequestFormat, ResponseFormat)
	UrlMapping() string
	RequestType() reflect.Type
	Handle(request *HttpRequest, msbHandler MsbHandler) *HttpResponse
}

type HttpMethod

type HttpMethod int
const (
	HttpMethodGet     HttpMethod = 1
	HttpMethodPost    HttpMethod = 2
	HttpMethodPut     HttpMethod = 3
	HttpMethodDelete  HttpMethod = 4
	HttpMethodOptions HttpMethod = 5
	HttpMethodHead    HttpMethod = 6
	HttpMethodPatch   HttpMethod = 7
)

type HttpRequest

type HttpRequest struct {
	RequestURI string
	Params     httprouter.Params

	RequestObject interface{}
}

type HttpResponse

type HttpResponse struct {
	HttpStatus      int
	HttpContentType string

	HandleResult
}

type JobResultIndicator

type JobResultIndicator int
const (
	JobResultSuccess JobResultIndicator = 1
	JobResultRetry   JobResultIndicator = 2
	JobResultFail    JobResultIndicator = 3
)

type MsbContext

type MsbContext interface {
	GetTracingContext() (string, string)
}

type MsbHandler

type MsbHandler interface {
	CallProcess(process string, param interface{}) (interface{}, error)
}

type Process

type Process interface {
	Name() string

	Call(msbCtx MsbContext, param interface{}) (interface{}, error)
}

type RequestFormat

type RequestFormat int
const (
	RequestFormatUrlEncoded RequestFormat = 1
	RequestFormatJson       RequestFormat = 2
	RequestFormatMultipart  RequestFormat = 3
)

type ResponseFormat

type ResponseFormat int
const (
	ResponseFormatRawBinary ResponseFormat = 1
	ResponseFormatJson      ResponseFormat = 2
)

type SchedulingJob

type SchedulingJob interface {
	Name() string
	Handler(msbHandler MsbHandler) (JobResultIndicator, error)
	CronConfig() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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