options

package
Version: v5.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package options 提供了初始化路由的参数对象

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	Origins []string

	AllowHeaders []string

	ExposedHeaders []string

	MaxAge int

	AllowCredentials bool
	// contains filtered or unexported fields
}

func AllowedCORS

func AllowedCORS() *CORS

type Option

type Option func(*Options)

type Options

type Options struct {
	CaseInsensitive bool
	Lock            bool
	CORS            *CORS
	Interceptors    *syntax.Interceptors
	URLDomain       string
	RecoverFunc     RecoverFunc

	NotFound,
	MethodNotAllowed http.Handler
}

func Build

func Build(o ...Option) (*Options, error)

Build 根据 o 生成 *Options 对象

func (*Options) HandleCORS

func (o *Options) HandleCORS(node *tree.Node, w http.ResponseWriter, r *http.Request)

type RecoverFunc added in v5.3.0

type RecoverFunc func(http.ResponseWriter, interface{})

Source Files

Jump to

Keyboard shortcuts

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