option

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AddError adds an error to the route.

Declare a cookie parameter for the route. This will be added to the OpenAPI spec. Example:

Cookie("session_id", "Session ID", param.Required())

The list of options is in the param package.

Deprecated marks the route as deprecated.

View Source
var Description = fuego.OptionDescription

Description adds a description to the route.

Group allows to group routes under a common path. Useful to group often used middlewares or options and reuse them. Example:

optionsPagination := option.Group(
	option.QueryInt("per_page", "Number of items per page", param.Required()),
	option.QueryInt("page", "Page number", param.Default(1)),
)

Declare a header parameter for the route. This will be added to the OpenAPI spec. Example:

Header("Authorization", "Bearer token", param.Required())

The list of options is in the param package.

Hide hides the route from the OpenAPI spec.

Middleware adds one or more route-scoped middleware.

View Source
var OperationID = fuego.OptionOperationID

OperationID adds an operation ID to the route.

Registers a parameter for the route. Prefer using the Query, QueryInt, Header, Cookie shortcuts.

Declare a query parameter for the route. This will be added to the OpenAPI spec. Example:

Query("name", "Filter by name", param.Example("cat name", "felix"), param.Nullable())

The list of options is in the param package.

Declare a boolean query parameter for the route. This will be added to the OpenAPI spec. The query parameter is transmitted as a string in the URL, but it is parsed as a boolean. Example:

QueryBool("is_active", "Filter by active status", param.Example("true", true), param.Nullable())

The list of options is in the param package.

Declare an integer query parameter for the route. This will be added to the OpenAPI spec. The query parameter is transmitted as a string in the URL, but it is parsed as an integer. Example:

QueryInt("age", "Filter by age (in years)", param.Example("3 years old", 3), param.Nullable())

The list of options is in the param package.

View Source
var RequestContentType = fuego.OptionRequestContentType

RequestContentType sets the accepted content types for the route. By default, the accepted content types is */*. This will override any options set at the server level.

Summary adds a summary to the route.

Tags adds one or more tags to the route.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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