subrouter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	RequiredScopes []string `cfg:"requiredScopes"`
}

type CORSConfig

type CORSConfig struct {
	AllowedOrigins     []string `cfg:"allowedOrigins"`
	AllowedMethods     []string `cfg:"allowedMethods"`
	AllowedHeaders     []string `cfg:"allowedHeaders"`
	ExposedHeaders     []string `cfg:"exposedHeaders"`
	AllowCredentials   bool     `cfg:"allowCredentials"`
	MaxAge             int      `cfg:"maxAge"`
	OptionsPassthrough bool     `cfg:"optionsPassthrough"`
	Debug              bool     `cfg:"debug"`
}

type Config

type Config []SubrouterConfig

func NewConfig

func NewConfig(configSet *confiq.ConfigSet) (*Config, error)

type RateLimitConfig

type RateLimitConfig struct {
	Limit              int64         `cfg:"maxRequests"`
	Period             time.Duration `cfg:"expiration"`
	TrustForwardHeader bool          `cfg:"trustForwardHeader,default=false"`
}

type SubrouterConfig

type SubrouterConfig struct {
	Name                string               `cfg:"name"`
	TargetURL           string               `cfg:"targetUrl"`
	Prefix              string               `cfg:"prefix"`
	StripPrefix         bool                 `cfg:"stripPrefix,default=false"`
	AuthorizationConfig *AuthorizationConfig `cfg:"authorizationConfig"`
	RateLimitConfig     *RateLimitConfig     `cfg:"rateLimit"`
	GZip                bool                 `cfg:"gzip,default=false"`
	CORSConfig          *CORSConfig          `cfg:"corsConfig"`
}

Jump to

Keyboard shortcuts

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