Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents a client to an OBS websockets server.
func New ¶
New creates and configures a client to interact with the OBS websockets server. It also opens up a connection, so be sure to check the error.
func (*Client) Disconnect ¶ added in v0.9.0
Disconnect sends a message to the OBS websocket server to close the client's open connection. You don't really have to do this as any connections should close when your program terminates or interrupts. But here's a function anyways.
type Option ¶
type Option func(*Client)
Option represents a functional option of a Client.
func WithDialer ¶ added in v0.8.0
WithDialer sets the underlying Gorilla WebSocket Dialer (see https://pkg.go.dev/github.com/gorilla/websocket#Dialer), should one want to customize things like the handshake timeout or TLS configuration. If this is not set, it'll use the provided DefaultDialer (see https://pkg.go.dev/github.com/gorilla/websocket#pkg-variables).
func WithEventSubscriptions ¶ added in v0.9.0
WithEventSubscriptions specifies the events we'd like to susbcribe to via `client.Listen()`. The value is a bitmask of any of the subscription values specified in api/events/subscriptions. By default, all event categories are subscribed, except for events marked as high volume. High volume events must be explicitly subscribed to.
func WithLogger ¶ added in v0.7.1
WithLogger sets the logger this library will use. See the logger.Logger interface. Should be compatible with most third-party loggers.
func WithRequestHeader ¶ added in v0.8.0
WithRequestHeader sets custom headers our client can send when trying to connect to the WebSockets server, allowing us specify the origin, subprotocols, or the user agent.
func WithResponseTimeout ¶ added in v0.8.0
WithResponseTimeout sets the time we're willing to wait to receive a response from the server for any request, before responding with an error. It's in milliseconds. The default timeout is 10 seconds.