activator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 16 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() error
	Unlock(UnlockOptions) 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() (*runc.Container, error)

type OnClosed

type OnClosed func(*runc.Container) error

type Server

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

func NewServer

func NewServer(ctx context.Context, port uint16, ns ns.NetNS) (*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)

type UnlockOptions

type UnlockOptions struct {
	CriuPid int
}

Jump to

Keyboard shortcuts

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