dispatch

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

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

type CommonBucket

type CommonBucket struct {
	Master map[string]int `json:"master"`
	Slave  map[string]int `json:"slave"`
}

type CommonRuleBucket

type CommonRuleBucket struct {
	CommonBucket
	Rule     string `json:"rule"`
	RuleExpr expr.Expr
}

type Country

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

type District

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

type HeapData

type HeapData []*HeapDataItem

func (HeapData) Len

func (d HeapData) Len() int

func (*HeapData) Pop

func (d *HeapData) Pop() interface{}

func (*HeapData) Push

func (d *HeapData) Push(x interface{})

func (HeapData) Swap

func (d HeapData) Swap(i, j int)

type HeapDataItem

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

type IPDetail

type IPDetail struct {
	Country   string
	Province  string
	City      string
	ISP       string
	District  string
	Latitude  float64
	Longitude float64
}

type IPSegment

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

type ISP

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

type Matcher

type Matcher struct {
	Config               string
	MaxLimit             int    `json:"ip_max_limit"`
	DefaultDomain        string `json:"default_domain"`
	WildcardDomainSuffix string `json:"wildcard_domain_suffix"`
	CommonDispatch       struct {
		ChinaDispatch struct {
			ChinaTelecom *CommonBucket `json:"china_telecom"`
			ChinaUnicom  *CommonBucket `json:"china_unicom"`
			CMCC         *CommonBucket `json:"cmcc"`
			ChinaOther   *CommonBucket `json:"other"`
		} `json:"china"`
		OverseaDispatch     []*CommonRuleBucket `json:"oversea"`
		UnknownAreaDispatch *CommonBucket       `json:"unknown"`
	} `json:"danmaku_common_dispatch"`
	VIPDispatch []*VIPRuleBucket    `json:"danmaku_vip_dispatch"`
	ServerGroup map[string][]string `json:"danmaku_comet_group"`
	ServerHost  map[string]string   `json:"danmaku_comet_host"`
	IPBlack     []string            `json:"ip_black"`
	TempV6      []string            `json:"temp_v6"`
	// contains filtered or unexported fields
}

func NewMatcher

func NewMatcher(matcherConfig []byte, ipDataV4 *ipdb.City, ipDataV6 *ipdb.City, dispatchConfig *conf.DispatchConfig) (*Matcher, error)

func (*Matcher) Dispatch

func (matcher *Matcher) Dispatch(ip string, uid int64) ([]string, []string)

func (*Matcher) GetConfig

func (matcher *Matcher) GetConfig() string

type MinHeap

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

func NewMinHeap

func NewMinHeap() *MinHeap

func (*MinHeap) HeapLength

func (h *MinHeap) HeapLength() int

func (*MinHeap) HeapPop

func (h *MinHeap) HeapPop() (interface{}, float64, error)

func (*MinHeap) HeapPush

func (h *MinHeap) HeapPush(value interface{}, weight float64)

func (*MinHeap) HeapTop

func (h *MinHeap) HeapTop() (interface{}, float64, error)

type MinHeapData

type MinHeapData struct {
	HeapData
}

func (MinHeapData) Less

func (d MinHeapData) Less(i, j int) bool

type Province

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

type SinaIP

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

func NewSinaIP

func NewSinaIP(file string) (*SinaIP, error)

func (*SinaIP) DoQuery

func (b *SinaIP) DoQuery(ip uint32) *IPDetail

type VIPRuleBucket

type VIPRuleBucket struct {
	Rule     string `json:"rule"`
	RuleExpr expr.Expr
	IP       []string `json:"ip"`
	Group    []string `json:"group"`
}

Jump to

Keyboard shortcuts

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