option

package
v0.51.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOptions

func ApplyOptions(engine *gin.Engine, options []Option) error

Types

type Option

type Option interface {
	// ID returns a unique identifier for the option.
	ID() string
	// Order returns the order in which this option should be applied relative to other options.
	Order() int
	// Apply applies the option's configuration to the given Gin engine.
	// It returns an error if the application fails.
	Apply(engine *gin.Engine) error
}

Option defines an interface for configuring a Gin engine.

func AccessLog

func AccessLog(ignoredPath ...string) Option

AccessLog creates a new Option to log access logs with ignoreing the provided paths.

func CORS

func CORS(config cors.Config) Option

CORS creates a new Option to enable CORS.

func Required

func Required() Option

Required creates a new Option to set several required middlewares and gin server mode.

Jump to

Keyboard shortcuts

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