lspipe

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSessionName = "default"

Variables

This section is empty.

Functions

func DialSession

func DialSession(session Session) (net.Conn, error)

func Execute

func Execute(opts ExecOptions) error

func FormatSessionSummary

func FormatSessionSummary(session Session) string

func MarkSessionAlive

func MarkSessionAlive(session *Session)

func PingSession

func PingSession(session Session) bool

func RemoveFIFORecord

func RemoveFIFORecord(sessionName, fifoName string) error

func RemoveSession

func RemoveSession(name string) error

func ResolveExecHosts added in v0.10.0

func ResolveExecHosts(sessionHosts, selectors []string) ([]string, error)

func SaveFIFORecord

func SaveFIFORecord(record FIFORecord) error

func SaveSession

func SaveSession(session Session) error

func SessionExists

func SessionExists(name string) bool

func TouchSession

func TouchSession(name string) error

Types

type Daemon

type Daemon struct {
	Name                  string
	Config                conf.Config
	ConfigPath            string
	Hosts                 []string
	ControlMasterOverride *bool
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(name, configPath string, config conf.Config, hosts []string, controlMasterOverride *bool) *Daemon

func (*Daemon) Close

func (d *Daemon) Close() error

func (*Daemon) Run

func (d *Daemon) Run(ready func()) error

type Event

type Event struct {
	Type     string `json:"type"`
	Host     string `json:"host,omitempty"`
	Stream   string `json:"stream,omitempty"`
	Data     []byte `json:"data,omitempty"`
	Message  string `json:"message,omitempty"`
	ExitCode int    `json:"exit_code,omitempty"`
}

type ExecOptions

type ExecOptions struct {
	Name    string
	Command string
	Hosts   []string
	Raw     bool
	Stdin   []byte
	Stdout  io.Writer
	Stderr  io.Writer
}

type FIFOEndpoint

type FIFOEndpoint struct {
	Scope     string
	Hosts     []string
	Command   string
	StdinPath string
	CmdPath   string
	OutPath   string
}

func BuildFIFOEndpoints

func BuildFIFOEndpoints(session Session, fifoName string) ([]FIFOEndpoint, string, error)

type FIFORecord

type FIFORecord struct {
	SessionName string   `json:"session_name"`
	Name        string   `json:"name"`
	Dir         string   `json:"dir"`
	PID         int      `json:"pid"`
	Hosts       []string `json:"hosts"`
}

func ListFIFORecords

func ListFIFORecords() ([]FIFORecord, error)

func LoadFIFORecord

func LoadFIFORecord(sessionName, fifoName string) (FIFORecord, error)

type FIFOWorker

type FIFOWorker struct {
	SessionName string
	FIFOName    string
	Endpoints   []FIFOEndpoint
}

func (*FIFOWorker) Run

func (w *FIFOWorker) Run() error

type HostHealth

type HostHealth struct {
	Connected bool   `json:"connected"`
	Error     string `json:"error,omitempty"`
}

type Request

type Request struct {
	Action  string   `json:"action"`
	Name    string   `json:"name,omitempty"`
	Command string   `json:"command,omitempty"`
	Hosts   []string `json:"hosts,omitempty"`
	Raw     bool     `json:"raw,omitempty"`
	Stdin   []byte   `json:"stdin,omitempty"`
}

type Session

type Session struct {
	Name         string                `json:"name"`
	Hosts        []string              `json:"hosts"`
	PID          int                   `json:"pid"`
	Network      string                `json:"network"`
	Address      string                `json:"address"`
	ConfigPath   string                `json:"config_path"`
	CreatedAt    time.Time             `json:"created_at"`
	LastUsedAt   time.Time             `json:"last_used_at"`
	HostHealth   map[string]HostHealth `json:"host_health,omitempty"`
	Stale        bool                  `json:"-"`
	AliveChecked bool                  `json:"-"`
}

func ListSessions

func ListSessions() ([]Session, error)

func LoadSession

func LoadSession(name string) (Session, error)

func ResolveSession

func ResolveSession(name string) (Session, error)

Jump to

Keyboard shortcuts

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