operations

package
v0.0.0-...-dd04829 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ListReposOKCode int = 200

ListReposOKCode is the HTTP code returned for type ListReposOK

View Source
const StartBuildOKCode int = 200

StartBuildOKCode is the HTTP code returned for type StartBuildOK

Variables

This section is empty.

Functions

This section is empty.

Types

type GoBuildserverAPI

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

	// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
	// It has a default implementation 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 implementation 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 implementation 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 the following mime types:
	//   - application/json
	JSONConsumer runtime.Consumer
	// UrlformConsumer registers a consumer for the following mime types:
	//   - application/x-www-form-urlencoded
	UrlformConsumer runtime.Consumer
	// XMLConsumer registers a consumer for the following mime types:
	//   - application/xml
	XMLConsumer runtime.Consumer

	// JSONProducer registers a producer for the following mime types:
	//   - application/json
	JSONProducer runtime.Producer
	// XMLProducer registers a producer for the following mime types:
	//   - application/xml
	XMLProducer runtime.Producer

	// ListReposHandler sets the operation handler for the list repos operation
	ListReposHandler ListReposHandler
	// StartBuildHandler sets the operation handler for the start build operation
	StartBuildHandler StartBuildHandler

	// 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)

	// PreServerShutdown is called before the HTTP(S) server is shutdown
	// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
	PreServerShutdown func()

	// 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
}

GoBuildserverAPI the go buildserver API

func NewGoBuildserverAPI

func NewGoBuildserverAPI(spec *loads.Document) *GoBuildserverAPI

NewGoBuildserverAPI creates a new GoBuildserver instance

func (*GoBuildserverAPI) AddMiddlewareFor

func (o *GoBuildserverAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)

AddMiddlewareFor adds a http middleware to existing handler

func (*GoBuildserverAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*GoBuildserverAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*GoBuildserverAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.

func (*GoBuildserverAPI) Context

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

Context returns the middleware context for the go buildserver API

func (*GoBuildserverAPI) DefaultConsumes

func (o *GoBuildserverAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*GoBuildserverAPI) DefaultProduces

func (o *GoBuildserverAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*GoBuildserverAPI) Formats

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

Formats returns the registered string formats

func (*GoBuildserverAPI) HandlerFor

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

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

func (*GoBuildserverAPI) Init

func (o *GoBuildserverAPI) Init()

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

func (*GoBuildserverAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.

func (*GoBuildserverAPI) RegisterConsumer

func (o *GoBuildserverAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*GoBuildserverAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*GoBuildserverAPI) RegisterProducer

func (o *GoBuildserverAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*GoBuildserverAPI) Serve

func (o *GoBuildserverAPI) 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 (*GoBuildserverAPI) ServeErrorFor

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

ServeErrorFor gets a error handler for a given operation id

func (*GoBuildserverAPI) SetDefaultConsumes

func (o *GoBuildserverAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*GoBuildserverAPI) SetDefaultProduces

func (o *GoBuildserverAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*GoBuildserverAPI) SetSpec

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

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

func (*GoBuildserverAPI) UseRedoc

func (o *GoBuildserverAPI) UseRedoc()

UseRedoc for documentation at /docs

func (*GoBuildserverAPI) UseSwaggerUI

func (o *GoBuildserverAPI) UseSwaggerUI()

UseSwaggerUI for documentation at /docs

func (*GoBuildserverAPI) Validate

func (o *GoBuildserverAPI) Validate() error

Validate validates the registrations in the GoBuildserverAPI

type ListRepos

type ListRepos struct {
	Context *middleware.Context
	Handler ListReposHandler
}
ListRepos swagger:route GET /repos listRepos

Get repos

func NewListRepos

func NewListRepos(ctx *middleware.Context, handler ListReposHandler) *ListRepos

NewListRepos creates a new http.Handler for the list repos operation

func (*ListRepos) ServeHTTP

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

type ListReposHandler

type ListReposHandler interface {
	Handle(ListReposParams) middleware.Responder
}

ListReposHandler interface for that can handle valid list repos params

type ListReposHandlerFunc

type ListReposHandlerFunc func(ListReposParams) middleware.Responder

ListReposHandlerFunc turns a function with the right signature into a list repos handler

func (ListReposHandlerFunc) Handle

Handle executing the request and returning a response

type ListReposOK

type ListReposOK struct {

	/*
	  In: Body
	*/
	Payload []*models.Repo `json:"body,omitempty"`
}

ListReposOK Successful operation

swagger:response listReposOK

func NewListReposOK

func NewListReposOK() *ListReposOK

NewListReposOK creates ListReposOK with default headers values

func (*ListReposOK) SetPayload

func (o *ListReposOK) SetPayload(payload []*models.Repo)

SetPayload sets the payload to the list repos o k response

func (*ListReposOK) WithPayload

func (o *ListReposOK) WithPayload(payload []*models.Repo) *ListReposOK

WithPayload adds the payload to the list repos o k response

func (*ListReposOK) WriteResponse

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

WriteResponse to the client

type ListReposParams

type ListReposParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`
}

ListReposParams contains all the bound params for the list repos operation typically these are obtained from a http.Request

swagger:parameters listRepos

func NewListReposParams

func NewListReposParams() ListReposParams

NewListReposParams creates a new ListReposParams object

There are no default values defined in the spec.

func (*ListReposParams) BindRequest

func (o *ListReposParams) 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.

To ensure default values, the struct must have been initialized with NewListReposParams() beforehand.

type ListReposURL

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

ListReposURL generates an URL for the list repos operation

func (*ListReposURL) Build

func (o *ListReposURL) Build() (*url.URL, error)

Build a url path and query string

func (*ListReposURL) BuildFull

func (o *ListReposURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*ListReposURL) Must

func (o *ListReposURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*ListReposURL) SetBasePath

func (o *ListReposURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*ListReposURL) String

func (o *ListReposURL) String() string

String returns the string representation of the path with query string

func (*ListReposURL) StringFull

func (o *ListReposURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*ListReposURL) WithBasePath

func (o *ListReposURL) WithBasePath(bp string) *ListReposURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type StartBuild

type StartBuild struct {
	Context *middleware.Context
	Handler StartBuildHandler
}
StartBuild swagger:route POST /repos/{name} startBuild

Start build

func NewStartBuild

func NewStartBuild(ctx *middleware.Context, handler StartBuildHandler) *StartBuild

NewStartBuild creates a new http.Handler for the start build operation

func (*StartBuild) ServeHTTP

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

type StartBuildHandler

type StartBuildHandler interface {
	Handle(StartBuildParams) middleware.Responder
}

StartBuildHandler interface for that can handle valid start build params

type StartBuildHandlerFunc

type StartBuildHandlerFunc func(StartBuildParams) middleware.Responder

StartBuildHandlerFunc turns a function with the right signature into a start build handler

func (StartBuildHandlerFunc) Handle

Handle executing the request and returning a response

type StartBuildOK

type StartBuildOK struct {
}

StartBuildOK Started build

swagger:response startBuildOK

func NewStartBuildOK

func NewStartBuildOK() *StartBuildOK

NewStartBuildOK creates StartBuildOK with default headers values

func (*StartBuildOK) WriteResponse

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

WriteResponse to the client

type StartBuildParams

type StartBuildParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*
	  Required: true
	  In: body
	*/
	Data interface{}
	/*
	  Required: true
	  In: path
	*/
	Name string
	/*The reason for the build.
	  Required: true
	  In: query
	*/
	Reason string
}

StartBuildParams contains all the bound params for the start build operation typically these are obtained from a http.Request

swagger:parameters startBuild

func NewStartBuildParams

func NewStartBuildParams() StartBuildParams

NewStartBuildParams creates a new StartBuildParams object

There are no default values defined in the spec.

func (*StartBuildParams) BindRequest

func (o *StartBuildParams) 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.

To ensure default values, the struct must have been initialized with NewStartBuildParams() beforehand.

type StartBuildURL

type StartBuildURL struct {
	Name string

	Reason string
	// contains filtered or unexported fields
}

StartBuildURL generates an URL for the start build operation

func (*StartBuildURL) Build

func (o *StartBuildURL) Build() (*url.URL, error)

Build a url path and query string

func (*StartBuildURL) BuildFull

func (o *StartBuildURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*StartBuildURL) Must

func (o *StartBuildURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*StartBuildURL) SetBasePath

func (o *StartBuildURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*StartBuildURL) String

func (o *StartBuildURL) String() string

String returns the string representation of the path with query string

func (*StartBuildURL) StringFull

func (o *StartBuildURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*StartBuildURL) WithBasePath

func (o *StartBuildURL) WithBasePath(bp string) *StartBuildURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

Jump to

Keyboard shortcuts

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