operation

package
Version: v0.0.0-...-9ba4946 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HANDSHAKE    = "handshake"
	CONNECTED    = "connect"
	DISCONNECTED = "disconnect"
	SHUTDOWN     = "shutdown"
	LOCK         = "lock"
	UNLOCK       = "unlock"
	OFFER        = "offser"
	ANSWER       = "answer"
	CANDIDATE    = "candidate"

	LOCK_ERROR   = "lock_error"
	UNLOCK_ERROR = "unlock_error"
	OFFER_ERROR  = "offer_error"
	ANSWER_ERROR = "answer_error"

	USER_NOTFOUND = "user_not_found"
)

Operation signatures

Variables

This section is empty.

Functions

func NewAnswerMessage

func NewAnswerMessage(from, sdp string, extra map[string]string) ([]byte, error)

func NewCandidateMessage

func NewCandidateMessage(from, candidate string) ([]byte, error)

func NewConnectMessage

func NewConnectMessage(userId string) ([]byte, error)

func NewDisconnectMessage

func NewDisconnectMessage(userId string) ([]byte, error)

func NewErrorMessage

func NewErrorMessage(errorType, message string) ([]byte, error)

func NewHandshakeMessage

func NewHandshakeMessage(userId string, users []Users) ([]byte, error)

func NewLockMessage

func NewLockMessage(userId string) ([]byte, error)

func NewOfferMessage

func NewOfferMessage(from, sdp string, extra map[string]string) ([]byte, error)

func NewShutdownMessage

func NewShutdownMessage() ([]byte, error)

func NewUnlockMessage

func NewUnlockMessage(userId string) ([]byte, error)

Types

type Answer

type Answer struct {
	Type   string            `json:"type"`
	Sdp    string            `json:"sdp"`
	Sender string            `json:"sender"`
	Extra  map[string]string `json:"extra"`
}

type Candidate

type Candidate struct {
	Type      string `json:"type"`
	Candidate string `json:"candidate"`
	Sender    string `json:"sender"`
}

type Connect

type Connect struct {
	Type string `json:"type"`
	User string `json:"user"`
}

type Disconnect

type Disconnect struct {
	Type string `json:"type"`
	User string `json:"user"`
}

type Error

type Error struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

type Handshake

type Handshake struct {
	Type  string  `json:"type"`
	UUID  string  `json:"uuid"`
	Users []Users `json:"users"`
}

type Lock

type Lock struct {
	Type string `json:"type"`
	User string `json:"user"`
}

type Offer

type Offer struct {
	Type   string            `json:"type"`
	Sdp    string            `json:"sdp"`
	Sender string            `json:"sender"`
	Extra  map[string]string `json:"extra"`
}

type Operation

type Operation struct {
	Type      string            `json:"type"`
	Sdp       string            `json:"sdp"`
	Candidate string            `json:"candidate"`
	Sender    string            `json:"sender"`
	Target    string            `json:"target"`
	Extra     map[string]string `json:"extra"`
}

type Shutdown

type Shutdown struct {
	Type string `json:"type"`
}

type Unlock

type Unlock struct {
	Type string `json:"type"`
	User string `json:"user"`
}

type Users

type Users struct {
	UUID   string `json:"uuid"`
	Locked bool   `json:"locked"`
	Extra  string `json:"extra"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL