websh

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseSession added in v1.3.4

func CloseSession(ac *client.AlpaconClient, sessionID string) error

func ForceCloseSession added in v1.3.4

func ForceCloseSession(ac *client.AlpaconClient, sessionID string) error

func GetSessionDetail added in v1.3.4

func GetSessionDetail(ac *client.AlpaconClient, sessionID string) ([]byte, error)

func InviteToSession added in v1.3.4

func InviteToSession(ac *client.AlpaconClient, sessionID string, emails []string, readOnly bool) error

func OpenNewTerminal

func OpenNewTerminal(ac *client.AlpaconClient, sessionResponse SessionResponse) error

Handles graceful termination of the websh terminal. Exits on error without further error handling.

func OpenReadOnlyTerminal added in v1.3.4

func OpenReadOnlyTerminal(ac *client.AlpaconClient, sessionResponse SessionResponse) error

OpenReadOnlyTerminal opens a read-only terminal view for watching another user's session. Input is not forwarded to the server. Terminal echo is suppressed via raw mode. Exits cleanly on Ctrl+C or SIGTERM.

Types

type ConnectRequest added in v1.3.4

type ConnectRequest struct {
	Session  string `json:"session"`
	IsMaster bool   `json:"is_master"`
	ReadOnly bool   `json:"read_only"`
}

type InviteRequest added in v1.3.4

type InviteRequest struct {
	Emails   []string `json:"emails"`
	ReadOnly bool     `json:"read_only"`
}

type JoinRequest

type JoinRequest struct {
	Password string `json:"password"`
}

type SessionDetailResponse added in v1.3.4

type SessionDetailResponse struct {
	ID         string              `json:"id"`
	Rows       int                 `json:"rows"`
	Cols       int                 `json:"cols"`
	Server     types.ServerSummary `json:"server"`
	User       types.UserSummary   `json:"user"`
	Username   string              `json:"username"`
	Groupname  string              `json:"groupname"`
	UserAgent  string              `json:"user_agent"`
	RemoteIP   string              `json:"remote_ip"`
	IsTunnel   bool                `json:"is_tunnel"`
	ClientType string              `json:"client_type"`
	AddedAt    string              `json:"added_at"`
	UpdatedAt  string              `json:"updated_at"`
	ClosedAt   *string             `json:"closed_at"`
	Success    bool                `json:"success"`
}

type SessionListItem added in v1.3.4

type SessionListItem struct {
	ID       string `json:"id"        table:"ID"`
	Server   string `json:"server"    table:"Server"`
	User     string `json:"user"      table:"User"`
	Username string `json:"username"  table:"Username"`
	RemoteIP string `json:"remote_ip" table:"Remote IP"`
	AddedAt  string `json:"added_at"  table:"Added At"`
	ClosedAt string `json:"closed_at" table:"Closed At"`
}

func GetSessionList added in v1.3.4

func GetSessionList(ac *client.AlpaconClient) ([]SessionListItem, error)

type SessionRequest

type SessionRequest struct {
	Rows        int    `json:"rows"`
	Cols        int    `json:"cols"`
	Server      string `json:"server"` // server id
	Username    string `json:"username"`
	Groupname   string `json:"groupname"`
	WorkSession string `json:"work_session,omitempty"`
}

func BuildSessionRequest added in v1.4.6

func BuildSessionRequest(serverID, username, groupname string, rows, cols int, workSessionID string) *SessionRequest

BuildSessionRequest assembles the JSON body for a websh session create call. Empty workSessionID is omitted from the wire request via omitempty on the field.

type SessionResponse

type SessionResponse struct {
	ID           string              `json:"id"`
	Rows         int                 `json:"rows"`
	Cols         int                 `json:"cols"`
	Server       types.ServerSummary `json:"server"`
	User         types.UserSummary   `json:"user"`
	Username     string              `json:"username"`
	Groupname    string              `json:"groupname"`
	UserAgent    string              `json:"user_agent"`
	RemoteIP     string              `json:"remote_ip"`
	WebsocketURL string              `json:"websocket_url"`
}

func ConnectToSession added in v1.3.4

func ConnectToSession(ac *client.AlpaconClient, sessionID string) (SessionResponse, error)

func CreateWebshSession

func CreateWebshSession(ac *client.AlpaconClient, serverName, username, groupname string, share, readOnly bool, workSessionID string) (SessionResponse, error)

Create new websh session

func JoinWebshSession

func JoinWebshSession(ac *client.AlpaconClient, sharedURL, password string) (SessionResponse, error)

type ShareRequest

type ShareRequest struct {
	ReadOnly bool `json:"read_only"`
}

type ShareResponse

type ShareResponse struct {
	SharedURL  string    `json:"shared_url"`
	Password   string    `json:"password"`
	ReadOnly   bool      `json:"read_only"`
	Expiration time.Time `json:"expiration"`
}

type WebsocketClient

type WebsocketClient struct {
	Header http.Header

	Done chan error
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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