package shim
import "github.com/containerd/containerd/runtime/v2/shim"
Index ¶
- func AnonDialer(address string, timeout time.Duration) (net.Conn, error)
- func BinaryName(runtime string) string
- func Command(ctx context.Context, runtime, containerdAddress, path string, cmdArgs ...string) (*exec.Cmd, error)
- func Connect(address string, d func(string, time.Duration) (net.Conn, error)) (net.Conn, error)
- func NewSocket(address string) (net.Listener, error)
- func Run(id string, initFunc Init)
- func SetScore(pid int) error
- func SocketAddress(ctx context.Context, id string) (string, error)
- func WriteAddress(path, address string) error
- func WritePidFile(path string, pid int) error
- type Client
- func NewShimClient(ctx context.Context, svc shimapi.TaskService, signals chan os.Signal) *Client
- func (s *Client) Serve() error
- type Init
- type Opts
- type OptsKey
- type Shim
Functions ¶
func AnonDialer ¶
AnonDialer returns a dialer for a npipe
func BinaryName ¶
BinaryName returns the shim binary name from the runtime name, empty string returns means runtime name is invalid
func Command ¶
func Command(ctx context.Context, runtime, containerdAddress, path string, cmdArgs ...string) (*exec.Cmd, error)
Command returns the shim command with the provided args and configuration
func Connect ¶
Connect to the provided address
func NewSocket ¶
NewSocket returns a new npipe listener
func Run ¶
Run initializes and runs a shim server
func SetScore ¶
SetScore sets the oom score for a process
func SocketAddress ¶
SocketAddress returns a npipe address
func WriteAddress ¶
WriteAddress writes a address file atomically
func WritePidFile ¶
WritePidFile writes a pid file atomically
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for a shim server
func NewShimClient ¶
NewShimClient creates a new shim server client
func (*Client) Serve ¶
Serve the shim server
type Init ¶
Init func for the creation of a shim server
type Opts ¶
Opts are context options associated with the shim invocation.
type OptsKey ¶
type OptsKey struct{}
OptsKey is the context key for the Opts value.
type Shim ¶
type Shim interface { shimapi.TaskService Cleanup(ctx context.Context) (*shimapi.DeleteResponse, error) StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error) }
Shim server interface
Source Files ¶
shim.go shim_windows.go util.go util_windows.go
- Version
- v1.2.13
- Published
- Feb 18, 2020
- Platform
- windows/amd64
- Imports
- 27 packages
- Last checked
- 11 seconds ago –
Tools for package owners.