bypass

package
v1.2.24041 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateTimeString2

func DateTimeString2(val time.Time) string

Types

type ByPassGroup

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

分流组管理,管理分流节点

func NewByPassGroup

func NewByPassGroup() *ByPassGroup

func (*ByPassGroup) BeginUpdate

func (this *ByPassGroup) BeginUpdate()

开始更新, 和EndUpdate配套使用

func (*ByPassGroup) ConfigStrategy

func (this *ByPassGroup) ConfigStrategy(v int8)

func (*ByPassGroup) DeleteByPassItem

func (this *ByPassGroup) DeleteByPassItem(id string) (isChanged bool)

func (*ByPassGroup) EndUpdate

func (this *ByPassGroup) EndUpdate(removeflag bool) (upcnt int)

removeflag true:清理没有更新过的 upcnt 本次更新数量

func (*ByPassGroup) GetByPassNode

func (this *ByPassGroup) GetByPassNode() (node *ByPassItem)

获取分流节点

func (*ByPassGroup) ReleaseByPassNode

func (this *ByPassGroup) ReleaseByPassNode(node *ByPassItem, fail bool, block time.Duration, failmsg string)

获取分流节点

func (*ByPassGroup) Status

func (this *ByPassGroup) Status() string

func (*ByPassGroup) UpdateByPassNode

func (this *ByPassGroup) UpdateByPassNode(id string, sn int16, max int, data interface{}) (isChanged bool)

type ByPassItem

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

func (*ByPassItem) GetData

func (this *ByPassItem) GetData() interface{}

type ByPassMananger

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

func NewByPassManager

func NewByPassManager() *ByPassMananger

func (*ByPassMananger) CheckGetByPassGroup

func (this *ByPassMananger) CheckGetByPassGroup(id string, newflag bool) *ByPassGroup

func (*ByPassMananger) GetByPassNode

func (this *ByPassMananger) GetByPassNode(groupid string) (rval *ByPassItem)

获取一个分流节点

func (*ByPassMananger) GetStatusText

func (this *ByPassMananger) GetStatusText(lvl int) string

func (*ByPassMananger) ReleaseByPassNode

func (this *ByPassMananger) ReleaseByPassNode(itm *ByPassItem, fail bool, block time.Duration, failmsg string)

释放一个分流节点

func (*ByPassMananger) TrySetDefault

func (this *ByPassMananger) TrySetDefault(id string) bool

Jump to

Keyboard shortcuts

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