Documentation
¶
Overview ¶
Package wsclient provides a WebSocket client for communicating with CapyDeploy Agents.
Index ¶
- Variables
- type Client
- func (c *Client) ApplyArtwork(ctx context.Context, userID string, appID uint32, ...) (*protocol.ArtworkResponse, error)
- func (c *Client) CancelUpload(ctx context.Context, uploadID string) error
- func (c *Client) Close() error
- func (c *Client) CompleteUpload(ctx context.Context, uploadID string, createShortcut bool, ...) (*protocol.CompleteUploadResponseFull, error)
- func (c *Client) ConfirmPairing(ctx context.Context, code string) error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) CreateShortcut(ctx context.Context, userID uint32, shortcut protocol.ShortcutConfig) (uint32, error)
- func (c *Client) DeleteGame(ctx context.Context, appID uint32) (*protocol.DeleteGameResponse, error)
- func (c *Client) DeleteShortcut(ctx context.Context, userID string, appID uint32, restartSteam bool) error
- func (c *Client) GetConfig(ctx context.Context) (*protocol.ConfigResponse, error)
- func (c *Client) GetInfo(ctx context.Context) (*protocol.AgentInfo, error)
- func (c *Client) GetSteamUsers(ctx context.Context) ([]protocol.SteamUser, error)
- func (c *Client) InitUpload(ctx context.Context, config protocol.UploadConfig, totalSize int64, ...) (*protocol.InitUploadResponseFull, error)
- func (c *Client) IsConnected() bool
- func (c *Client) ListShortcuts(ctx context.Context, userID uint32) ([]protocol.ShortcutInfo, error)
- func (c *Client) RestartSteam(ctx context.Context) (*protocol.RestartSteamResponse, error)
- func (c *Client) SendArtworkImage(ctx context.Context, appID uint32, artworkType, contentType string, ...) error
- func (c *Client) SetAuth(hubID, agentID string, getToken func(string) string, ...)
- func (c *Client) SetCallbacks(onDisconnect func(), onUploadProgress func(protocol.UploadProgressEvent), ...)
- func (c *Client) SetConsoleLogEnabled(ctx context.Context, enabled bool) (bool, error)
- func (c *Client) SetConsoleLogFilter(ctx context.Context, mask uint32) (uint32, error)
- func (c *Client) SetGameLogWrapper(ctx context.Context, appID uint32, enabled bool) (bool, error)
- func (c *Client) SetPairingCallback(cb func(agentID string))
- func (c *Client) SetPlatform(platform string)
- func (c *Client) UploadChunk(ctx context.Context, uploadID, filePath string, offset int64, data []byte, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrPairingRequired = errors.New("pairing required") ErrPairingFailed = errors.New("pairing failed") )
Errors returned by client operations.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a WebSocket client for communicating with a CapyDeploy Agent.
func (*Client) ApplyArtwork ¶
func (c *Client) ApplyArtwork(ctx context.Context, userID string, appID uint32, artwork *protocol.ArtworkConfig) (*protocol.ArtworkResponse, error)
ApplyArtwork applies artwork to a shortcut.
func (*Client) CancelUpload ¶
CancelUpload cancels an upload session.
func (*Client) CompleteUpload ¶
func (c *Client) CompleteUpload(ctx context.Context, uploadID string, createShortcut bool, shortcut *protocol.ShortcutConfig) (*protocol.CompleteUploadResponseFull, error)
CompleteUpload completes an upload session.
func (*Client) ConfirmPairing ¶
ConfirmPairing sends the pairing code to confirm authentication.
func (*Client) CreateShortcut ¶
func (c *Client) CreateShortcut(ctx context.Context, userID uint32, shortcut protocol.ShortcutConfig) (uint32, error)
CreateShortcut creates a new shortcut.
func (*Client) DeleteGame ¶
func (c *Client) DeleteGame(ctx context.Context, appID uint32) (*protocol.DeleteGameResponse, error)
DeleteGame deletes a game completely. Agent handles everything internally.
func (*Client) DeleteShortcut ¶
func (c *Client) DeleteShortcut(ctx context.Context, userID string, appID uint32, restartSteam bool) error
DeleteShortcut deletes a shortcut.
func (*Client) GetSteamUsers ¶
GetSteamUsers returns Steam users on the agent.
func (*Client) InitUpload ¶
func (c *Client) InitUpload(ctx context.Context, config protocol.UploadConfig, totalSize int64, files []protocol.FileEntry) (*protocol.InitUploadResponseFull, error)
InitUpload initializes an upload session.
func (*Client) IsConnected ¶
IsConnected returns true if the client is connected.
func (*Client) ListShortcuts ¶
ListShortcuts returns shortcuts for a Steam user.
func (*Client) RestartSteam ¶
RestartSteam restarts Steam on the agent.
func (*Client) SendArtworkImage ¶ added in v0.3.0
func (c *Client) SendArtworkImage(ctx context.Context, appID uint32, artworkType, contentType string, data []byte) error
SendArtworkImage sends a binary artwork image to the agent.
func (*Client) SetAuth ¶
func (c *Client) SetAuth(hubID, agentID string, getToken func(string) string, saveToken func(string, string) error)
SetAuth configures authentication for this client.
func (*Client) SetCallbacks ¶
func (c *Client) SetCallbacks( onDisconnect func(), onUploadProgress func(protocol.UploadProgressEvent), onOperationEvent func(protocol.OperationEvent), onTelemetryStatus func(protocol.TelemetryStatusEvent), onTelemetryData func(protocol.TelemetryData), onConsoleLogStatus func(protocol.ConsoleLogStatusEvent), onConsoleLogData func(protocol.ConsoleLogBatch), onGameLogWrapperStatus func(protocol.GameLogWrapperStatusEvent), )
SetCallbacks sets the event callbacks.
func (*Client) SetConsoleLogEnabled ¶ added in v0.6.0
SetConsoleLogEnabled enables or disables console log streaming on the agent. Returns the confirmed enabled state.
func (*Client) SetConsoleLogFilter ¶ added in v0.6.0
SetConsoleLogFilter sets the log level bitmask on the agent. Returns the mask confirmed by the agent.
func (*Client) SetGameLogWrapper ¶ added in v0.6.0
SetGameLogWrapper enables or disables the game log wrapper for a specific game. Returns the confirmed enabled state.
func (*Client) SetPairingCallback ¶
SetPairingCallback sets the callback for when pairing is required.
func (*Client) SetPlatform ¶
SetPlatform sets the hub platform to be sent during connection.