Documentation ¶
Index ¶
- Constants
- func DialHttpProxy(rawURL string) (net.Conn, error)
- func GetTrimmedParam(param string) string
- func ParseRoute(pattern string) routeParser
- func RemoveEscapeChar(word string) string
- func RoutePatternMatch(path, pattern string) bool
- type Constraint
- type HttpProxySrv
- func (l *HttpProxySrv) Accept() (net.Conn, error)
- func (l *HttpProxySrv) AddClient(identity *config.ClientHttpProxyConf, conn net.Conn) error
- func (l *HttpProxySrv) ConnByRouter(r *Route) (net.Conn, error)
- func (l *HttpProxySrv) ForwardConn(addr string) func() (net.Conn, error)
- func (l *HttpProxySrv) GetClient(uid string) (net.Conn, bool)
- func (l *HttpProxySrv) Handle()
- func (l *HttpProxySrv) ParseRouter(conf *config.SrvHttpProxyConf) (*Router, error)
- type Route
- type Router
- type TypeConstraint
Constants ¶
View Source
const ( ConstraintInt = "int" ConstraintBool = "bool" ConstraintFloat = "float" ConstraintAlpha = "alpha" ConstraintGUID = "guid" ConstraintMinLen = "minLen" ConstraintMaxLen = "maxLen" ConstraintLen = "len" ConstraintBetweenLen = "betweenLen" ConstraintMinLenLower = "minlen" ConstraintMaxLenLower = "maxlen" ConstraintBetweenLenLower = "betweenlen" ConstraintMin = "min" ConstraintMax = "max" ConstraintRange = "range" ConstraintDatetime = "datetime" ConstraintRegex = "regex" )
Route Constraints
Variables ¶
This section is empty.
Functions ¶
func GetTrimmedParam ¶
GetTrimmedParam trims the ':' & '?' from a string
func ParseRoute ¶
func ParseRoute(pattern string) routeParser
ParseRoute analyzes the route and divides it into segments for constant areas and parameters, this information is needed later when assigning the requests to the declared routesMap
func RemoveEscapeChar ¶
RemoveEscapeChar remove escape characters
func RoutePatternMatch ¶
RoutePatternMatch checks if a given path matches a Fiber route pattern.
Types ¶
type Constraint ¶
type Constraint struct { ID TypeConstraint RegexCompiler *regexp.Regexp Data []string }
func (*Constraint) CheckConstraint ¶
func (c *Constraint) CheckConstraint(param string) bool
type HttpProxySrv ¶
type HttpProxySrv struct { net.Listener Router *Router Conf *config.SrvHttpProxyConf DefaultForwardConn func() (net.Conn, error) HttpProxyClientConnMap map[string]net.Conn // contains filtered or unexported fields }
func NewHttpProxy ¶
func NewHttpProxy(conf *config.SrvHttpProxyConf) (*HttpProxySrv, error)
func (*HttpProxySrv) AddClient ¶
func (l *HttpProxySrv) AddClient(identity *config.ClientHttpProxyConf, conn net.Conn) error
func (*HttpProxySrv) ConnByRouter ¶
func (l *HttpProxySrv) ConnByRouter(r *Route) (net.Conn, error)
func (*HttpProxySrv) ForwardConn ¶
func (l *HttpProxySrv) ForwardConn(addr string) func() (net.Conn, error)
func (*HttpProxySrv) Handle ¶
func (l *HttpProxySrv) Handle()
func (*HttpProxySrv) ParseRouter ¶
func (l *HttpProxySrv) ParseRouter(conf *config.SrvHttpProxyConf) (*Router, error)
type Route ¶
Click to show internal directories.
Click to hide internal directories.