feat: add configurable transport-independent CORS policy
This commit is contained in:
4
omni.go
4
omni.go
@@ -6,6 +6,7 @@ import (
|
||||
"git.yuntuo.hk/k2safe/go-omni/app"
|
||||
"git.yuntuo.hk/k2safe/go-omni/auth"
|
||||
"git.yuntuo.hk/k2safe/go-omni/config"
|
||||
"git.yuntuo.hk/k2safe/go-omni/cors"
|
||||
apierrors "git.yuntuo.hk/k2safe/go-omni/errors"
|
||||
"git.yuntuo.hk/k2safe/go-omni/httpx"
|
||||
"git.yuntuo.hk/k2safe/go-omni/logx"
|
||||
@@ -27,6 +28,7 @@ type APIError = apierrors.APIError
|
||||
type Config = config.Config
|
||||
type TLSConfig = config.TLSConfig
|
||||
type HTTPConfig = config.HTTPConfig
|
||||
type CORSConfig = cors.Config
|
||||
type EndpointsConfig = config.EndpointsConfig
|
||||
type EndpointConfig = config.EndpointConfig
|
||||
type HealthEndpointConfig = config.HealthEndpointConfig
|
||||
@@ -70,6 +72,8 @@ func WithTransport(name string) Option { return config.WithTransport(name) }
|
||||
|
||||
func WithHTTPConfig(settings HTTPConfig) Option { return config.WithHTTPConfig(settings) }
|
||||
|
||||
func WithCORS(settings CORSConfig) Option { return config.WithCORS(settings) }
|
||||
|
||||
func WithTLS(certFile, keyFile string) Option { return config.WithTLS(certFile, keyFile) }
|
||||
|
||||
func WithLogConfig(settings LogConfig) Option { return config.WithLogConfig(settings) }
|
||||
|
||||
Reference in New Issue
Block a user