ports

package
v0.0.0-...-56ef6d5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 18 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.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

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
}

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 Error

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

Error defines model for Error.

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 (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

type HourUpdate struct {
	Hours []time.Time `json:"hours"`
}

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)

	// (PUT /trainer/calendar/make-hour-unavailable)
	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

Jump to

Keyboard shortcuts

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