schema

package
v0.0.0-...-f21d01c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version 2.4.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type Appointment

type Appointment struct {
	ClientId   *openapi_types.UUID `json:"client_id,omitempty"`
	EndTime    *time.Time          `json:"end_time,omitempty"`
	Id         *openapi_types.UUID `json:"id,omitempty"`
	ProviderId *openapi_types.UUID `json:"provider_id,omitempty"`
	StartTime  *time.Time          `json:"start_time,omitempty"`
	Status     *AppointmentStatus  `json:"status,omitempty"`
}

Appointment defines model for Appointment.

type AppointmentStatus

type AppointmentStatus string

AppointmentStatus defines model for Appointment.Status.

const (
	Confirmed AppointmentStatus = "confirmed"
	Reserved  AppointmentStatus = "reserved"
)

Defines values for AppointmentStatus.

type Availability

type Availability struct {
	EndTime    *time.Time          `json:"end_time,omitempty"`
	Id         *openapi_types.UUID `json:"id,omitempty"`
	ProviderId *openapi_types.UUID `json:"provider_id,omitempty"`
	StartTime  *time.Time          `json:"start_time,omitempty"`
}

Availability defines model for Availability.

type CreateUserRequest

type CreateUserRequest struct {
	Email string                `json:"email"`
	Name  string                `json:"name"`
	Role  CreateUserRequestRole `json:"role"`
}

CreateUserRequest defines model for CreateUserRequest.

type CreateUserRequestRole

type CreateUserRequestRole string

CreateUserRequestRole defines model for CreateUserRequest.Role.

const (
	CreateUserRequestRoleClient   CreateUserRequestRole = "client"
	CreateUserRequestRoleProvider CreateUserRequestRole = "provider"
)

Defines values for CreateUserRequestRole.

type GetAppointmentsParams

type GetAppointmentsParams struct {
	ProviderId *openapi_types.UUID `form:"providerId,omitempty" json:"providerId,omitempty"`
	Date       *openapi_types.Date `form:"date,omitempty" json:"date,omitempty"`
}

GetAppointmentsParams defines parameters for GetAppointments.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type PostAppointmentsJSONBody

type PostAppointmentsJSONBody struct {
	AvailabilityId *openapi_types.UUID `json:"availability_id,omitempty"`
	ClientId       *openapi_types.UUID `json:"client_id,omitempty"`
	ProviderId     *openapi_types.UUID `json:"provider_id,omitempty"`
}

PostAppointmentsJSONBody defines parameters for PostAppointments.

type PostAppointmentsJSONRequestBody

type PostAppointmentsJSONRequestBody PostAppointmentsJSONBody

PostAppointmentsJSONRequestBody defines body for PostAppointments for application/json ContentType.

type PostProvidersProviderIdAvailabilityJSONRequestBody

type PostProvidersProviderIdAvailabilityJSONRequestBody = Availability

PostProvidersProviderIdAvailabilityJSONRequestBody defines body for PostProvidersProviderIdAvailability for application/json ContentType.

type PostUsersJSONRequestBody

type PostUsersJSONRequestBody = CreateUserRequest

PostUsersJSONRequestBody defines body for PostUsers for application/json ContentType.

type ServerInterface

type ServerInterface interface {
	// Get available appointment slots
	// (GET /appointments)
	GetAppointments(c *gin.Context, params GetAppointmentsParams)
	// Reserve an appointment slot
	// (POST /appointments)
	PostAppointments(c *gin.Context)
	// Confirm a reservation
	// (POST /appointments/{appointmentId}/confirm)
	PostAppointmentsAppointmentIdConfirm(c *gin.Context, appointmentId openapi_types.UUID)
	// Submit provider availability
	// (POST /providers/{providerId}/availability)
	PostProvidersProviderIdAvailability(c *gin.Context, providerId openapi_types.UUID)
	// Create a new user (client or provider)
	// (POST /users)
	PostUsers(c *gin.Context)
	// Get user details
	// (GET /users/{userId})
	GetUsersUserId(c *gin.Context, userId openapi_types.UUID)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetAppointments

func (siw *ServerInterfaceWrapper) GetAppointments(c *gin.Context)

GetAppointments operation middleware

func (*ServerInterfaceWrapper) GetUsersUserId

func (siw *ServerInterfaceWrapper) GetUsersUserId(c *gin.Context)

GetUsersUserId operation middleware

func (*ServerInterfaceWrapper) PostAppointments

func (siw *ServerInterfaceWrapper) PostAppointments(c *gin.Context)

PostAppointments operation middleware

func (*ServerInterfaceWrapper) PostAppointmentsAppointmentIdConfirm

func (siw *ServerInterfaceWrapper) PostAppointmentsAppointmentIdConfirm(c *gin.Context)

PostAppointmentsAppointmentIdConfirm operation middleware

func (*ServerInterfaceWrapper) PostProvidersProviderIdAvailability

func (siw *ServerInterfaceWrapper) PostProvidersProviderIdAvailability(c *gin.Context)

PostProvidersProviderIdAvailability operation middleware

func (*ServerInterfaceWrapper) PostUsers

func (siw *ServerInterfaceWrapper) PostUsers(c *gin.Context)

PostUsers operation middleware

type User

type User struct {
	Email *string             `json:"email,omitempty"`
	Id    *openapi_types.UUID `json:"id,omitempty"`
	Name  *string             `json:"name,omitempty"`
	Role  *UserRole           `json:"role,omitempty"`
}

User defines model for User.

type UserRole

type UserRole string

UserRole defines model for User.Role.

const (
	UserRoleClient   UserRole = "client"
	UserRoleProvider UserRole = "provider"
)

Defines values for UserRole.

Jump to

Keyboard shortcuts

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