rule

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link interface {
	GetID() string
	// GetBytes rx, tx
	GetBytes() (uint64, uint64)
	// GetPackets rx, tx
	GetPackets() (uint64, uint64)
}

Link link interface

type LinkedRule added in v0.10.0

type LinkedRule interface {
	NewLink(id, remote string, localConn net.Conn, remoteConn *conn.Conn) Link
	GetRemote() string
	GetTarget() string
	GetLinks() []Link
	OnDisconnect(string)
}

LinkedRule linked rule interface

type Mgr

type Mgr struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Mgr rule manager

func New

func New() *Mgr

New new rule manager

func (*Mgr) Add

func (mgr *Mgr) Add(rule Rule)

Add add rule

func (*Mgr) GetLinked added in v0.10.0

func (mgr *Mgr) GetLinked(name, remote string) LinkedRule

GetLinked get rule by name

func (*Mgr) OnDisconnect added in v0.10.0

func (mgr *Mgr) OnDisconnect(id string)

OnDisconnect on disconnect message

func (*Mgr) Range

func (mgr *Mgr) Range(fn func(Rule))

Range range rules

type Rule

type Rule interface {
	GetName() string
	GetPort() uint16
	GetTypeName() string
}

Rule rule interface

Directories

Path Synopsis
vnc

Jump to

Keyboard shortcuts

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