opcodes

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	Challenge string `json:"challenge"`
	Salt      string `json:"salt"`
}

type Event

type Event struct {
	Type   string          `json:"eventType"`
	Intent int             `json:"eventIntent"`
	Data   json.RawMessage `json:"eventData"`
}

server -> client https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#event-opcode-5

type Hello

type Hello struct {
	ObsWebSocketVersion string         `json:"obsWebSocketVersion"`
	RPCVersion          int            `json:"rpcVersion"`
	Authentication      Authentication `json:"authentication"`
}

server -> client https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#hello-opcode-0

type Identified

type Identified struct {
	NegotiatedRPCVersion int `json:"negotiatedRpcVersion"`
}

server -> client https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#identified-opcode-2

type Identify

type Identify struct {
	RPCVersion         int    `json:"rpcVersion"`
	Authentication     string `json:"authentication"`
	EventSubscriptions int    `json:"eventSubscriptions"`
}

client -> server https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#identify-opcode-1

type Message

type Message struct {
	Op int             `json:"op"`
	D  json.RawMessage `json:"d"`
}

func Wrap

func Wrap(o Opcode) *Message

Wrap wraps an opcode around an enclosing protocol Message

func (*Message) Bytes

func (o *Message) Bytes() json.RawMessage

func (*Message) String

func (o *Message) String() string

type Opcode

type Opcode interface {
	// contains filtered or unexported methods
}

func GetOpcodeForOp

func GetOpcodeForOp(code int) Opcode

func ParseRawMessage

func ParseRawMessage(raw json.RawMessage) (Opcode, error)

type Reidentify

type Reidentify struct {
	EventSubscriptions int `json:"eventSubscriptions"`
}

client -> server https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#reidentify-opcode-3

type Request

type Request struct {
	Type string `json:"requestType"`
	ID   string `json:"requestId"`
	Data any    `json:"requestData,omitempty"`
}

client -> server https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#request-opcode-6

type RequestResponse

type RequestResponse struct {
	Type   string                `json:"requestType"`
	ID     string                `json:"requestId"`
	Status RequestResponseStatus `json:"requestStatus"`
	Data   json.RawMessage       `json:"responseData,omitempty"`
}

server -> client https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#requestresponse-opcode-7

type RequestResponseStatus

type RequestResponseStatus struct {
	Code    int    `json:"code"`
	Result  bool   `json:"result"`
	Comment string `json:"comment,omitempty"`
}

Jump to

Keyboard shortcuts

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