kubernetes

package
v3.71.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupt = errors.New("interrupt signal received")

Functions

func Umask

func Umask(mask int) (old int, err error)

Umask is a wrapper for `unix.Umask()` on non-Windows platforms

Types

type Client

type Client struct {
	ID         int
	SocketPath string
	// contains filtered or unexported fields
}

func (*Client) Await

func (c *Client) Await(ctx context.Context, desiredState RunState) error

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) (RegisterResponse, error)

func (*Client) Exit

func (c *Client) Exit(exitStatus int) error

func (*Client) Write

func (c *Client) Write(p []byte) (int, error)

Write implements io.Writer

type Config

type Config struct {
	SocketPath     string
	ClientCount    int
	Stdout, Stderr io.Writer
	AccessToken    string
}

type Empty

type Empty struct{}

type ExitCode

type ExitCode struct {
	ID         int
	ExitStatus int
}

type Logs

type Logs struct {
	Data []byte
}

type RegisterResponse

type RegisterResponse struct {
	AccessToken string
}

type RunState

type RunState int
const (
	RunStateWait RunState = iota
	RunStateStart
	RunStateInterrupt
)

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func New

func New(l logger.Logger, c Config) *Runner

func (*Runner) ClientStateUnknown added in v3.45.0

func (r *Runner) ClientStateUnknown() bool

func (*Runner) Done

func (r *Runner) Done() <-chan struct{}

func (*Runner) Exit

func (r *Runner) Exit(args ExitCode, reply *Empty) error

func (*Runner) Interrupt

func (r *Runner) Interrupt() error

Interrupts all clients, triggering graceful shutdown

func (*Runner) Register

func (r *Runner) Register(id int, reply *RegisterResponse) error

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

func (*Runner) Started

func (r *Runner) Started() <-chan struct{}

func (*Runner) Status

func (r *Runner) Status(id int, reply *RunState) error

func (*Runner) Terminate

func (r *Runner) Terminate() error

Stops the RPC server, allowing Run to return immediately

func (*Runner) WaitStatus

func (r *Runner) WaitStatus() process.WaitStatus

func (*Runner) WriteLogs

func (r *Runner) WriteLogs(args Logs, reply *Empty) error

type Status

type Status struct {
	Ready       bool
	AccessToken string
}

type WaitReadyResponse

type WaitReadyResponse struct {
	Err error
	Status
}

Jump to

Keyboard shortcuts

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