mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 22:49:52 +02:00
removed unnecessary pointer indirection, added rate limiter middleware
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
type (
|
||||
forwardAuth struct {
|
||||
*forwardAuthOpts
|
||||
forwardAuthOpts
|
||||
m *Middleware
|
||||
client http.Client
|
||||
}
|
||||
@@ -33,14 +33,11 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
var ForwardAuth = &forwardAuth{
|
||||
m: &Middleware{withOptions: NewForwardAuthfunc},
|
||||
}
|
||||
var ForwardAuth = &Middleware{withOptions: NewForwardAuthfunc}
|
||||
|
||||
func NewForwardAuthfunc(optsRaw OptionsRaw) (*Middleware, E.Error) {
|
||||
fa := new(forwardAuth)
|
||||
fa.forwardAuthOpts = new(forwardAuthOpts)
|
||||
if err := Deserialize(optsRaw, fa.forwardAuthOpts); err != nil {
|
||||
if err := Deserialize(optsRaw, &fa.forwardAuthOpts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := url.Parse(fa.Address); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user