Help us shape the future of Go! Take the 2026 Go Developer Survey

s4wave_terminal

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTerminalCols is the fallback terminal width.
	DefaultTerminalCols uint32 = 80
	// DefaultTerminalRows is the fallback terminal height.
	DefaultTerminalRows uint32 = 24
)
View Source
const RemoteShellProtocolID = protocol.ID("alpha/remote-shell/v0")

RemoteShellProtocolID is the Bifrost protocol used for PTY-backed terminals.

View Source
const SRPCTerminalResourceServiceServiceID = "s4wave.terminal.TerminalResourceService"
View Source
const TerminalTypeID = "spacewave/terminal"

TerminalTypeID is the type identifier for remote Terminal objects.

Variables

View Source
var (
	TerminalSessionState_name = map[int32]string{
		0: "TERMINAL_SESSION_STATE_UNKNOWN",
		1: "TERMINAL_SESSION_STATE_CONNECTING",
		2: "TERMINAL_SESSION_STATE_ACTIVE",
		3: "TERMINAL_SESSION_STATE_DISCONNECTED",
		4: "TERMINAL_SESSION_STATE_FAILED",
		5: "TERMINAL_SESSION_STATE_CLOSED",
	}
	TerminalSessionState_value = map[string]int32{
		"TERMINAL_SESSION_STATE_UNKNOWN":      0,
		"TERMINAL_SESSION_STATE_CONNECTING":   1,
		"TERMINAL_SESSION_STATE_ACTIVE":       2,
		"TERMINAL_SESSION_STATE_DISCONNECTED": 3,
		"TERMINAL_SESSION_STATE_FAILED":       4,
		"TERMINAL_SESSION_STATE_CLOSED":       5,
	}
)

Enum value maps for TerminalSessionState.

View Source
var (
	TerminalFrameKind_name = map[int32]string{
		0:  "TERMINAL_FRAME_KIND_UNKNOWN",
		1:  "TERMINAL_FRAME_KIND_OPEN",
		2:  "TERMINAL_FRAME_KIND_READY",
		3:  "TERMINAL_FRAME_KIND_INPUT",
		4:  "TERMINAL_FRAME_KIND_OUTPUT",
		5:  "TERMINAL_FRAME_KIND_RESIZE",
		6:  "TERMINAL_FRAME_KIND_CLOSE",
		7:  "TERMINAL_FRAME_KIND_EXIT",
		8:  "TERMINAL_FRAME_KIND_ERROR",
		9:  "TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_CHALLENGE",
		10: "TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_RESPONSE",
	}
	TerminalFrameKind_value = map[string]int32{
		"TERMINAL_FRAME_KIND_UNKNOWN":                      0,
		"TERMINAL_FRAME_KIND_OPEN":                         1,
		"TERMINAL_FRAME_KIND_READY":                        2,
		"TERMINAL_FRAME_KIND_INPUT":                        3,
		"TERMINAL_FRAME_KIND_OUTPUT":                       4,
		"TERMINAL_FRAME_KIND_RESIZE":                       5,
		"TERMINAL_FRAME_KIND_CLOSE":                        6,
		"TERMINAL_FRAME_KIND_EXIT":                         7,
		"TERMINAL_FRAME_KIND_ERROR":                        8,
		"TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_CHALLENGE": 9,
		"TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_RESPONSE":  10,
	}
)

Enum value maps for TerminalFrameKind.

View Source
var (
	TerminalTargetKind_name = map[int32]string{
		0: "TERMINAL_TARGET_KIND_UNKNOWN",
		1: "TERMINAL_TARGET_KIND_DEVICE",
		2: "TERMINAL_TARGET_KIND_SSH_HOST",
	}
	TerminalTargetKind_value = map[string]int32{
		"TERMINAL_TARGET_KIND_UNKNOWN":  0,
		"TERMINAL_TARGET_KIND_DEVICE":   1,
		"TERMINAL_TARGET_KIND_SSH_HOST": 2,
	}
)

Enum value maps for TerminalTargetKind.

View Source
var CreateTerminalOpId = "spacewave/terminal/create"

CreateTerminalOpId is the operation id for CreateTerminalOp.

Functions

func LookupCreateTerminalOp

func LookupCreateTerminalOp(ctx context.Context, operationTypeID string) (world.Operation, error)

LookupCreateTerminalOp looks up a CreateTerminalOp operation type.

func NewCreateTerminalOpBlock

func NewCreateTerminalOpBlock() block.Block

NewCreateTerminalOpBlock constructs a CreateTerminalOp block.

func NewSRPCTerminalResourceServiceHandler

func NewSRPCTerminalResourceServiceHandler(impl SRPCTerminalResourceServiceServer, serviceID string) srpc.Handler

NewSRPCTerminalResourceServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: s4wave.terminal.TerminalResourceService

func NewTerminalBlock

