proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessAdd

func AccessAdd(name string, typ string, lists []string) error

func AccessDel

func AccessDel(name string) error

func AccessFree

func AccessFree(name string) error

func AccessUpdateNotice

func AccessUpdateNotice(callback func(event db.WatchEvent)) error

func AccessUsed

func AccessUsed(name string) error

func ProxyAccessListAdd

func ProxyAccessListAdd(id string, access string) error

func ProxyAccessListDel

func ProxyAccessListDel(id string, access string) error

func ProxyAdd

func ProxyAdd(name string, ipaddr string, protocal string, port int, instance int, auth bool) error

func ProxyDel

func ProxyDel(id string) error

func ProxyRuleListAdd

func ProxyRuleListAdd(id string, rule string) error

func ProxyRuleListDel

func ProxyRuleListDel(id string, rule string) error

func ProxyRunNumber

func ProxyRunNumber(id string, number int) error

func ProxyStatUpdate

func ProxyStatUpdate(id string, stat int64) error

func ProxyUpdate

func ProxyUpdate(id string, ipaddr string, protocal string, port int, instance int, auth bool) error

func ProxyUpdateNotice

func ProxyUpdateNotice(callback func(event db.WatchEvent)) error

func ProxyUsergroupListAdd

func ProxyUsergroupListAdd(id string, usergroup string) error

func ProxyUsergroupListDel

func ProxyUsergroupListDel(id string, usergroup string) error

func RuleAdd

func RuleAdd(name string, prior int, address string, protocal string, auth AuthInfo) error

func RuleAliveSet

func RuleAliveSet(name string, alive string) error

func RuleDel

func RuleDel(name string) error

func RuleKeepAlive

func RuleKeepAlive()

func RuleStatUpdate

func RuleStatUpdate(name string, stat int64) error

func RuleUnused

func RuleUnused(name string) error

func RuleUpdate

func RuleUpdate(name string, prior int, address string, protocal string, auth AuthInfo) error

func RuleUpdateNotice

func RuleUpdateNotice(callback func(event db.WatchEvent)) error

func RuleUsed

func RuleUsed(name string) error

Types

type Access

type Access struct {
	ID     string   `json:"id"`
	Name   string   `json:"name"`
	Type   string   `json:"type"`
	Date   string   `json:"date"`
	Status string   `json:"status"`
	List   []string `json:"list"`
}

func AccessAllGet

func AccessAllGet() ([]Access, error)

func AccessGet

func AccessGet(name string) *Access

type AuthInfo

type AuthInfo struct {
	User  string `json:"user"`
	Token string `token:"token"`
}

type Proxy

type Proxy struct {
	ID          string
	Date        string
	Name        string
	Protocal    string
	IP          string
	Port        int
	RunNumer    int
	TotalNumber int
	Stat        int64
	Cnt         int64
	Status      string
	AuthSwitch  bool
	Usergroup   []string
	Access      []string
	Rule        []string
}

func ProxyAllGet

func ProxyAllGet() ([]*Proxy, error)

func ProxyGet

func ProxyGet(id string) (*Proxy, error)

type Rule

type Rule struct {
	ID       string
	Prior    int
	Name     string
	Date     string
	Protocal string
	Address  string

	Stat   int64
	Alive  string
	Status string
	Auth   AuthInfo
}

func RuleAllGet

func RuleAllGet() ([]*Rule, error)

func RuleGet

func RuleGet(name string) (*Rule, error)

type RuleSortType

type RuleSortType []*Rule

func (RuleSortType) Len

func (a RuleSortType) Len() int

func (RuleSortType) Less

func (a RuleSortType) Less(i, j int) bool

func (RuleSortType) Swap

func (a RuleSortType) Swap(i, j int)

Jump to

Keyboard shortcuts

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