ports

package
v0.0.0-...-e173b71 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package ports provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Package ports provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreateTrainingJSONRequestBody

type CreateTrainingJSONRequestBody = PostTraining

CreateTrainingJSONRequestBody defines body for CreateTraining for application/json ContentType.

type Error

type Error struct {
	Message string `json:"message"`
	Slug    string `json:"slug"`
}

Error defines model for Error.

type HttpServer

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

func NewHttpServer

func NewHttpServer(app app.Application) HttpServer

func (HttpServer) ApproveRescheduleTraining

func (h HttpServer) ApproveRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

func (HttpServer) CancelTraining

func (h HttpServer) CancelTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

func (HttpServer) CreateTraining

func (h HttpServer) CreateTraining(w http.ResponseWriter, r *http.Request)

func (HttpServer) GetTrainings

func (h HttpServer) GetTrainings(w http.ResponseWriter, r *http.Request)

func (HttpServer) RejectRescheduleTraining

func (h HttpServer) RejectRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

func (HttpServer) RequestRescheduleTraining

func (h HttpServer) RequestRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

func (HttpServer) RescheduleTraining

func (h HttpServer) RescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PostTraining

type PostTraining struct {
	Notes string    `json:"notes"`
	Time  time.Time `json:"time"`
}

PostTraining defines model for PostTraining.

type RequestRescheduleTrainingJSONRequestBody

type RequestRescheduleTrainingJSONRequestBody = PostTraining

RequestRescheduleTrainingJSONRequestBody defines body for RequestRescheduleTraining for application/json ContentType.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type RescheduleTrainingJSONRequestBody

type RescheduleTrainingJSONRequestBody = PostTraining

RescheduleTrainingJSONRequestBody defines body for RescheduleTraining for application/json ContentType.

type ServerInterface

type ServerInterface interface {

	// (GET /trainings)
	GetTrainings(w http.ResponseWriter, r *http.Request)

	// (POST /trainings)
	CreateTraining(w http.ResponseWriter, r *http.Request)

	// (DELETE /trainings/{trainingUUID})
	CancelTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

	// (PUT /trainings/{trainingUUID}/approve-reschedule)
	ApproveRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

	// (PUT /trainings/{trainingUUID}/reject-reschedule)
	RejectRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

	// (PUT /trainings/{trainingUUID}/request-reschedule)
	RequestRescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)

	// (PUT /trainings/{trainingUUID}/reschedule)
	RescheduleTraining(w http.ResponseWriter, r *http.Request, trainingUUID openapi_types.UUID)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ApproveRescheduleTraining

func (siw *ServerInterfaceWrapper) ApproveRescheduleTraining(w http.ResponseWriter, r *http.Request)

ApproveRescheduleTraining operation middleware

func (*ServerInterfaceWrapper) CancelTraining

func (siw *ServerInterfaceWrapper) CancelTraining(w http.ResponseWriter, r *http.Request)

CancelTraining operation middleware

func (*ServerInterfaceWrapper) CreateTraining

func (siw *ServerInterfaceWrapper) CreateTraining(w http.ResponseWriter, r *http.Request)

CreateTraining operation middleware

func (*ServerInterfaceWrapper) GetTrainings

func (siw *ServerInterfaceWrapper) GetTrainings(w http.ResponseWriter, r *http.Request)

GetTrainings operation middleware

func (*ServerInterfaceWrapper) RejectRescheduleTraining

func (siw *ServerInterfaceWrapper) RejectRescheduleTraining(w http.ResponseWriter, r *http.Request)

RejectRescheduleTraining operation middleware

func (*ServerInterfaceWrapper) RequestRescheduleTraining

func (siw *ServerInterfaceWrapper) RequestRescheduleTraining(w http.ResponseWriter, r *http.Request)

RequestRescheduleTraining operation middleware

func (*ServerInterfaceWrapper) RescheduleTraining

func (siw *ServerInterfaceWrapper) RescheduleTraining(w http.ResponseWriter, r *http.Request)

RescheduleTraining operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Training

type Training struct {
	CanBeCancelled     bool               `json:"canBeCancelled"`
	MoveProposedBy     *string            `json:"moveProposedBy,omitempty"`
	MoveRequiresAccept bool               `json:"moveRequiresAccept"`
	Notes              string             `json:"notes"`
	ProposedTime       *time.Time         `json:"proposedTime,omitempty"`
	Time               time.Time          `json:"time"`
	User               string             `json:"user"`
	UserUuid           openapi_types.UUID `json:"userUuid"`
	Uuid               openapi_types.UUID `json:"uuid"`
}

Training defines model for Training.

type Trainings

type Trainings struct {
	Trainings []Training `json:"trainings"`
}

Trainings defines model for Trainings.

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshallingParamError

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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