func NewTerminalBlock() block.Block

NewTerminalBlock constructs a new Terminal block.

func NormalizeTerminalFrameSize

func NormalizeTerminalFrameSize(cols, rows uint32) (uint32, uint32)

NormalizeTerminalFrameSize fills missing terminal dimensions.

func SRPCRegisterTerminalResourceService

func SRPCRegisterTerminalResourceService(mux srpc.Mux, impl SRPCTerminalResourceServiceServer) error

SRPCRegisterTerminalResourceService registers the implementation with the mux. Uses the default serviceID: s4wave.terminal.TerminalResourceService

Types

type CreateTerminalOp

type CreateTerminalOp struct {

	// ObjectKey is the key to create the Terminal at.
	ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
	// Name is the Terminal display name.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// DeviceObjectKey is the linked Device object key.
	DeviceObjectKey string `protobuf:"bytes,3,opt,name=device_object_key,json=deviceObjectKey,proto3" json:"deviceObjectKey,omitempty"`
	// DevicePeerId is the linked DEVICE session peer id.
	DevicePeerId string `protobuf:"bytes,4,opt,name=device_peer_id,json=devicePeerId,proto3" json:"devicePeerId,omitempty"`
	// Command is the optional command to run.
	Command string `protobuf:"bytes,5,opt,name=command,proto3" json:"command,omitempty"`
	// Environment carries optional KEY=VALUE entries.
	Environment []string `protobuf:"bytes,6,rep,name=environment,proto3" json:"environment,omitempty"`
	// Cols is the initial column count.
	Cols uint32 `protobuf:"varint,7,opt,name=cols,proto3" json:"cols,omitempty"`
	// Rows is the initial row count.
	Rows uint32 `protobuf:"varint,8,opt,name=rows,proto3" json:"rows,omitempty"`
	// Timestamp is the creation timestamp.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// TargetKind selects the terminal session owner.
	TargetKind TerminalTargetKind `protobuf:"varint,10,opt,name=target_kind,json=targetKind,proto3" json:"targetKind,omitempty"`
	// SshHostObjectKey is the linked SSH Host object key for SSH Host terminals.
	SshHostObjectKey string `protobuf:"bytes,11,opt,name=ssh_host_object_key,json=sshHostObjectKey,proto3" json:"sshHostObjectKey,omitempty"`
	// contains filtered or unexported fields
}

CreateTerminalOp creates a Terminal world object.

func NewCreateSshHostTerminalOp

func NewCreateSshHostTerminalOp(objKey, name, sshHostObjKey string, ts time.Time) *CreateTerminalOp

NewCreateSshHostTerminalOp constructs a CreateTerminalOp for an SSH Host target.

func NewCreateTerminalOp

func NewCreateTerminalOp(objKey, name, deviceObjKey, devicePeerID string, ts time.Time) *CreateTerminalOp

NewCreateTerminalOp constructs a new CreateTerminalOp.

func (*CreateTerminalOp) ApplyWorldObjectOp

func (o *CreateTerminalOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	os world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*CreateTerminalOp) ApplyWorldOp

func (o *CreateTerminalOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*CreateTerminalOp) CloneMessageVT

func (m *CreateTerminalOp) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*CreateTerminalOp) CloneVT

func (m *CreateTerminalOp) CloneVT() *CreateTerminalOp

func (*CreateTerminalOp) EqualMessageVT

func (this *CreateTerminalOp) EqualMessageVT(thatMsg any) bool

func (*CreateTerminalOp) EqualVT

func (this *CreateTerminalOp) EqualVT(that *CreateTerminalOp) bool

func (*CreateTerminalOp) GetCols

func (x *CreateTerminalOp) GetCols() uint32

func (*CreateTerminalOp) GetCommand

func (x *CreateTerminalOp) GetCommand() string

func (*CreateTerminalOp) GetDeviceObjectKey

func (x *CreateTerminalOp) GetDeviceObjectKey() string

func (*CreateTerminalOp) GetDevicePeerId

func (x *CreateTerminalOp) GetDevicePeerId() string

func (*CreateTerminalOp) GetEnvironment

func (x *CreateTerminalOp) GetEnvironment() []string

func (*CreateTerminalOp) GetName

func (x *CreateTerminalOp) GetName() string

func (*CreateTerminalOp) GetObjectKey

func (x *CreateTerminalOp) GetObjectKey() string

func (*CreateTerminalOp) GetOperationTypeId

func (o *CreateTerminalOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*CreateTerminalOp) GetRows

func (x *CreateTerminalOp) GetRows() uint32

func (*CreateTerminalOp) GetSshHostObjectKey

func (x *CreateTerminalOp) GetSshHostObjectKey() string

func (*CreateTerminalOp) GetTargetKind

func (x *CreateTerminalOp) GetTargetKind() TerminalTargetKind

func (*CreateTerminalOp) GetTimestamp

