Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(r io.ReadCloser, data any) error
- func Encode(w http.ResponseWriter, r *http.Request, status int, data any) error
- func Intercept(target http.HandlerFunc, interceptors ...Interceptor) http.HandlerFunc
- type CORS
- type Certs
- type Code
- type Config
- type Error
- type Interceptor
- type Route
- type Transport
Constants ¶
View Source
const GlobalUse = "*"
View Source
const (
TraceKey = "traceKey"
)
Variables ¶
Functions ¶
func Intercept ¶
func Intercept(target http.HandlerFunc, interceptors ...Interceptor) http.HandlerFunc
Types ¶
type CORS ¶
type CORS struct { AllowedOrigins []string `mapstructure:"allowedOrigins" envVar:"ATMK_CORS_ORIGINS"` AllowedMethods []string `mapstructure:"allowedMethods" envVar:"ATMK_CORS_METHODS"` AllowedHeaders []string `mapstructure:"allowedHeaders" envVar:"ATMK_CORS_HEADERS"` AllowCredentials bool `mapstructure:"allowCredentials" envVar:"ATMK_CORS_CREDS"` }
type Config ¶
type Config struct { BasePath string `mapstructure:"basePath" envVar:"ATMK_TRANSPORT_BASEPATH"` Name string `mapstructure:"name" envVar:"ATMK_TRANSPORT_NAME"` Port string `mapstructure:"port" envVar:"ATMK_TRANSPORT_PORT"` WWW string `mapstructure:"www" envVar:"ATMK_TRANSPORT_WWW"` Certs *Certs `mapstructure:"certs"` CORS *CORS `mapstructure:"cors"` }
type Interceptor ¶
type Interceptor interface {
Intercept(http.HandlerFunc) http.HandlerFunc
}
Interceptor definition
type Transport ¶
type Transport interface { atomika.Service OnError(w http.ResponseWriter, r *http.Request, err error) Register(service, method string, h http.HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) Use(route string, interceptorsList []Interceptor) }
Click to show internal directories.
Click to hide internal directories.