Documentation
¶
Index ¶
- type BroadcastCustomEventParams
- type BroadcastCustomEventResponse
- type CallVendorRequestParams
- type CallVendorRequestResponse
- type Client
- func (c *Client) BroadcastCustomEvent(params *BroadcastCustomEventParams) (*BroadcastCustomEventResponse, error)
- func (c *Client) CallVendorRequest(params *CallVendorRequestParams) (*CallVendorRequestResponse, error)
- func (c *Client) GetHotkeyList(paramss ...*GetHotkeyListParams) (*GetHotkeyListResponse, error)
- func (c *Client) GetStats(paramss ...*GetStatsParams) (*GetStatsResponse, error)
- func (c *Client) GetVersion(paramss ...*GetVersionParams) (*GetVersionResponse, error)
- func (c *Client) Sleep(paramss ...*SleepParams) (*SleepResponse, error)
- func (c *Client) TriggerHotkeyByKeySequence(paramss ...*TriggerHotkeyByKeySequenceParams) (*TriggerHotkeyByKeySequenceResponse, error)
- func (c *Client) TriggerHotkeyByName(params *TriggerHotkeyByNameParams) (*TriggerHotkeyByNameResponse, error)
- type GetHotkeyListParams
- type GetHotkeyListResponse
- type GetStatsParams
- type GetStatsResponse
- type GetVersionParams
- type GetVersionResponse
- type SleepParams
- type SleepResponse
- type TriggerHotkeyByKeySequenceParams
- type TriggerHotkeyByKeySequenceResponse
- type TriggerHotkeyByNameParams
- type TriggerHotkeyByNameResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastCustomEventParams ¶
type BroadcastCustomEventParams struct {
// Data payload to emit to all receivers
EventData interface{} `json:"eventData,omitempty"`
}
Represents the request body for the BroadcastCustomEvent request.
func (*BroadcastCustomEventParams) GetRequestName ¶
func (o *BroadcastCustomEventParams) GetRequestName() string
Returns the associated request.
type BroadcastCustomEventResponse ¶
type BroadcastCustomEventResponse struct{}
Represents the response body for the BroadcastCustomEvent request.
type CallVendorRequestParams ¶
type CallVendorRequestParams struct {
// Object containing appropriate request data
RequestData interface{} `json:"requestData,omitempty"`
// The request type to call
RequestType string `json:"requestType,omitempty"`
// Name of the vendor to use
VendorName string `json:"vendorName,omitempty"`
}
Represents the request body for the CallVendorRequest request.
func (*CallVendorRequestParams) GetRequestName ¶
func (o *CallVendorRequestParams) GetRequestName() string
Returns the associated request.
type CallVendorRequestResponse ¶
type CallVendorRequestResponse struct {
// Echoed of `requestType`
RequestType string `json:"requestType,omitempty"`
// Object containing appropriate response data. {} if request does not provide any response data
ResponseData interface{} `json:"responseData,omitempty"`
// Echoed of `vendorName`
VendorName string `json:"vendorName,omitempty"`
}
Represents the response body for the CallVendorRequest request.
type Client ¶
Client represents a client for 'general' requests.
func (*Client) BroadcastCustomEvent ¶
func (c *Client) BroadcastCustomEvent(params *BroadcastCustomEventParams) (*BroadcastCustomEventResponse, error)
Broadcasts a `CustomEvent` to all WebSocket clients. Receivers are clients which are identified and subscribed.
func (*Client) CallVendorRequest ¶
func (c *Client) CallVendorRequest(params *CallVendorRequestParams) (*CallVendorRequestResponse, error)
Call a request registered to a vendor.
A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them.
func (*Client) GetHotkeyList ¶
func (c *Client) GetHotkeyList(paramss ...*GetHotkeyListParams) (*GetHotkeyListResponse, error)
Gets an array of all hotkey names in OBS
func (*Client) GetStats ¶
func (c *Client) GetStats(paramss ...*GetStatsParams) (*GetStatsResponse, error)
Gets statistics about OBS, obs-websocket, and the current session.
func (*Client) GetVersion ¶
func (c *Client) GetVersion(paramss ...*GetVersionParams) (*GetVersionResponse, error)
Gets data about the current plugin and RPC version.
func (*Client) Sleep ¶
func (c *Client) Sleep(paramss ...*SleepParams) (*SleepResponse, error)
Sleeps for a time duration or number of frames. Only available in request batches with types `SERIAL_REALTIME` or `SERIAL_FRAME`.
func (*Client) TriggerHotkeyByKeySequence ¶
func (c *Client) TriggerHotkeyByKeySequence( paramss ...*TriggerHotkeyByKeySequenceParams, ) (*TriggerHotkeyByKeySequenceResponse, error)
Triggers a hotkey using a sequence of keys.
func (*Client) TriggerHotkeyByName ¶
func (c *Client) TriggerHotkeyByName(params *TriggerHotkeyByNameParams) (*TriggerHotkeyByNameResponse, error)
Triggers a hotkey using its name. See `GetHotkeyList`
type GetHotkeyListParams ¶
type GetHotkeyListParams struct{}
Represents the request body for the GetHotkeyList request.
func (*GetHotkeyListParams) GetRequestName ¶
func (o *GetHotkeyListParams) GetRequestName() string
Returns the associated request.
type GetHotkeyListResponse ¶
type GetHotkeyListResponse struct {
// Array of hotkey names
Hotkeys []string `json:"hotkeys,omitempty"`
}
Represents the response body for the GetHotkeyList request.
type GetStatsParams ¶
type GetStatsParams struct{}
Represents the request body for the GetStats request.
func (*GetStatsParams) GetRequestName ¶
func (o *GetStatsParams) GetRequestName() string
Returns the associated request.
type GetStatsResponse ¶
type GetStatsResponse struct {
// Current FPS being rendered
ActiveFps float64 `json:"activeFps,omitempty"`
// Available disk space on the device being used for recording storage
AvailableDiskSpace float64 `json:"availableDiskSpace,omitempty"`
// Average time in milliseconds that OBS is taking to render a frame
AverageFrameRenderTime float64 `json:"averageFrameRenderTime,omitempty"`
// Current CPU usage in percent
CpuUsage float64 `json:"cpuUsage,omitempty"`
// Amount of memory in MB currently being used by OBS
MemoryUsage float64 `json:"memoryUsage,omitempty"`
// Number of frames skipped by OBS in the output thread
OutputSkippedFrames float64 `json:"outputSkippedFrames,omitempty"`
// Total number of frames outputted by the output thread
OutputTotalFrames float64 `json:"outputTotalFrames,omitempty"`
// Number of frames skipped by OBS in the render thread
RenderSkippedFrames float64 `json:"renderSkippedFrames,omitempty"`
// Total number of frames outputted by the render thread
RenderTotalFrames float64 `json:"renderTotalFrames,omitempty"`
// Total number of messages received by obs-websocket from the client
WebSocketSessionIncomingMessages float64 `json:"webSocketSessionIncomingMessages,omitempty"`
// Total number of messages sent by obs-websocket to the client
WebSocketSessionOutgoingMessages float64 `json:"webSocketSessionOutgoingMessages,omitempty"`
}
Represents the response body for the GetStats request.
type GetVersionParams ¶
type GetVersionParams struct{}
Represents the request body for the GetVersion request.
func (*GetVersionParams) GetRequestName ¶
func (o *GetVersionParams) GetRequestName() string
Returns the associated request.
type GetVersionResponse ¶
type GetVersionResponse struct {
// Array of available RPC requests for the currently negotiated RPC version
AvailableRequests []string `json:"availableRequests,omitempty"`
// Current OBS Studio version
ObsVersion string `json:"obsVersion,omitempty"`
// Current obs-websocket version
ObsWebSocketVersion string `json:"obsWebSocketVersion,omitempty"`
// Name of the platform. Usually `windows`, `macos`, or `ubuntu` (linux flavor). Not guaranteed to be any of those
Platform string `json:"platform,omitempty"`
// Description of the platform, like `Windows 10 (10.0)`
PlatformDescription string `json:"platformDescription,omitempty"`
// Current latest obs-websocket RPC version
RpcVersion float64 `json:"rpcVersion,omitempty"`
// Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests.
SupportedImageFormats []string `json:"supportedImageFormats,omitempty"`
}
Represents the response body for the GetVersion request.
type SleepParams ¶
type SleepParams struct {
// Number of frames to sleep for (if `SERIAL_FRAME` mode)
SleepFrames float64 `json:"sleepFrames,omitempty"`
// Number of milliseconds to sleep for (if `SERIAL_REALTIME` mode)
SleepMillis float64 `json:"sleepMillis,omitempty"`
}
Represents the request body for the Sleep request.
func (*SleepParams) GetRequestName ¶
func (o *SleepParams) GetRequestName() string
Returns the associated request.
type SleepResponse ¶
type SleepResponse struct{}
Represents the response body for the Sleep request.
type TriggerHotkeyByKeySequenceParams ¶
type TriggerHotkeyByKeySequenceParams struct {
// The OBS key ID to use. See https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h
KeyId string `json:"keyId,omitempty"`
// Key modifiers to apply
KeyModifiers *typedefs.KeyModifiers `json:"keyModifiers,omitempty"`
}
Represents the request body for the TriggerHotkeyByKeySequence request.
func (*TriggerHotkeyByKeySequenceParams) GetRequestName ¶
func (o *TriggerHotkeyByKeySequenceParams) GetRequestName() string
Returns the associated request.
type TriggerHotkeyByKeySequenceResponse ¶
type TriggerHotkeyByKeySequenceResponse struct{}
Represents the response body for the TriggerHotkeyByKeySequence request.
type TriggerHotkeyByNameParams ¶
type TriggerHotkeyByNameParams struct {
// Name of the hotkey to trigger
HotkeyName string `json:"hotkeyName,omitempty"`
}
Represents the request body for the TriggerHotkeyByName request.
func (*TriggerHotkeyByNameParams) GetRequestName ¶
func (o *TriggerHotkeyByNameParams) GetRequestName() string
Returns the associated request.
type TriggerHotkeyByNameResponse ¶
type TriggerHotkeyByNameResponse struct{}
Represents the response body for the TriggerHotkeyByName request.