package port

import "github.com/rootless-containers/rootlesskit/pkg/port"

Index

Types

type Manager

type Manager interface {
	AddPort(ctx context.Context, spec Spec) (*Status, error)
	ListPorts(ctx context.Context) ([]Status, error)
	RemovePort(ctx context.Context, id int) error
}

Manager MUST be thread-safe.

type ParentDriver

type ParentDriver interface {
	Manager
	SetChildPID(int)
}

ParentDriver is a driver for the parent process.

type Spec

type Spec struct {
	Proto      string `json:"proto,omitempty"`    // either "tcp" or "udp". in future "sctp" will be supported as well.
	ParentIP   string `json:"parentIP,omitempty"` // IPv4 address. can be empty (0.0.0.0).
	ParentPort int    `json:"parentPort,omitempty"`
	ChildPort  int    `json:"childPort,omitempty"`
}

type Status

type Status struct {
	ID   int  `json:"id"`
	Spec Spec `json:"spec"`
}

Source Files

port.go

Directories

PathSynopsis
pkg/port/portutil
pkg/port/socat
pkg/port/testsuite
Version
v0.3.0-alpha.0
Published
Jan 13, 2019
Platform
js/wasm
Imports
1 packages
Last checked
2 hours ago

Tools for package owners.