Documentation ¶
Index ¶
- func CreateIPAccessFactory(confMap map[string]interface{}) (api.StreamFilterChainFactory, error)
- func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)
- type Conf
- type IPAccess
- type IPAccessFactory
- type IPAccessFilter
- type IPAllowlist
- type IPBlocklist
- type IpAndAction
- type IpList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIPAccessFactory ¶
func CreateIPAccessFactory(confMap map[string]interface{}) (api.StreamFilterChainFactory, error)
func StructToMap ¶ added in v1.1.0
StructToMap Converts a struct to a map while maintaining the json alias as keys
Types ¶
type Conf ¶
type Conf struct { DefaultAction string `json:"default_action"` Header string `json:"header"` Ips []*IpAndAction `json:"ips"` }
type IPAccessFactory ¶
func (*IPAccessFactory) CreateFilterChain ¶
func (i *IPAccessFactory) CreateFilterChain(ctx context.Context, callbacks api.StreamFilterChainFactoryCallbacks)
type IPAccessFilter ¶
type IPAccessFilter struct {
// contains filtered or unexported fields
}
func NewIPAccessFilter ¶
func NewIPAccessFilter(access []IPAccess, header string, allowAll bool) *IPAccessFilter
func (*IPAccessFilter) OnDestroy ¶
func (f *IPAccessFilter) OnDestroy()
func (*IPAccessFilter) SetReceiveFilterHandler ¶
func (f *IPAccessFilter) SetReceiveFilterHandler(handler api.StreamReceiverFilterHandler)
type IPAllowlist ¶
type IPAllowlist struct {
*IpList
}
IPAllowlist check whether the ip can be accessed
func (*IPAllowlist) IsAllow ¶
func (i *IPAllowlist) IsAllow(addr string) (bool, error)
IsAllow checks if provided request is allow by the ipaccess.
func (*IPAllowlist) IsDenyAction ¶
func (i *IPAllowlist) IsDenyAction() bool
type IPBlocklist ¶
type IPBlocklist struct {
*IpList
}
IPBlocklist check if ip is forbidden to access
func (*IPBlocklist) IsDenyAction ¶
func (i *IPBlocklist) IsDenyAction() bool
type IpAndAction ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.