operations

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PostSpansAcceptedCode int = 202

PostSpansAcceptedCode is the HTTP code returned for type PostSpansAccepted

Variables

This section is empty.

Functions

This section is empty.

Types

type PostSpans

type PostSpans struct {
	Context *middleware.Context
	Handler PostSpansHandler
}

PostSpans swagger:route POST /spans postSpans

Uploads a list of spans encoded per content-type, for example json.

func NewPostSpans

func NewPostSpans(ctx *middleware.Context, handler PostSpansHandler) *PostSpans

NewPostSpans creates a new http.Handler for the post spans operation

func (*PostSpans) ServeHTTP

func (o *PostSpans) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type PostSpansAccepted

type PostSpansAccepted struct {
}

PostSpansAccepted Accepted

swagger:response postSpansAccepted

func NewPostSpansAccepted

func NewPostSpansAccepted() *PostSpansAccepted

NewPostSpansAccepted creates PostSpansAccepted with default headers values

func (*PostSpansAccepted) WriteResponse

func (o *PostSpansAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type PostSpansHandler

type PostSpansHandler interface {
	Handle(PostSpansParams) middleware.Responder
}

PostSpansHandler interface for that can handle valid post spans params

type PostSpansHandlerFunc

type PostSpansHandlerFunc func(PostSpansParams) middleware.Responder

PostSpansHandlerFunc turns a function with the right signature into a post spans handler

func (PostSpansHandlerFunc) Handle

Handle executing the request and returning a response

type PostSpansParams

type PostSpansParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request

	/*A list of spans that belong to any trace.
	  Required: true
	  In: body
	*/
	Spans models.ListOfSpans
}

PostSpansParams contains all the bound params for the post spans operation typically these are obtained from a http.Request

swagger:parameters PostSpans

func NewPostSpansParams

func NewPostSpansParams() PostSpansParams

NewPostSpansParams creates a new PostSpansParams object with the default values initialized.

func (*PostSpansParams) BindRequest

func (o *PostSpansParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls

type ZipkinAPI

type ZipkinAPI struct {
	Middleware func(middleware.Builder) http.Handler

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
	// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
	// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
	// It has a default implemention in the security package, however you can replace it for your particular usage.
	BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator

	// JSONConsumer registers a consumer for a "application/json" mime type
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for a "application/json" mime type
	JSONProducer runtime.Producer

	// PostSpansHandler sets the operation handler for the post spans operation
	PostSpansHandler PostSpansHandler

	// ServeError is called when an error is received, there is a default handler
	// but you can set your own with this
	ServeError func(http.ResponseWriter, *http.Request, error)

	// ServerShutdown is called when the HTTP(S) server is shut down and done
	// handling all active connections and does not accept connections any more
	ServerShutdown func()

	// Custom command line argument groups with their descriptions
	CommandLineOptionsGroups []swag.CommandLineOptionsGroup

	// User defined logger function.
	Logger func(string, ...interface{})
	// contains filtered or unexported fields
}

ZipkinAPI Zipkin's v2 api currently includes a POST endpoint that can receive spans.

func NewZipkinAPI

func NewZipkinAPI(spec *loads.Document) *ZipkinAPI

NewZipkinAPI creates a new Zipkin instance

func (*ZipkinAPI) AuthenticatorsFor

func (o *ZipkinAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*ZipkinAPI) Authorizer

func (o *ZipkinAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*ZipkinAPI) ConsumersFor

func (o *ZipkinAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types

func (*ZipkinAPI) Context

func (o *ZipkinAPI) Context() *middleware.Context

Context returns the middleware context for the zipkin API

func (*ZipkinAPI) DefaultConsumes

func (o *ZipkinAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*ZipkinAPI) DefaultProduces

func (o *ZipkinAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*ZipkinAPI) Formats

func (o *ZipkinAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*ZipkinAPI) HandlerFor

func (o *ZipkinAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*ZipkinAPI) Init

func (o *ZipkinAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit

func (*ZipkinAPI) ProducersFor

func (o *ZipkinAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types

func (*ZipkinAPI) RegisterFormat

func (o *ZipkinAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*ZipkinAPI) Serve

func (o *ZipkinAPI) Serve(builder middleware.Builder) http.Handler

Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))

func (*ZipkinAPI) ServeErrorFor

func (o *ZipkinAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*ZipkinAPI) SetDefaultConsumes

func (o *ZipkinAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*ZipkinAPI) SetDefaultProduces

func (o *ZipkinAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*ZipkinAPI) SetSpec

func (o *ZipkinAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*ZipkinAPI) Validate

func (o *ZipkinAPI) Validate() error

Validate validates the registrations in the ZipkinAPI

Jump to

Keyboard shortcuts

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