endpoints

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReqKey  string = "restful_req__"
	RespKey string = "restful_resp__"
)

Variables

This section is empty.

Functions

func GetRestfulRequest

func GetRestfulRequest(ctx context.Context) *restful.Request

func GetRestfulResponse

func GetRestfulResponse(ctx context.Context) *restful.Response

func JsonPatchDecodeRequestFunc

func JsonPatchDecodeRequestFunc(_ context.Context, r *http.Request) (interface{}, error)

func MakeGoRestfulWrapper

func MakeGoRestfulWrapper(server *gokithttp.Server) restful.RouteFunction

func NameNamespaceDecodeRequestFunc

func NameNamespaceDecodeRequestFunc(ctx context.Context, r *http.Request) (interface{}, error)

func NamespaceDecodeRequestFunc

func NamespaceDecodeRequestFunc(ctx context.Context, r *http.Request) (interface{}, error)

func NewEncodeINIResponse

func NewEncodeINIResponse(returnCode int) kithttp.EncodeResponseFunc

func NewEncodeJsonResponse

func NewEncodeJsonResponse(returnCode int) kithttp.EncodeResponseFunc

func NewEncodeYamlResponse

func NewEncodeYamlResponse(returnCode int) kithttp.EncodeResponseFunc

func NewJsonDecodeRequestFunc

func NewJsonDecodeRequestFunc(payloadTypePtr interface{}) gokithttp.DecodeRequestFunc

func NewJsonPatchDecodeRequestFunc

func NewJsonPatchDecodeRequestFunc() gokithttp.DecodeRequestFunc

func NewJsonPostDecodeRequestFunc

func NewJsonPostDecodeRequestFunc(payloadTypePtr interface{}) gokithttp.DecodeRequestFunc

func NewJsonPutDecodeRequestFunc

func NewJsonPutDecodeRequestFunc(payloadTypePtr interface{}) gokithttp.DecodeRequestFunc

func NewMimeTypeAwareDecodeRequestFunc

func NewMimeTypeAwareDecodeRequestFunc(defaultDecoder gokithttp.DecodeRequestFunc, decoderMapping map[string]gokithttp.DecodeRequestFunc) gokithttp.DecodeRequestFunc

func NewMimeTypeAwareEncoder

func NewMimeTypeAwareEncoder(defaultEncoder kithttp.EncodeResponseFunc, encoderMapping map[string]kithttp.EncodeResponseFunc) kithttp.EncodeResponseFunc

func NewYamlDecodeRequestFunc

func NewYamlDecodeRequestFunc(payloadTypePtr interface{}) gokithttp.DecodeRequestFunc

func NoopDecoder

func NoopDecoder(_ context.Context, _ *http.Request) (interface{}, error)

func NotNamespacedDecodeRequestFunc

func NotNamespacedDecodeRequestFunc(ctx context.Context, r *http.Request) (interface{}, error)

Types

type HandlerBuilder

type HandlerBuilder interface {
	Build(context.Context) *kithttp.Server
	Post(interface{}) HandlerBuilder
	Put(interface{}) HandlerBuilder
	Patch() HandlerBuilder
	Get() HandlerBuilder
	Delete() HandlerBuilder
	Middleware([]endpoint.Middleware) HandlerBuilder
	Encoder(kithttp.EncodeResponseFunc) HandlerBuilder
	Decoder(kithttp.DecodeRequestFunc) HandlerBuilder
	Endpoint(endpoint.Endpoint) HandlerBuilder
}

func NewHandlerBuilder

func NewHandlerBuilder() HandlerBuilder

type Metadata

type Metadata struct {
	Name      string
	Namespace string
	Headers   MetadataHeader
}

type MetadataHeader

type MetadataHeader struct {
	Pretty          bool
	Export          bool
	Exact           bool
	LabelSelector   string
	FieldSelector   string
	ResourceVersion string
	TimeoutSeconds  int64
}

type PatchObject

type PatchObject struct {
	Metadata  Metadata
	Patch     interface{}
	PatchType types.PatchType
}

type PutObject

type PutObject struct {
	Metadata Metadata
	Payload  interface{}
}

Jump to

Keyboard shortcuts

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