Documentation
¶
Index ¶
- Constants
- func DefaultMiddleware() httpcontract.Middleware
- func Middleware(service *Service) httpcontract.Middleware
- func RegisterResponseListener(eventDispatcher eventcontract.EventDispatcher, service *Service)
- func Restrictive(allowedOrigins ...string) httpcontract.Middleware
- type Config
- type Service
- func (instance *Service) AllowCredentials() bool
- func (instance *Service) AllowHeaders() []string
- func (instance *Service) AllowHeadersString() string
- func (instance *Service) AllowMethods() []string
- func (instance *Service) AllowMethodsString() string
- func (instance *Service) AllowOrigins() []string
- func (instance *Service) ApplyPreflightHeaders(origin string, headers nethttp.Header)
- func (instance *Service) ApplyResponseHeaders(origin string, headers nethttp.Header)
- func (instance *Service) ExposeHeaders() []string
- func (instance *Service) ExposeHeadersString() string
- func (instance *Service) IsPreflight(request httpcontract.Request) bool
- func (instance *Service) MaxAge() int
- func (instance *Service) OriginAllowed(origin string) bool
- func (instance *Service) RequestOrigin(request httpcontract.Request) string
Constants ¶
View Source
const (
ResponseListenerPriority = -100
)
Variables ¶
This section is empty.
Functions ¶
func DefaultMiddleware ¶
func DefaultMiddleware() httpcontract.Middleware
func Middleware ¶
func Middleware(service *Service) httpcontract.Middleware
func RegisterResponseListener ¶
func RegisterResponseListener(eventDispatcher eventcontract.EventDispatcher, service *Service)
func Restrictive ¶
func Restrictive(allowedOrigins ...string) httpcontract.Middleware
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func DefaultService ¶
func DefaultService() *Service
func NewService ¶
func RestrictiveService ¶
func (*Service) AllowCredentials ¶
func (*Service) AllowHeaders ¶
func (*Service) AllowHeadersString ¶
func (*Service) AllowMethods ¶
func (*Service) AllowMethodsString ¶
func (*Service) AllowOrigins ¶
func (*Service) ApplyPreflightHeaders ¶
func (*Service) ApplyResponseHeaders ¶
func (*Service) ExposeHeaders ¶
func (*Service) ExposeHeadersString ¶
func (*Service) IsPreflight ¶
func (instance *Service) IsPreflight(request httpcontract.Request) bool
func (*Service) OriginAllowed ¶
func (*Service) RequestOrigin ¶
func (instance *Service) RequestOrigin(request httpcontract.Request) string
Click to show internal directories.
Click to hide internal directories.