condition

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HashMatcherBucketSize = 10000 // default hash bucket size for hash value matcher
)

Variables

This section is empty.

Functions

func GetHash

func GetHash(value []byte, base uint) int

Types

type BinaryCond

type BinaryCond struct {
	// contains filtered or unexported fields
}

BinaryCond is binary condition for lc&&rc , lc||rc

func (*BinaryCond) Match

func (bc *BinaryCond) Match(req *bfe_basic.Request) bool

type BypassMatcher

type BypassMatcher struct{}

func (*BypassMatcher) Match

func (b *BypassMatcher) Match(v interface{}) bool

type CIPFetcher

type CIPFetcher struct{}

CIPFetcher fetches client addr

func (*CIPFetcher) Fetch

func (ip *CIPFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type ClientAuthMatcher

type ClientAuthMatcher struct{}

func (*ClientAuthMatcher) Match

func (m *ClientAuthMatcher) Match(req *bfe_basic.Request) bool

type ClientCANameFetcher

type ClientCANameFetcher struct{}

ClientCANameFetcher fetches client CA name

func (*ClientCANameFetcher) Fetch

func (fetcher *ClientCANameFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type Condition

type Condition interface {
	Match(req *bfe_basic.Request) bool
}

func Build

func Build(condStr string) (Condition, error)

type ContainMatcher

type ContainMatcher struct {
	// contains filtered or unexported fields
}

func NewContainMatcher

func NewContainMatcher(patterns string, foldCase bool) *ContainMatcher

func (*ContainMatcher) Match

func (cm *ContainMatcher) Match(v interface{}) bool

type ContextValueFetcher added in v1.0.0

type ContextValueFetcher struct {
	// contains filtered or unexported fields
}

func (*ContextValueFetcher) Fetch added in v1.0.0

func (f *ContextValueFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type CookieKeyInFetcher

type CookieKeyInFetcher struct {
	// contains filtered or unexported fields
}

func (*CookieKeyInFetcher) Fetch

func (c *CookieKeyInFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type CookieValueFetcher

type CookieValueFetcher struct {
	// contains filtered or unexported fields
}

func (*CookieValueFetcher) Fetch

func (c *CookieValueFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type DefaultTrueCond

type DefaultTrueCond struct{}

DefaultTrueCond always return true

func (DefaultTrueCond) Match

func (dt DefaultTrueCond) Match(req *bfe_basic.Request) bool

type ExactMatcher

type ExactMatcher struct {
	// contains filtered or unexported fields
}

func NewExactMatcher

func NewExactMatcher(pattern string, foldCase bool) *ExactMatcher

func (*ExactMatcher) Match

func (em *ExactMatcher) Match(v interface{}) bool

type Fetcher

type Fetcher interface {
	Fetch(req *bfe_basic.Request) (interface{}, error)
}

type HasTagMatcher

type HasTagMatcher struct {
	// contains filtered or unexported fields
}

func (*HasTagMatcher) Match

func (tm *HasTagMatcher) Match(v interface{}) bool

type HashValueMatcher

type HashValueMatcher struct {
	// contains filtered or unexported fields
}

func NewHashMatcher

func NewHashMatcher(patterns string, insensitive bool) (*HashValueMatcher, error)

func (*HashValueMatcher) Match

func (matcher *HashValueMatcher) Match(v interface{}) bool

type HeaderKeyInFetcher

type HeaderKeyInFetcher struct {
	// contains filtered or unexported fields
}

func (*HeaderKeyInFetcher) Fetch

func (r *HeaderKeyInFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type HeaderValueFetcher

type HeaderValueFetcher struct {
	// contains filtered or unexported fields
}

func (*HeaderValueFetcher) Fetch

func (r *HeaderValueFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type HostFetcher

type HostFetcher struct{}

func (*HostFetcher) Fetch

func (hf *HostFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type HostMatcher

type HostMatcher struct {
	// contains filtered or unexported fields
}

func NewHostMatcher

func NewHostMatcher(patterns string) (*HostMatcher, error)

func (*HostMatcher) Match

func (hm *HostMatcher) Match(v interface{}) bool

type HostTagFetcher

type HostTagFetcher struct{}

func (*HostTagFetcher) Fetch

func (hf *HostTagFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type IPMatcher

type IPMatcher struct {
	// contains filtered or unexported fields
}

func NewIPMatcher

func NewIPMatcher(sIPStr string, eIPStr string) (*IPMatcher, error)

func (*IPMatcher) Match

func (ip *IPMatcher) Match(v interface{}) bool

type InMatcher

type InMatcher struct {
	// contains filtered or unexported fields
}

func NewInMatcher

func NewInMatcher(patterns string, foldCase bool) *InMatcher

func (*InMatcher) Match

func (im *InMatcher) Match(v interface{}) bool

type IpInMatcher

type IpInMatcher struct {
	// contains filtered or unexported fields
}

func NewIpInMatcher

func NewIpInMatcher(patterns string) (*IpInMatcher, error)

func (*IpInMatcher) Match

func (m *IpInMatcher) Match(v interface{}) bool

type Matcher

type Matcher interface {
	Match(interface{}) bool
}

type MethodFetcher

type MethodFetcher struct{}

func (*MethodFetcher) Fetch

func (mf *MethodFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type PathElementPrefixMatcher added in v1.0.0

type PathElementPrefixMatcher struct {
	// contains filtered or unexported fields
}

func NewPathElementPrefixMatcher added in v1.0.0

func NewPathElementPrefixMatcher(patterns string, foldCase bool) *PathElementPrefixMatcher

func (*PathElementPrefixMatcher) Match added in v1.0.0

func (p *PathElementPrefixMatcher) Match(v interface{}) bool

type PathFetcher

type PathFetcher struct{}

func (*PathFetcher) Fetch

func (pf *PathFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type PortFetcher

type PortFetcher struct{}

func (*PortFetcher) Fetch

func (pf *PortFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type PrefixInMatcher

type PrefixInMatcher struct {
	// contains filtered or unexported fields
}

func NewPrefixInMatcher

func NewPrefixInMatcher(patterns string, foldCase bool) *PrefixInMatcher

func (*PrefixInMatcher) Match

func (p *PrefixInMatcher) Match(v interface{}) bool

type PrimitiveCond

type PrimitiveCond struct {
	// contains filtered or unexported fields
}

func (*PrimitiveCond) Match

func (p *PrimitiveCond) Match(req *bfe_basic.Request) bool

func (*PrimitiveCond) String

func (p *PrimitiveCond) String() string

type ProtoFetcher

type ProtoFetcher struct{}

func (*ProtoFetcher) Fetch

func (pf *ProtoFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type QueryExistMatcher

type QueryExistMatcher struct{}

func (*QueryExistMatcher) Match

func (m *QueryExistMatcher) Match(req *bfe_basic.Request) bool

type QueryKeyInFetcher

type QueryKeyInFetcher struct {
	// contains filtered or unexported fields
}

func (*QueryKeyInFetcher) Fetch

func (qf *QueryKeyInFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type QueryKeyPrefixInFetcher

type QueryKeyPrefixInFetcher struct {
	// contains filtered or unexported fields
}

func (*QueryKeyPrefixInFetcher) Fetch

func (qf *QueryKeyPrefixInFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type QueryValueFetcher

type QueryValueFetcher struct {
	// contains filtered or unexported fields
}

func (*QueryValueFetcher) Fetch

func (q *QueryValueFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

Fetch gets first query value for the given name

type RegMatcher

type RegMatcher struct {
	// contains filtered or unexported fields
}

func NewRegMatcher

func NewRegMatcher(regex *regexp.Regexp) *RegMatcher

func (*RegMatcher) Match

func (p *RegMatcher) Match(v interface{}) bool

type ResCodeFetcher

type ResCodeFetcher struct{}

func (*ResCodeFetcher) Fetch

func (rf *ResCodeFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type ResHeaderKeyInFetcher

type ResHeaderKeyInFetcher struct {
	// contains filtered or unexported fields
}

func (*ResHeaderKeyInFetcher) Fetch

func (r *ResHeaderKeyInFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type ResHeaderValueFetcher

type ResHeaderValueFetcher struct {
	// contains filtered or unexported fields
}

func (*ResHeaderValueFetcher) Fetch

func (r *ResHeaderValueFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type SIPFetcher

type SIPFetcher struct{}

SIPFetcher fetches remote socket addr

func (*SIPFetcher) Fetch

func (ip *SIPFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type SecureProtoMatcher

type SecureProtoMatcher struct{}

func (*SecureProtoMatcher) Match

func (m *SecureProtoMatcher) Match(req *bfe_basic.Request) bool

type SniFetcher

type SniFetcher struct{}

SniFetcher fetches serverName in tls

func (*SniFetcher) Fetch

func (fetcher *SniFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type SuffixInMatcher

type SuffixInMatcher struct {
	// contains filtered or unexported fields
}

func NewSuffixInMatcher

func NewSuffixInMatcher(patterns string, foldCase bool) *SuffixInMatcher

func (*SuffixInMatcher) Match

func (p *SuffixInMatcher) Match(v interface{}) bool

type TagFetcher

type TagFetcher struct {
	// contains filtered or unexported fields
}

func (*TagFetcher) Fetch

func (tf *TagFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type TrustedCIpMatcher

type TrustedCIpMatcher struct{}

func (*TrustedCIpMatcher) Match

func (m *TrustedCIpMatcher) Match(req *bfe_basic.Request) bool

type UAFetcher

type UAFetcher struct{}

func (*UAFetcher) Fetch

func (uaf *UAFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type UnaryCond

type UnaryCond struct {
	// contains filtered or unexported fields
}

UnaryCond is unary condition for !cond

func (*UnaryCond) Match

func (uc *UnaryCond) Match(req *bfe_basic.Request) bool

type UrlFetcher

type UrlFetcher struct{}

func (*UrlFetcher) Fetch

func (uf *UrlFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

type VIPFetcher

type VIPFetcher struct{}

VIPFetcher fetches vip addr

func (*VIPFetcher) Fetch

func (ip *VIPFetcher) Fetch(req *bfe_basic.Request) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL