api

package
v0.0.0-...-7d5e268 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router fiber.Router, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type CreateUserJSONRequestBody

type CreateUserJSONRequestBody = User

CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.

type FiberServerOptions

type FiberServerOptions struct {
	BaseURL     string
	Middlewares []MiddlewareFunc
}

FiberServerOptions provides options for the Fiber server.

type GlobalResponses

type GlobalResponses struct {
	ResponseCode    string `json:"responseCode"`
	ResponseMessage string `json:"responseMessage"`
}

GlobalResponses defines model for GlobalResponses.

type MiddlewareFunc

type MiddlewareFunc fiber.Handler

type ServerInterface

type ServerInterface interface {
	// Check
	// (GET /api/v1.0/check)
	Check(c *fiber.Ctx) error
	// Get all users
	// (GET /api/v1.0/users)
	GetUsers(c *fiber.Ctx) error
	// Create a new user
	// (POST /api/v1.0/users)
	CreateUser(c *fiber.Ctx) error
	// Delete a user
	// (DELETE /api/v1.0/users/{id})
	DeleteUser(c *fiber.Ctx, id string) error
	// Get user by ID
	// (GET /api/v1.0/users/{id})
	GetUserById(c *fiber.Ctx, id string) error
	// Update a user
	// (PUT /api/v1.0/users/{id})
	UpdateUser(c *fiber.Ctx, id string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) Check

func (siw *ServerInterfaceWrapper) Check(c *fiber.Ctx) error

Check operation middleware

func (*ServerInterfaceWrapper) CreateUser

func (siw *ServerInterfaceWrapper) CreateUser(c *fiber.Ctx) error

CreateUser operation middleware

func (*ServerInterfaceWrapper) DeleteUser

func (siw *ServerInterfaceWrapper) DeleteUser(c *fiber.Ctx) error

DeleteUser operation middleware

func (*ServerInterfaceWrapper) GetUserById

func (siw *ServerInterfaceWrapper) GetUserById(c *fiber.Ctx) error

GetUserById operation middleware

func (*ServerInterfaceWrapper) GetUsers

func (siw *ServerInterfaceWrapper) GetUsers(c *fiber.Ctx) error

GetUsers operation middleware

func (*ServerInterfaceWrapper) UpdateUser

func (siw *ServerInterfaceWrapper) UpdateUser(c *fiber.Ctx) error

UpdateUser operation middleware

type UpdateUserJSONRequestBody

type UpdateUserJSONRequestBody = User

UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.

type User

type User struct {
	Email openapi_types.Email `json:"email"`
	Id    string              `json:"id"`
	Name  string              `json:"name"`
}

User defines model for User.

Jump to

Keyboard shortcuts

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