common

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TermID is a magic byte to identify the connection is from the terminal
	TermID = 0x01

	// ShellID is a magic byte to identify the connection is from the shell
	ShellID = 0x02
)
View Source
const (
	// StartShellSession identifies the start of a shell session data packet
	StartShellSession = 0x01

	// EndShellSession identifies the end of a shell session data packet
	EndShellSession = 0x02

	// PtyData identifies the psuedo terminal (pty) data payload packet
	PtyData = 0x03

	// WinSizeData identifies the terminal window data payload packet
	WinSizeData = 0x04
)
View Source
const (
	// DebuggerSettingsSecretsKey stores the secrets key name
	DebuggerSettingsSecretsKey = "earthly_debugger_settings"

	// DebuggerDefaultSocketPath is the default socket to connect to (path is inside the container)
	DebuggerDefaultSocketPath = "/var/run/earthly_interactive"

	// DefaultSaveFileSocketPath is the default socket to connect to when sending back files (path is inside the container)
	DefaultSaveFileSocketPath = "/var/run/earthly_save"
)

Variables

View Source
var (
	// ErrDataOverflow occurs when too much data is sent
	ErrDataOverflow = errors.New("Data overflow")

	// ErrDataUnderflow occurs when too little data is received
	ErrDataUnderflow = errors.New("Data underflow")
)

Functions

func ReadDataPacket

func ReadDataPacket(r io.Reader) (int, []byte, error)

ReadDataPacket decodes a data packet from the reader

func ReadUint16PrefixedData added in v0.7.0

func ReadUint16PrefixedData(r io.Reader) ([]byte, error)

ReadUint16PrefixedData first reads a uint16 then reads that many bytes of data

func SerializeDataPacket

func SerializeDataPacket(payloadID int, data []byte) ([]byte, error)

SerializeDataPacket returns a serialized a data packet

func WriteDataPacket

func WriteDataPacket(w io.Writer, n int, data []byte) error

WriteDataPacket writes a data packet to the writer

func WriteUint16PrefixedData added in v0.7.0

func WriteUint16PrefixedData(w io.Writer, data []byte) error

WriteUint16PrefixedData writes a uint16 representing the size of the data, followed by the data

Types

type DebuggerSettings

type DebuggerSettings struct {
	DebugLevelLogging bool                `json:"debugLevel"`
	Enabled           bool                `json:"enabled"`
	SocketPath        string              `json:"socketPath"`
	Term              string              `json:"term"`
	SaveFiles         []SaveFilesSettings `json:"saveFiles"`
}

DebuggerSettings is used to pass settings to the debugger

type SaveFilesSettings added in v0.6.24

type SaveFilesSettings struct {
	Src      string `json:"src"`
	Dst      string `json:"dst"`
	IfExists bool   `json:"ifExists"`
}

SaveFilesSettings is used to pass SAVE ARTIFACT ... AS LOCAL ... commands to the debugger which sends them back on failure

Jump to

Keyboard shortcuts

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