Documentation
¶
Index ¶
Constants ¶
const (
DefaultRedirectMessageHeader = "X-Redirect-Message"
)
DefaultRedirectMessageHeader Default HTTP response header constant definition for redirect message.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emits ¶
type Emits map[string]*TriggerEvent
Emits is a mapping configuration used to trigger events.
func (Emits) SetTriggerEvent ¶
func (emit Emits) SetTriggerEvent(key string, event *TriggerEvent) Emits
SetTriggerEvent If the triggering event already exists, it is overwritten.
func (Emits) TriggerEvent ¶
func (emit Emits) TriggerEvent(key string) *TriggerEvent
TriggerEvent Get the trigger event for key.
func (Emits) URIIsRedirect ¶
type Ignore ¶
Ignore will skip the redirect detection without triggering redirection events.
func (Ignore) URIIsIgnore ¶
URIIsIgnore Checks whether the URI is set to ignore.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option design modern impl.
func WithRedirectMessageHeader ¶
WithRedirectMessageHeader Specify redirect message HTTP response header.
func WithSetIgnoreURI ¶
WithSetIgnoreURI Specify redirecter ignore HTTP request.
func WithWatcherOfRedisClient ¶
WithWatcherOfRedisClient Specify redisclient config when watcher is redisclient.
type Redirect ¶
type Redirect struct {
// contains filtered or unexported fields
}
func (*Redirect) Handler ¶
func (redirect *Redirect) Handler() gin.HandlerFunc
type Redirecter ¶
type Redirecter interface {
Handler() gin.HandlerFunc
}
type TriggerEvent ¶
type TriggerEvent struct { StatusCode int // Http status code. RedirectURI string // redirect uri. RedirectHeaderMessage string // Redirect header message, }
TriggerEvent trigger redirection event.