func (x *CreateTerminalOp) GetTimestamp() *timestamppb.Timestamp

func (*CreateTerminalOp) MarshalBlock

func (o *CreateTerminalOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary.

func (*CreateTerminalOp) MarshalJSON

func (x *CreateTerminalOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the CreateTerminalOp to JSON.

func (*CreateTerminalOp) MarshalProtoJSON

func (x *CreateTerminalOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the CreateTerminalOp message to JSON.

func (*CreateTerminalOp) MarshalProtoText

func (x *CreateTerminalOp) MarshalProtoText() string

func (*CreateTerminalOp) MarshalToSizedBufferVT

func (m *CreateTerminalOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CreateTerminalOp) MarshalToVT

func (m *CreateTerminalOp) MarshalToVT(dAtA []byte) (int, error)

func (*CreateTerminalOp) MarshalVT

func (m *CreateTerminalOp) MarshalVT() (dAtA []byte, err error)

func (*CreateTerminalOp) ProtoMessage

func (*CreateTerminalOp) ProtoMessage()

func (*CreateTerminalOp) Reset

func (x *CreateTerminalOp) Reset()

func (*CreateTerminalOp) SizeVT

func (m *CreateTerminalOp) SizeVT() (n int)

func (*CreateTerminalOp) String

func (x *CreateTerminalOp) String() string

func (*CreateTerminalOp) UnmarshalBlock

func (o *CreateTerminalOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block from binary.

func (*CreateTerminalOp) UnmarshalJSON

func (x *CreateTerminalOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CreateTerminalOp from JSON.

func (*CreateTerminalOp) UnmarshalProtoJSON

func (x *CreateTerminalOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the CreateTerminalOp message from JSON.

func (*CreateTerminalOp) UnmarshalVT

func (m *CreateTerminalOp) UnmarshalVT(dAtA []byte) error

func (*CreateTerminalOp) Validate

func (o *CreateTerminalOp) Validate() error

Validate performs cursory checks on the op.

type SRPCTerminalResourceServiceClient

type SRPCTerminalResourceServiceClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	WatchTerminalState(ctx context.Context, in *WatchTerminalStateRequest) (SRPCTerminalResourceService_WatchTerminalStateClient, error)

	ConnectTerminal(ctx context.Context) (SRPCTerminalResourceService_ConnectTerminalClient, error)
}

func NewSRPCTerminalResourceServiceClient

func NewSRPCTerminalResourceServiceClient(cc srpc.Client) SRPCTerminalResourceServiceClient

func NewSRPCTerminalResourceServiceClientWithServiceID

func NewSRPCTerminalResourceServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCTerminalResourceServiceClient

type SRPCTerminalResourceServiceHandler

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

func (SRPCTerminalResourceServiceHandler) GetMethodIDs

func (SRPCTerminalResourceServiceHandler) GetMethodIDs() []string

func (*SRPCTerminalResourceServiceHandler) GetServiceID

func (d *SRPCTerminalResourceServiceHandler) GetServiceID() string

func (*SRPCTerminalResourceServiceHandler) InvokeMethod

func (d *SRPCTerminalResourceServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCTerminalResourceServiceHandler) InvokeMethod_ConnectTerminal

func (SRPCTerminalResourceServiceHandler) InvokeMethod_WatchTerminalState

func (SRPCTerminalResourceServiceHandler) InvokeMethod_WatchTerminalState(impl SRPCTerminalResourceServiceServer, strm srpc.Stream) error

type SRPCTerminalResourceService_ConnectTerminalClient

type SRPCTerminalResourceService_ConnectTerminalClient interface {
	srpc.Stream
	Send(*TerminalFrame) error
	Recv() (*TerminalFrame, error)
	RecvTo(*TerminalFrame) error
}

type SRPCTerminalResourceService_ConnectTerminalStream

type SRPCTerminalResourceService_ConnectTerminalStream interface {
	srpc.Stream
	Send(*TerminalFrame) error
	SendAndClose(*TerminalFrame) error
	Recv() (*TerminalFrame, error)
	RecvTo(*TerminalFrame) error
}

type SRPCTerminalResourceService_WatchTerminalStateClient

type SRPCTerminalResourceService_WatchTerminalStateClient interface {
	srpc.Stream
	Recv() (*WatchTerminalStateResponse, error)
	RecvTo(*WatchTerminalStateResponse) error
}

type SRPCTerminalResourceService_WatchTerminalStateStream

type SRPCTerminalResourceService_WatchTerminalStateStream interface {
	srpc.Stream
	Send(*WatchTerminalStateResponse) error
	SendAndClose(*WatchTerminalStateResponse) error
}

type Terminal

type Terminal struct {

	// Name is the display name for this terminal.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// DeviceObjectKey is the linked Spacewave-managed Device object key.
	DeviceObjectKey string `protobuf:"bytes,2,opt,name=device_object_key,json=deviceObjectKey,proto3" json:"deviceObjectKey,omitempty"`
	// DevicePeerId is the DEVICE session peer id to open the shell stream to.
	DevicePeerId string `protobuf:"bytes,3,opt,name=device_peer_id,json=devicePeerId,proto3" json:"devicePeerId,omitempty"`
	// Command is the optional command to run; empty opens the default shell.
	Command string `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"`
	// Environment contains optional KEY=VALUE entries for the shell process.
	Environment []string `protobuf:"bytes,5,rep,name=environment,proto3" json:"environment,omitempty"`
	// Cols is the requested terminal column count.
	Cols uint32 `protobuf:"varint,6,opt,name=cols,proto3" json:"cols,omitempty"`
	// Rows is the requested terminal row count.
	Rows uint32 `protobuf:"varint,7,opt,name=rows,proto3" json:"rows,omitempty"`
	// State is the current user-visible session state.
	State TerminalSessionState `protobuf:"varint,8,opt,name=state,proto3" json:"state,omitempty"`
	// Status is a short operator-visible status.
	Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
	// Error is the last terminal error, if any.
	Error string `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"`
	// CreatedAt is when this Terminal object was created.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"createdAt,omitempty"`
	// UpdatedAt is when this Terminal object was last updated.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updatedAt,omitempty"`
	// TargetKind selects the terminal session owner.
	TargetKind TerminalTargetKind `protobuf:"varint,13,opt,name=target_kind,json=targetKind,proto3" json:"targetKind,omitempty"`
	// SshHostObjectKey is the linked SSH Host object key for SSH Host terminals.
	SshHostObjectKey string `protobuf:"bytes,14,opt,name=ssh_host_object_key,json=sshHostObjectKey,proto3" json:"sshHostObjectKey,omitempty"`
	// contains filtered or unexported fields
}

Terminal is the world-block state for a durable remote shell tab.

func UnmarshalTerminal

func UnmarshalTerminal(ctx context.Context, bcs *block.Cursor) (*Terminal, error)

UnmarshalTerminal unmarshals a Terminal from a cursor.

func (*Terminal) CloneMessageVT

func (m *Terminal) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Terminal) CloneVT

func (m *Terminal) CloneVT() *Terminal

func (*Terminal) EqualMessageVT

func (this *Terminal) EqualMessageVT(thatMsg any) bool

func (*Terminal) EqualVT

func (this *Terminal) EqualVT(that *Terminal) bool

func (*Terminal) GetCols

func (x *Terminal) GetCols() uint32

func (*Terminal) GetCommand

func (x *Terminal) GetCommand() string

func (*Terminal) GetCreatedAt

func (x *Terminal) GetCreatedAt() *timestamppb.Timestamp

func (*Terminal) GetDeviceObjectKey

func (x *Terminal) GetDeviceObjectKey() string

func (*Terminal) GetDevicePeerId

func (x *Terminal) GetDevicePeerId() string

func (*Terminal) GetEnvironment

func (x *Terminal) GetEnvironment() []string

func (*Terminal) GetError

func (x *Terminal) GetError() string

func (*Terminal) GetName

func (x *Terminal) GetName() string

func (*Terminal) GetRows

func (x *Terminal) GetRows() uint32

func (*Terminal) GetSshHostObjectKey

func (x *Terminal) GetSshHostObjectKey() string

func (*Terminal) GetState

func (x *Terminal) GetState() TerminalSessionState

func (*Terminal) GetStatus

func (x *Terminal) GetStatus() string

func (*Terminal) GetTargetKind

func (x *Terminal) GetTargetKind() TerminalTargetKind

func (*Terminal) GetUpdatedAt

func (x *Terminal) GetUpdatedAt() *timestamppb.Timestamp

func (*Terminal) MarshalBlock

func (t *Terminal) MarshalBlock() ([]byte, error)

MarshalBlock marshals the Terminal to bytes.

func (*Terminal) MarshalJSON

func (x *Terminal) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Terminal to JSON.

func (*Terminal) MarshalProtoJSON

func (x *Terminal) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Terminal message to JSON.

func (*Terminal) MarshalProtoText

func (x *Terminal) MarshalProtoText() string

func (*Terminal) MarshalToSizedBufferVT

func (m *Terminal) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Terminal) MarshalToVT

func (m *Terminal) MarshalToVT(dAtA []byte) (int, error)

func (*Terminal) MarshalVT

func (m *Terminal) MarshalVT() (dAtA []byte, err error)

func (*Terminal) ProtoMessage

func (*Terminal) ProtoMessage()

func (*Terminal) Reset

func (x *Terminal) Reset()

func (*Terminal) SizeVT

func (m *Terminal) SizeVT() (n int)

func (*Terminal) String

func (x *Terminal) String() string

func (*Terminal) UnmarshalBlock

func (t *Terminal) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the Terminal from bytes.

func (*Terminal) UnmarshalJSON

func (x *Terminal) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Terminal from JSON.

func (*Terminal) UnmarshalProtoJSON

func (x *Terminal) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Terminal message from JSON.

func (*Terminal) UnmarshalVT

func (m *Terminal) UnmarshalVT(dAtA []byte) error

func (*Terminal) Validate

func (t *Terminal) Validate() error

Validate performs cursory checks on the Terminal block.

type TerminalFrame

type TerminalFrame struct {

	// Kind is the frame type.
	Kind TerminalFrameKind `protobuf:"varint,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// Data carries input or output bytes.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// Cols is the terminal column count for OPEN or RESIZE.
	Cols uint32 `protobuf:"varint,3,opt,name=cols,proto3" json:"cols,omitempty"`
	// Rows is the terminal row count for OPEN or RESIZE.
	Rows uint32 `protobuf:"varint,4,opt,name=rows,proto3" json:"rows,omitempty"`
	// Command is the optional command for OPEN.
	Command string `protobuf:"bytes,5,opt,name=command,proto3" json:"command,omitempty"`
	// Environment carries optional KEY=VALUE entries for OPEN.
	Environment []string `protobuf:"bytes,6,rep,name=environment,proto3" json:"environment,omitempty"`
	// Error is the error message for ERROR.
	Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
	// ExitCode is the process exit code for EXIT.
	ExitCode int32 `protobuf:"varint,8,opt,name=exit_code,json=exitCode,proto3" json:"exitCode,omitempty"`
	// SshTrustHost is the host that presented an unknown SSH host key.
	SshTrustHost string `protobuf:"bytes,9,opt,name=ssh_trust_host,json=sshTrustHost,proto3" json:"sshTrustHost,omitempty"`
	// SshTrustAlgorithm is the presented SSH host key algorithm.
	SshTrustAlgorithm string `protobuf:"bytes,10,opt,name=ssh_trust_algorithm,json=sshTrustAlgorithm,proto3" json:"sshTrustAlgorithm,omitempty"`
	// SshTrustSha256Fingerprint is the presented SSH host key SHA256 fingerprint.
	SshTrustSha256Fingerprint string `` /* 138-byte string literal not displayed */
	// SshTrustPublicKey is the presented SSH host public key in authorized_keys format.
	SshTrustPublicKey string `protobuf:"bytes,12,opt,name=ssh_trust_public_key,json=sshTrustPublicKey,proto3" json:"sshTrustPublicKey,omitempty"`
	// SshTrustAccepted is true when the viewer explicitly accepted the presented SSH host key.
	SshTrustAccepted bool `protobuf:"varint,13,opt,name=ssh_trust_accepted,json=sshTrustAccepted,proto3" json:"sshTrustAccepted,omitempty"`
	// contains filtered or unexported fields
}

TerminalFrame carries terminal data and control frames.

func (*TerminalFrame) CloneMessageVT

func (m *TerminalFrame) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TerminalFrame) CloneVT

func (m *TerminalFrame) CloneVT() *TerminalFrame

func (*TerminalFrame) EqualMessageVT

func (this *TerminalFrame) EqualMessageVT(thatMsg any) bool

func (*TerminalFrame) EqualVT

func (this *TerminalFrame) EqualVT(that *TerminalFrame) bool

func (*TerminalFrame) GetCols

func (x *TerminalFrame) GetCols() uint32

func (*TerminalFrame) GetCommand

func (x *TerminalFrame) GetCommand() string

func (*TerminalFrame) GetData

func (x *TerminalFrame) GetData() []byte

func (*TerminalFrame) GetEnvironment

func (x *TerminalFrame) GetEnvironment() []string

func (*TerminalFrame) GetError

func (x *TerminalFrame) GetError() string

func (*TerminalFrame) GetExitCode

func (x *TerminalFrame) GetExitCode() int32

func (*TerminalFrame) GetKind

func (x *TerminalFrame) GetKind() TerminalFrameKind

func (*TerminalFrame) GetRows

func (x *TerminalFrame) GetRows() uint32

func (*TerminalFrame) GetSshTrustAccepted added in v0.52.0

func (x *TerminalFrame) GetSshTrustAccepted() bool

func (*TerminalFrame) GetSshTrustAlgorithm added in v0.52.0

func (x *TerminalFrame) GetSshTrustAlgorithm() string

func (*TerminalFrame) GetSshTrustHost added in v0.52.0

func (x *TerminalFrame) GetSshTrustHost() string

func (*TerminalFrame) GetSshTrustPublicKey added in v0.52.0

func (x *TerminalFrame) GetSshTrustPublicKey() string

func (*TerminalFrame) GetSshTrustSha256Fingerprint added in v0.52.0

func (x *TerminalFrame) GetSshTrustSha256Fingerprint() string

func (*TerminalFrame) MarshalJSON

func (x *TerminalFrame) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TerminalFrame to JSON.

func (*TerminalFrame) MarshalProtoJSON

func (x *TerminalFrame) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TerminalFrame message to JSON.

func (*TerminalFrame) MarshalProtoText

func (x *TerminalFrame) MarshalProtoText() string

func (*TerminalFrame) MarshalToSizedBufferVT

func (m *TerminalFrame) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TerminalFrame) MarshalToVT

func (m *TerminalFrame) MarshalToVT(dAtA []byte) (int, error)

func (*TerminalFrame) MarshalVT

func (m *TerminalFrame) MarshalVT() (dAtA []byte, err error)

func (*TerminalFrame) ProtoMessage

func (*TerminalFrame) ProtoMessage()

func (*TerminalFrame) Reset

func (x *TerminalFrame) Reset()

func (*TerminalFrame) SizeVT

func (m *TerminalFrame) SizeVT() (n int)

func (*TerminalFrame) String

func (x *TerminalFrame) String() string

func (*TerminalFrame) UnmarshalJSON

func (x *TerminalFrame) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TerminalFrame from JSON.

func (*TerminalFrame) UnmarshalProtoJSON

func (x *TerminalFrame) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TerminalFrame message from JSON.

func (*TerminalFrame) UnmarshalVT

func (m *TerminalFrame) UnmarshalVT(dAtA []byte) error

type TerminalFrameKind

type TerminalFrameKind int32

TerminalFrameKind is the frame type for terminal Resource and Bifrost streams.

const (
	// TERMINAL_FRAME_KIND_UNKNOWN is unset.
	TerminalFrameKind_TERMINAL_FRAME_KIND_UNKNOWN TerminalFrameKind = 0
	// TERMINAL_FRAME_KIND_OPEN carries the initial command and terminal size.
	TerminalFrameKind_TERMINAL_FRAME_KIND_OPEN TerminalFrameKind = 1
	// TERMINAL_FRAME_KIND_READY means the PTY is attached.
	TerminalFrameKind_TERMINAL_FRAME_KIND_READY TerminalFrameKind = 2
	// TERMINAL_FRAME_KIND_INPUT carries bytes from the viewer to the PTY.
	TerminalFrameKind_TERMINAL_FRAME_KIND_INPUT TerminalFrameKind = 3
	// TERMINAL_FRAME_KIND_OUTPUT carries bytes from the PTY to the viewer.
	TerminalFrameKind_TERMINAL_FRAME_KIND_OUTPUT TerminalFrameKind = 4
	// TERMINAL_FRAME_KIND_RESIZE carries terminal dimensions.
	TerminalFrameKind_TERMINAL_FRAME_KIND_RESIZE TerminalFrameKind = 5
	// TERMINAL_FRAME_KIND_CLOSE requests a clean close.
	TerminalFrameKind_TERMINAL_FRAME_KIND_CLOSE TerminalFrameKind = 6
	// TERMINAL_FRAME_KIND_EXIT reports process exit.
	TerminalFrameKind_TERMINAL_FRAME_KIND_EXIT TerminalFrameKind = 7
	// TERMINAL_FRAME_KIND_ERROR reports a terminal stream error.
	TerminalFrameKind_TERMINAL_FRAME_KIND_ERROR TerminalFrameKind = 8
	// TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_CHALLENGE asks the viewer to confirm a first-connect SSH Host key.
	TerminalFrameKind_TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_CHALLENGE TerminalFrameKind = 9
	// TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_RESPONSE carries the viewer's SSH Host key trust decision.
	TerminalFrameKind_TERMINAL_FRAME_KIND_SSH_HOST_KEY_TRUST_RESPONSE TerminalFrameKind = 10
)

func (TerminalFrameKind) Enum

func (TerminalFrameKind) MarshalJSON

func (x TerminalFrameKind) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TerminalFrameKind to JSON.

func (TerminalFrameKind) MarshalProtoJSON

func (x TerminalFrameKind) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TerminalFrameKind to JSON.

func (TerminalFrameKind) MarshalProtoText

func (x TerminalFrameKind) MarshalProtoText() string

func (TerminalFrameKind) MarshalText

func (x TerminalFrameKind) MarshalText() ([]byte, error)

MarshalText marshals the TerminalFrameKind to text.

func (TerminalFrameKind) String

func (x TerminalFrameKind) String() string

func (*TerminalFrameKind) UnmarshalJSON

func (x *TerminalFrameKind) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TerminalFrameKind from JSON.

func (*TerminalFrameKind) UnmarshalProtoJSON

func (x *TerminalFrameKind) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TerminalFrameKind from JSON.

func (*TerminalFrameKind) UnmarshalText

func (x *TerminalFrameKind) UnmarshalText(b []byte) error

UnmarshalText unmarshals the TerminalFrameKind from text.

type TerminalResource

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

TerminalResource implements the TerminalResourceService SRPC interface.

func NewTerminalResource

func NewTerminalResource(
	b bus.Bus,
	ws world.WorldState,
	engine world.Engine,
	objKey string,
	state *Terminal,
) *TerminalResource

NewTerminalResource creates a new TerminalResource.

func (*TerminalResource) ConnectTerminal

ConnectTerminal opens the live stream for this Terminal target.

func (*TerminalResource) GetMux

func (r *TerminalResource) GetMux() srpc.Mux

GetMux returns the srpc mux for this resource.

func (*TerminalResource) WatchTerminalState

WatchTerminalState streams Terminal state changes from world object revisions.

type TerminalSessionState

type TerminalSessionState int32

TerminalSessionState is the user-visible lifecycle for a Terminal object.

const (
	// TERMINAL_SESSION_STATE_UNKNOWN is unset.
	TerminalSessionState_TERMINAL_SESSION_STATE_UNKNOWN TerminalSessionState = 0
	// TERMINAL_SESSION_STATE_CONNECTING means a remote shell stream is opening.
	TerminalSessionState_TERMINAL_SESSION_STATE_CONNECTING TerminalSessionState = 1
	// TERMINAL_SESSION_STATE_ACTIVE means the PTY stream is active.
	TerminalSessionState_TERMINAL_SESSION_STATE_ACTIVE TerminalSessionState = 2
	// TERMINAL_SESSION_STATE_DISCONNECTED means the stream ended.
	TerminalSessionState_TERMINAL_SESSION_STATE_DISCONNECTED TerminalSessionState = 3
	// TERMINAL_SESSION_STATE_FAILED means opening or running the stream failed.
	TerminalSessionState_TERMINAL_SESSION_STATE_FAILED TerminalSessionState = 4
	// TERMINAL_SESSION_STATE_CLOSED means the user closed the terminal.
	TerminalSessionState_TERMINAL_SESSION_STATE_CLOSED TerminalSessionState = 5
)

func (TerminalSessionState) Enum

func (TerminalSessionState) MarshalJSON

func (x TerminalSessionState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TerminalSessionState to JSON.

func (TerminalSessionState) MarshalProtoJSON

func (x TerminalSessionState) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TerminalSessionState to JSON.

func (TerminalSessionState) MarshalProtoText

func (x TerminalSessionState) MarshalProtoText() string

func (TerminalSessionState) MarshalText

func (x TerminalSessionState) MarshalText() ([]byte, error)

MarshalText marshals the TerminalSessionState to text.

func (TerminalSessionState) String

func (x TerminalSessionState) String() string

func (*TerminalSessionState) UnmarshalJSON

func (x *TerminalSessionState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TerminalSessionState from JSON.

func (*TerminalSessionState) UnmarshalProtoJSON

func (x *TerminalSessionState) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TerminalSessionState from JSON.

func (*TerminalSessionState) UnmarshalText

func (x *TerminalSessionState) UnmarshalText(b []byte) error

UnmarshalText unmarshals the TerminalSessionState from text.

type TerminalTargetKind

type TerminalTargetKind int32

TerminalTargetKind selects the owner that opens the live terminal session.

const (
	// TERMINAL_TARGET_KIND_UNKNOWN preserves old Device terminals when Device fields are set.
	TerminalTargetKind_TERMINAL_TARGET_KIND_UNKNOWN TerminalTargetKind = 0
	// TERMINAL_TARGET_KIND_DEVICE opens a Spacewave-managed Device remote shell.
	TerminalTargetKind_TERMINAL_TARGET_KIND_DEVICE TerminalTargetKind = 1
	// TERMINAL_TARGET_KIND_SSH_HOST opens an SSH-only Host session.
	TerminalTargetKind_TERMINAL_TARGET_KIND_SSH_HOST TerminalTargetKind = 2
)

func EffectiveTerminalTargetKind

func EffectiveTerminalTargetKind(t *Terminal) TerminalTargetKind

EffectiveTerminalTargetKind resolves old Device terminals with no explicit target kind.

func (TerminalTargetKind) Enum

func (TerminalTargetKind) MarshalJSON

func (x TerminalTargetKind) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TerminalTargetKind to JSON.

func (TerminalTargetKind) MarshalProtoJSON

func (x TerminalTargetKind) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TerminalTargetKind to JSON.

func (TerminalTargetKind) MarshalProtoText

func (x TerminalTargetKind) MarshalProtoText() string

func (TerminalTargetKind) MarshalText

func (x TerminalTargetKind) MarshalText() ([]byte, error)

MarshalText marshals the TerminalTargetKind to text.

func (TerminalTargetKind) String

func (x TerminalTargetKind) String() string

func (*TerminalTargetKind) UnmarshalJSON

func (x *TerminalTargetKind) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TerminalTargetKind from JSON.

func (*TerminalTargetKind) UnmarshalProtoJSON

func (x *TerminalTargetKind) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TerminalTargetKind from JSON.

func (*TerminalTargetKind) UnmarshalText

func (x *TerminalTargetKind) UnmarshalText(b []byte) error

UnmarshalText unmarshals the TerminalTargetKind from text.

type WatchTerminalStateRequest

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

WatchTerminalStateRequest is a request to watch Terminal state.

func (*WatchTerminalStateRequest) CloneMessageVT

func (*WatchTerminalStateRequest) CloneVT

func (*WatchTerminalStateRequest) EqualMessageVT

func (this *WatchTerminalStateRequest) EqualMessageVT(thatMsg any) bool

func (*WatchTerminalStateRequest) EqualVT

func (*WatchTerminalStateRequest) MarshalJSON

func (x *WatchTerminalStateRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WatchTerminalStateRequest to JSON.

func (*WatchTerminalStateRequest) MarshalProtoJSON

func (x *WatchTerminalStateRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WatchTerminalStateRequest message to JSON.

func (*WatchTerminalStateRequest) MarshalProtoText

func (x *WatchTerminalStateRequest) MarshalProtoText() string

func (*WatchTerminalStateRequest) MarshalToSizedBufferVT

func (m *WatchTerminalStateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WatchTerminalStateRequest) MarshalToVT

func (m *WatchTerminalStateRequest) MarshalToVT(dAtA []byte) (int, error)

func (*WatchTerminalStateRequest) MarshalVT

func (m *WatchTerminalStateRequest) MarshalVT() (dAtA []byte, err error)

func (*WatchTerminalStateRequest) ProtoMessage

func (*WatchTerminalStateRequest) ProtoMessage()

func (*WatchTerminalStateRequest) Reset

func (x *WatchTerminalStateRequest) Reset()

func (*WatchTerminalStateRequest) SizeVT

func (m *WatchTerminalStateRequest) SizeVT() (n int)

func (*WatchTerminalStateRequest) String

func (x *WatchTerminalStateRequest) String() string

func (*WatchTerminalStateRequest) UnmarshalJSON

func (x *WatchTerminalStateRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WatchTerminalStateRequest from JSON.

func (*WatchTerminalStateRequest) UnmarshalProtoJSON

func (x *WatchTerminalStateRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WatchTerminalStateRequest message from JSON.

func (*WatchTerminalStateRequest) UnmarshalVT

func (m *WatchTerminalStateRequest) UnmarshalVT(dAtA []byte) error

type WatchTerminalStateResponse

type WatchTerminalStateResponse struct {

	// State is the current Terminal block state.
	State *Terminal `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

WatchTerminalStateResponse contains the current Terminal state.

func (*WatchTerminalStateResponse) CloneMessageVT

func (*WatchTerminalStateResponse) CloneVT

func (*WatchTerminalStateResponse) EqualMessageVT

func (this *WatchTerminalStateResponse) EqualMessageVT(thatMsg any) bool

func (*WatchTerminalStateResponse) EqualVT

func (*WatchTerminalStateResponse) GetState

func (x *WatchTerminalStateResponse) GetState() *Terminal

func (*WatchTerminalStateResponse) MarshalJSON

func (x *WatchTerminalStateResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WatchTerminalStateResponse to JSON.

func (*WatchTerminalStateResponse) MarshalProtoJSON

func (x *WatchTerminalStateResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WatchTerminalStateResponse message to JSON.

func (*WatchTerminalStateResponse) MarshalProtoText

func (x *WatchTerminalStateResponse) MarshalProtoText() string

func (*WatchTerminalStateResponse) MarshalToSizedBufferVT

func (m *WatchTerminalStateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WatchTerminalStateResponse) MarshalToVT

func (m *WatchTerminalStateResponse) MarshalToVT(dAtA []byte) (int, error)

func (*WatchTerminalStateResponse) MarshalVT

func (m *WatchTerminalStateResponse) MarshalVT() (dAtA []byte, err error)

func (*WatchTerminalStateResponse) ProtoMessage

func (*WatchTerminalStateResponse) ProtoMessage()

func (*WatchTerminalStateResponse) Reset

func (x *WatchTerminalStateResponse) Reset()

func (*WatchTerminalStateResponse) SizeVT

func (m *WatchTerminalStateResponse) SizeVT() (n int)

func (*WatchTerminalStateResponse) String

func (x *WatchTerminalStateResponse) String() string

func (*WatchTerminalStateResponse) UnmarshalJSON

func (x *WatchTerminalStateResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WatchTerminalStateResponse from JSON.

func (*WatchTerminalStateResponse) UnmarshalProtoJSON

func (x *WatchTerminalStateResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WatchTerminalStateResponse message from JSON.

func (*WatchTerminalStateResponse) UnmarshalVT

func (m *WatchTerminalStateResponse) UnmarshalVT(dAtA []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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