test

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiKeyAuthHandler added in v0.12.3

func ApiKeyAuthHandler(ctx context.Context, req *simba.Request[simba.NoBody, simba.NoParams], auth *ApiKeyAuthModel) (*simba.Response[simba.NoBody], error)

ApiKeyAuthHandler A dummy function to test the OpenAPI generation with api key auth. @ID apiKeyAuthHandler @Summary api key handler @Description this is a multiline

description for the handler

@Error 409 Resource already exists

func BasicAuthHandler added in v0.12.3

func BasicAuthHandler(ctx context.Context, req *simba.Request[simba.NoBody, simba.NoParams], auth *BasicAuthModel) (*simba.Response[simba.NoBody], error)

BasicAuthHandler A dummy function to test the OpenAPI generation with basic auth. @ID basicAuthHandler @Summary basic auth handler @Description this is a multiline

description for the handler

@Error 409 Resource already exists

func BearerTokenAuthHandler added in v0.12.3

func BearerTokenAuthHandler(ctx context.Context, req *simba.Request[simba.NoBody, simba.NoParams], auth *BearerTokenAuthModel) (*simba.Response[simba.NoBody], error)

BearerTokenAuthHandler A dummy function to test the OpenAPI generation with bearer token auth. @ID bearerTokenAuthHandler @Summary bearer token handler @Description this is a multiline

description for the handler

@Error 409 Resource already exists

func NoTagsHandler added in v0.12.3

NoTagsHandler A dummy function to test the OpenAPI generation without any tags in the comment.

func TagsHandler added in v0.12.3

TagsHandler A dummy function to test the OpenAPI generation with tags in the comment. @ID testHandler @Deprecated @Tag Test @Tag User @Summary test handler @Description this is a multiline

description for the handler @Error 409 Resource already exists

Types

type ApiKeyAuthModel added in v0.12.3

type ApiKeyAuthModel struct {
	APIKey string `header:"Authorization" description:"API key"`
}

func ApiKeyAuthFunc added in v0.12.3

func ApiKeyAuthFunc(r *http.Request) (*ApiKeyAuthModel, error)

ApiKeyAuthFunc A dummy function to test the OpenAPI generation with api key auth. @APIKeyAuth "User" "sessionid" "cookie" "Session cookie"

type BasicAuthModel added in v0.12.3

type BasicAuthModel struct {
	Username string `header:"Authorization" description:"Basic auth username"`
}

func BasicAuthFunc added in v0.12.3

func BasicAuthFunc(r *http.Request) (*BasicAuthModel, error)

BasicAuthFunc A dummy function to test the OpenAPI generation with basic auth. @BasicAuth "admin" "admin access only"

type BearerTokenAuthModel added in v0.12.3

type BearerTokenAuthModel struct {
	Token string `header:"Authorization" description:"Bearer token"`
}

func BearerAuthFunc added in v0.12.3

func BearerAuthFunc(r *http.Request) (*BearerTokenAuthModel, error)

BearerAuthFunc A dummy function to test the OpenAPI generation with bearer token auth. @BearerAuth "admin" "jwt" "Bearer token"

type Params

type Params struct {
	ID        uuid.UUID `path:"id" description:"ID of the user" example:"1"`
	Gender    string    `query:"gender" description:"Gender of the user" example:"male"`
	RequestID string    `header:"X-Request-ID" description:"Request ID" example:"1234"`
	Active    bool      `query:"active" description:"Active status of the user" example:"true"`
	Page      int       `query:"page" description:"Page number" example:"1" default:"1"`
	Size      int64     `query:"size" description:"Page size" example:"10" default:"10"`
	Score     float64   `query:"score" description:"User score" example:"9.5" default:"10.0"`
}

type Receiver added in v0.12.3

type Receiver struct{}

Receiver A dummy struct to test the OpenAPI generation with receiver functions.

func (*Receiver) NoTagsHandler added in v0.12.3

NoTagsHandler A dummy function to test the OpenAPI generation without any tags in the comment.

func (*Receiver) TagsHandler added in v0.12.3

TagsHandler A dummy function to test the OpenAPI generation with tags in the comment with receiver functions. @ID testHandler @Deprecated @Tag Test @Tag User @Summary test handler @Description this is a multiline

description for the handler @Error 409 Resource already exists

type RequestBody

type RequestBody struct {
	Name        string `json:"name" description:"Name of the user" example:"John Doe" validate:"required"`
	Age         int    `json:"age" description:"Age of the user" example:"30"`
	Description string `json:"description" description:"description of the user" example:"A test user"`
}

type ResponseBody added in v0.12.3

type ResponseBody struct {
	ID          uuid.UUID `json:"id" description:"ID of the user" example:"1"`
	Name        string    `json:"name" description:"Name of the user" example:"John Doe"`
	Age         int       `json:"age" description:"Age of the user" example:"30"`
	Description string    `json:"description" description:"description of the user" example:"A test user"`
}

type User

type User struct {
	ID   int    `json:"id" description:"ID of the user" example:"1"`
	Name string `json:"name" description:"Name of the user" example:"John Doe"`
	Role string `json:"role" description:"Role of the user" example:"admin"`
}

Jump to

Keyboard shortcuts

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