huma

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package huma is a demo Huma migrated project for migration testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUser

func DeleteUser(ctx context.Context, input *struct {
	ID string `path:"id"`
}) error

DeleteUser handles DELETE /users/{id}

Types

type CreateUserRequest

type CreateUserRequest struct {
	Body struct {
		Name  string `json:"name"`
		Email string `json:"email"`
	}
}

CreateUserRequest represents a request to create a user.

type CreateUserResponse

type CreateUserResponse struct {
	Body User
}

CreateUserResponse is the response for CreateUser (Huma expects output struct with Body for response body).

func CreateUser

func CreateUser(ctx context.Context, input *CreateUserRequest) (*CreateUserResponse, error)

CreateUser handles POST /users

type GetUserResponse

type GetUserResponse struct {
	Body User
}

GetUserResponse is the response for GetUser (Huma output with Body).

func GetUser

func GetUser(ctx context.Context, input *struct {
	ID string `path:"id"`
}) (*GetUserResponse, error)

GetUser handles GET /users/{id}

type HealthResponse

type HealthResponse struct {
	Body struct {
		Status string `json:"status"`
	}
}

HealthResponse represents a health check response.

func Health

func Health(ctx context.Context, input *struct{}) (*HealthResponse, error)

Health handles GET /health

type User

type User struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Email     string `json:"email"`
	CreatedAt string `json:"created_at"`
}

User represents a user entity (Huma version).

type UserListResponse

type UserListResponse struct {
	Body struct {
		Items      []User `json:"items"`
		TotalCount int    `json:"total_count"`
	}
}

UserListResponse represents a list of users.

func ListUsers

func ListUsers(ctx context.Context, input *struct{}) (*UserListResponse, error)

ListUsers handles GET /users

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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