middleware

package
v0.0.0-...-af619fd Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2021 bugkillerpro. 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 bugkillerpro. 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

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

CORS cors

func NewCORS

func NewCORS(opts ...CORSOption) *CORS

NewCORS ...

func (*CORS) Func

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

Func ...

type CORSOption

type CORSOption func(c *CORS)

CORSOption ...

func WithAllowCredentials

func WithAllowCredentials(allowCredentials bool) CORSOption

WithAllowCredentials set AllowCredentials

func WithAllowHeaders

func WithAllowHeaders(allowHeaders []string) CORSOption

WithAllowHeaders set AllowHeaders

func WithAllowMethods

func WithAllowMethods(allowMethods []string) CORSOption

WithAllowMethods set AllowMethods

func WithAllowOrigins

func WithAllowOrigins(allowOrigins []string) CORSOption

WithAllowOrigins set AllowOrigins

func WithExposeHeaders

func WithExposeHeaders(exposeHeaders []string) CORSOption

WithExposeHeaders set ExposeHeaders

func WithMaxAge

func WithMaxAge(maxAge string) CORSOption

WithMaxAge set MaxAge

type Cost

type Cost struct {
}

Cost struct

func (*Cost) Func

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

Func ...

type RateLimit

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

RateLimit ...

func NewRateLimit

func NewRateLimit(opts ...RateLimitOption) *RateLimit

NewRateLimit ...

func (*RateLimit) Func

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

Func ...

type RateLimitOption

type RateLimitOption func(r *RateLimit)

RateLimitOption ...

func WithCap

func WithCap(cap int64) RateLimitOption

WithCap set cap

func WithRate

func WithRate(rate float64) RateLimitOption

WithRate set rate

func WithWaitMaxDuration

func WithWaitMaxDuration(max time.Duration) RateLimitOption

WithWaitMaxDuration set waitMaxDuration

type TimeOut

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

TimeOut struct

func NewTimeOut

func NewTimeOut(opts ...TimeOutOption) *TimeOut

NewTimeOut ...

func (*TimeOut) Func

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

type TimeOutOption

type TimeOutOption func(out *TimeOut)

TimeOutOption ...

func WithTimeOut

func WithTimeOut(d time.Duration) TimeOutOption

WithTimeOut ...

type Trace

type Trace struct{}

Trace ...

func NewTrace

func NewTrace() *Trace

NewTrace ...

func (*Trace) Func

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