Documentation ¶
Overview ¶
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
Index ¶
- Constants
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type ChiServerOptions
- type Date
- type Error
- type GetTrainerAvailableHoursParams
- type GrpcServer
- func (g GrpcServer) CancelTraining(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
- func (g GrpcServer) IsHourAvailable(ctx context.Context, request *trainer.IsHourAvailableRequest) (*trainer.IsHourAvailableResponse, error)
- func (g GrpcServer) MakeHourAvailable(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
- func (g GrpcServer) ScheduleTraining(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
- type Hour
- type HourUpdate
- type HttpServer
- type MakeHourAvailableJSONBody
- type MakeHourAvailableJSONRequestBody
- type MakeHourUnavailableJSONBody
- type MakeHourUnavailableJSONRequestBody
- type MiddlewareFunc
- type ServerInterface
- type ServerInterfaceWrapper
Constants ¶
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 }
type Date ¶
type Date struct { Date openapi_types.Date `json:"date"` HasFreeHours bool `json:"hasFreeHours"` Hours []Hour `json:"hours"` }
Date defines model for Date.
type GetTrainerAvailableHoursParams ¶
type GetTrainerAvailableHoursParams struct { DateFrom time.Time `json:"dateFrom"` DateTo time.Time `json:"dateTo"` }
GetTrainerAvailableHoursParams defines parameters for GetTrainerAvailableHours.
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(application app.Application) GrpcServer
func (GrpcServer) CancelTraining ¶
func (g GrpcServer) CancelTraining(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
func (GrpcServer) IsHourAvailable ¶
func (g GrpcServer) IsHourAvailable(ctx context.Context, request *trainer.IsHourAvailableRequest) (*trainer.IsHourAvailableResponse, error)
func (GrpcServer) MakeHourAvailable ¶
func (g GrpcServer) MakeHourAvailable(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
func (GrpcServer) ScheduleTraining ¶
func (g GrpcServer) ScheduleTraining(ctx context.Context, request *trainer.UpdateHourRequest) (*empty.Empty, error)
type Hour ¶
type Hour struct { Available bool `json:"available"` HasTrainingScheduled bool `json:"hasTrainingScheduled"` Hour time.Time `json:"hour"` }
Hour defines model for Hour.
type HourUpdate ¶
HourUpdate defines model for HourUpdate.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(application app.Application) HttpServer
func (HttpServer) GetTrainerAvailableHours ¶
func (h HttpServer) GetTrainerAvailableHours(w http.ResponseWriter, r *http.Request, params GetTrainerAvailableHoursParams)
func (HttpServer) MakeHourAvailable ¶
func (h HttpServer) MakeHourAvailable(w http.ResponseWriter, r *http.Request)
func (HttpServer) MakeHourUnavailable ¶
func (h HttpServer) MakeHourUnavailable(w http.ResponseWriter, r *http.Request)
type MakeHourAvailableJSONBody ¶
type MakeHourAvailableJSONBody HourUpdate
MakeHourAvailableJSONBody defines parameters for MakeHourAvailable.
type MakeHourAvailableJSONRequestBody ¶
type MakeHourAvailableJSONRequestBody MakeHourAvailableJSONBody
MakeHourAvailableJSONRequestBody defines body for MakeHourAvailable for application/json ContentType.
type MakeHourUnavailableJSONBody ¶
type MakeHourUnavailableJSONBody HourUpdate
MakeHourUnavailableJSONBody defines parameters for MakeHourUnavailable.
type MakeHourUnavailableJSONRequestBody ¶
type MakeHourUnavailableJSONRequestBody MakeHourUnavailableJSONBody
MakeHourUnavailableJSONRequestBody defines body for MakeHourUnavailable for application/json ContentType.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type ServerInterface ¶
type ServerInterface interface { // (GET /trainer/calendar) GetTrainerAvailableHours(w http.ResponseWriter, r *http.Request, params GetTrainerAvailableHoursParams) // (PUT /trainer/calendar/make-hour-available) MakeHourAvailable(w http.ResponseWriter, r *http.Request) MakeHourUnavailable(w http.ResponseWriter, r *http.Request) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetTrainerAvailableHours ¶
func (siw *ServerInterfaceWrapper) GetTrainerAvailableHours(w http.ResponseWriter, r *http.Request)
GetTrainerAvailableHours operation middleware
func (*ServerInterfaceWrapper) MakeHourAvailable ¶
func (siw *ServerInterfaceWrapper) MakeHourAvailable(w http.ResponseWriter, r *http.Request)
MakeHourAvailable operation middleware
func (*ServerInterfaceWrapper) MakeHourUnavailable ¶
func (siw *ServerInterfaceWrapper) MakeHourUnavailable(w http.ResponseWriter, r *http.Request)
MakeHourUnavailable operation middleware