astijanus

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 10 Imported by: 0

README

// TODO

Documentation

Index

Constants

View Source
const (
	StreamingMountpointTypeLive     = "live"
	StreamingMountpointTypeOnDemand = "ondemand"
	StreamingMountpointTypeRTP      = "rtp"
	StreamingMountpointTypeRSTP     = "rstp"
)

Mountpoint types

View Source
const (
	PluginResultStatusPreparing = "preparing"
)

Variables

View Source
var (
	Addr = flag.String("janus-addr", "", "the Janus addr")
)

Flags

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the client

func New

func New(c Configuration) *Client

New creates a new client

func (*Client) Info added in v0.5.0

func (c *Client) Info(ctx context.Context) (i Info, err error)

func (*Client) NewSession

func (c *Client) NewSession(ctx context.Context) (s *Session, err error)

NewSession creates a new session

type Configuration

type Configuration struct {
	Addr   string `toml:"addr"`
	Sender astikit.HTTPSenderOptions
}

Configuration represents the lib's configuration

func FlagConfig

func FlagConfig() Configuration

FlagConfig generates a Configuration based on flags

type Info added in v0.5.0

type Info struct {
	Name    string `json:"name"`
	Version int    `json:"version"`
}

type LongPollCallbacks

type LongPollCallbacks struct {
	StreamingPreparing func(transaction string, jsep *MessageJSEP) error
	Unknown            func(m Message) error
}

LongPollCallback represents long poll callbacks indexed by event name

type Message

type Message struct {
	Body        interface{}        `json:"body,omitempty"`
	Candidate   *MessageCandidate  `json:"candidate,omitempty"`
	Data        *MessageData       `json:"data,omitempty"`
	Error       *MessageError      `json:"error,omitempty"`
	Janus       string             `json:"janus,omitempty"`
	JSEP        *MessageJSEP       `json:"jsep,omitempty"`
	Plugin      string             `json:"plugin,omitempty"`
	PluginData  *MessagePluginData `json:"plugindata,omitempty"`
	Transaction string             `json:"transaction,omitempty"`
}

type MessageBody

type MessageBody struct {
	Request string `json:"request"`
}

type MessageCandidate

type MessageCandidate struct {
	Candidate     string `json:"candidate"`
	Completed     bool   `json:"completed,omitempty"`
	SDPMid        string `json:"sdpMid"`
	SDPMLineIndex int    `json:"sdpMLineIndex"`
}

type MessageData

type MessageData struct {
	ID int `json:"id"`
}

type MessageError

type MessageError struct {
	Code   int    `json:"code"`
	Reason string `json:"reason"`
}

type MessageJSEP

type MessageJSEP struct {
	SDP  string `json:"sdp"`
	Type string `json:"type"`
}

type MessageMountpoint

type MessageMountpoint struct {
	MessageBody
	Mountpoint
}

type MessagePluginData

type MessagePluginData struct {
	Data   *PluginData `json:"data"`
	Plugin string      `json:"plugin"`
}

type MessageWatch

type MessageWatch struct {
	MessageBody
	ID         int  `json:"id"`
	OfferVideo bool `json:"offer_video"`
}

type Mountpoint

type Mountpoint struct {
	Audio            bool   `json:"audio,omitempty"`
	AudioPayloadType int    `json:"audiopt,omitempty"`
	AudioPort        int    `json:"audioport,omitempty"`
	AudioRTPMap      string `json:"audiortpmap,omitempty"`
	Description      string `json:"description,omitempty"`
	ID               int    `json:"id,omitempty"`
	Name             string `json:"name,omitempty"`
	Permanent        bool   `json:"permanent,omitempty"`
	Type             string `json:"type,omitempty"`
	Video            bool   `json:"video,omitempty"`
	VideoFMTP        string `json:"videofmtp,omitempty"`
	VideoPayloadType int    `json:"videopt,omitempty"`
	VideoPort        int    `json:"videoport,omitempty"`
	VideoRTPMap      string `json:"videortpmap,omitempty"`
}

type PluginData

type PluginData struct {
	Error     string           `json:"error,omitempty"`
	ErrorCode int              `json:"error_code,omitempty"`
	List      []PluginListItem `json:"list,omitempty"`
	Result    *PluginResult    `json:"result,omitempty"`
	Streaming string           `json:"streaming,omitempty"`
}

type PluginListItem added in v0.4.0

type PluginListItem struct {
	ID int `json:"id"`
}

type PluginResult

type PluginResult struct {
	Status string `json:"status,omitempty"`
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents a session

func (*Session) Close

func (s *Session) Close() error

Close closes the session properly

func (*Session) LongPoll

func (s *Session) LongPoll(cbs LongPollCallbacks) (err error)

LongPoll starts long polling

func (*Session) NewStreamingHandle

func (s *Session) NewStreamingHandle() (h *StreamingHandle, err error)

type StreamingHandle

type StreamingHandle struct {
	// contains filtered or unexported fields
}

StreamingHandle represents a streaming handle

func (*StreamingHandle) Create added in v0.4.0

func (h *StreamingHandle) Create(m Mountpoint) (err error)

Create creates a new mountpoint

func (*StreamingHandle) Destroy added in v0.4.0

func (h *StreamingHandle) Destroy(id int) (err error)

Destroy deletes a mountpoint

func (*StreamingHandle) List added in v0.4.0

func (h *StreamingHandle) List() (ms []int, err error)

List lists all mountpoint ids

func (*StreamingHandle) Start

func (h *StreamingHandle) Start(jsep *MessageJSEP) (err error)

Start requests to start with the provided jsep

func (*StreamingHandle) Trickle

func (h *StreamingHandle) Trickle(c *MessageCandidate) (err error)

Trickle requests to trickle the provided candidate

func (*StreamingHandle) Watch

func (h *StreamingHandle) Watch(id int) (err error)

Watch requests to watch the provided id

Jump to

Keyboard shortcuts

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