activator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkLocker

type NetworkLocker interface {
	Backend() NetworkLockerBackend
	Lock(ports []uint16) error
	Unlock(ports []uint16) error
}

func NewNetworkLocker

func NewNetworkLocker(netNS ns.NetNS) NetworkLocker

NewNetworkLocker returns a new network locker with the implementation depending on OS support. If supported it will return an nftables based locker with a fallback to iptables.

type NetworkLockerBackend

type NetworkLockerBackend string
const (
	NetworkLockerNFTables NetworkLockerBackend = "nftables"
	NetworkLockerIPTables NetworkLockerBackend = "iptables"
)

type OnAccept

type OnAccept func() error

type OnClosed

type OnClosed func() error

type Server

type Server struct {
	Network NetworkLocker
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, ports []uint16, ns ns.NetNS, locker NetworkLocker) (*Server, error)

func (*Server) Start

func (s *Server) Start(ctx context.Context, onAccept OnAccept, onClosed OnClosed) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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