ip_restriction

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "ip_restriction"
)

Variables

View Source
var (
	ErrorConfigTypeError = errors.New("unknown ip list type")
	ErrorIpIllegal       = errors.New("[ip_restriction] Illegal IP!")
)

Functions

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	IPListType   string   `json:"ip_list_type"`
	IPWhiteList  []string `json:"ip_white_list"`
	IPBlackList  []string `json:"ip_black_list"`
	ResponseType string   `json:"response_type"`
}

type Driver

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

func (*Driver) Check

func (d *Driver) Check(v interface{}, workers map[eosc.RequireId]interface{}) error

func (*Driver) ConfigType

func (d *Driver) ConfigType() reflect.Type

func (*Driver) Create

func (d *Driver) Create(id, name string, v interface{}, workers map[eosc.RequireId]interface{}) (eosc.IWorker, error)

type Factory

type Factory struct {
}

func NewFactory

func NewFactory() *Factory

func (*Factory) Create

func (f *Factory) Create(profession string, name string, label string, desc string, params map[string]interface{}) (eosc.IExtenderDriver, error)

type IPFilter

type IPFilter func(ip string) (bool, error)

type IPHandler

type IPHandler struct {
	*Driver
	// contains filtered or unexported fields
}

func (*IPHandler) CheckSkill

func (I *IPHandler) CheckSkill(skill string) bool

func (*IPHandler) Destroy

func (I *IPHandler) Destroy()

func (*IPHandler) DoFilter

func (*IPHandler) Id

func (I *IPHandler) Id() string

func (*IPHandler) Reset

func (I *IPHandler) Reset(conf interface{}, workers map[eosc.RequireId]interface{}) error

func (*IPHandler) Start

func (I *IPHandler) Start() error

func (*IPHandler) Stop

func (I *IPHandler) Stop() error

Jump to

Keyboard shortcuts

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