middleware

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2021 jianfengye. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2021 jianfengye. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS added in v1.0.3

type CORS struct {
	// contains filtered or unexported fields
}

CORS cors

func NewCORS added in v1.0.3

func NewCORS(opts ...CORSOption) *CORS

NewCORS ...

func (*CORS) Func added in v1.0.3

func (m *CORS) Func() gin.HandlerFunc

Func ...

type CORSOption added in v1.0.3

type CORSOption func(c *CORS)

CORSOption ...

func WithAllowCredentials added in v1.0.3

func WithAllowCredentials(allowCredentials bool) CORSOption

WithAllowCredentials set AllowCredentials

func WithAllowHeaders added in v1.0.3

func WithAllowHeaders(allowHeaders []string) CORSOption

WithAllowHeaders set AllowHeaders

func WithAllowMethods added in v1.0.3

func WithAllowMethods(allowMethods []string) CORSOption

WithAllowMethods set AllowMethods

func WithAllowOrigins added in v1.0.3

func WithAllowOrigins(allowOrigins []string) CORSOption

WithAllowOrigins set AllowOrigins

func WithExposeHeaders added in v1.0.3

func WithExposeHeaders(exposeHeaders []string) CORSOption

WithExposeHeaders set ExposeHeaders

func WithMaxAge added in v1.0.3

func WithMaxAge(maxAge string) CORSOption

WithMaxAge set MaxAge

type Cost

type Cost struct {
}

Cost struct

func (*Cost) Func added in v1.0.3

func (c *Cost) Func() gin.HandlerFunc

Func ...

type RateLimit added in v1.0.3

type RateLimit struct {
	// contains filtered or unexported fields
}

RateLimit ...

func NewRateLimit added in v1.0.3

func NewRateLimit(opts ...RateLimitOption) *RateLimit

NewRateLimit ...

func (*RateLimit) Func added in v1.0.3

func (r *RateLimit) Func() gin.HandlerFunc

Func ...

type RateLimitOption added in v1.0.3

type RateLimitOption func(r *RateLimit)

RateLimitOption ...

func WithCap added in v1.0.3

func WithCap(cap int64) RateLimitOption

WithCap set cap

func WithRate added in v1.0.3

func WithRate(rate float64) RateLimitOption

WithRate set rate

func WithWaitMaxDuration added in v1.0.3

func WithWaitMaxDuration(max time.Duration) RateLimitOption

WithWaitMaxDuration set waitMaxDuration

type TimeOut added in v1.0.3

type TimeOut struct {
	// contains filtered or unexported fields
}

TimeOut struct

func NewTimeOut added in v1.0.3

func NewTimeOut(opts ...TimeOutOption) *TimeOut

NewTimeOut ...

func (*TimeOut) Func added in v1.0.3

func (t *TimeOut) Func() gin.HandlerFunc

type TimeOutOption added in v1.0.3

type TimeOutOption func(out *TimeOut)

TimeOutOption ...

func WithTimeOut added in v1.0.3

func WithTimeOut(d time.Duration) TimeOutOption

WithTimeOut ...

type Trace

type Trace struct{}

Trace ...

func NewTrace added in v1.0.3

func NewTrace() *Trace

NewTrace ...

func (*Trace) Func added in v1.0.3

func (t *Trace) Func() gin.HandlerFunc

Func ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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