rtcfs

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pairing

func Pairing(ctx context.Context, options *PairingOptions) error

func Publish

func Publish(ctx context.Context, options *ConnectOptions, fsys fs.FS) error

func ShellExec

func ShellExec(ctx context.Context, options *ConnectOptions, cmd, arg string) error

func StartShell

func StartShell(ctx context.Context, options *ConnectOptions) error

Types

type ClientOptions

type ClientOptions struct {
	MaxRedirect int
}

type ConnectOptions

type ConnectOptions struct {
	SignalingURL string
	SignalingKey string
	RoomID       string

	AuthToken string
}

type DataChannelCallback

type DataChannelCallback struct {
	Name          string
	OnOpenFunc    func(*webrtc.DataChannel)
	OnCloseFunc   func(*webrtc.DataChannel)
	OnMessageFunc func(*webrtc.DataChannel, webrtc.DataChannelMessage)
}

func (*DataChannelCallback) Label

func (d *DataChannelCallback) Label() string

func (*DataChannelCallback) OnClose

func (d *DataChannelCallback) OnClose(ch *webrtc.DataChannel)

func (*DataChannelCallback) OnMessage

func (d *DataChannelCallback) OnMessage(ch *webrtc.DataChannel, msg webrtc.DataChannelMessage)

func (*DataChannelCallback) OnOpen

func (d *DataChannelCallback) OnOpen(ch *webrtc.DataChannel)

type DataChannelHandler

type DataChannelHandler interface {
	Label() string
	OnOpen(*webrtc.DataChannel)
	OnClose(*webrtc.DataChannel)
	OnMessage(*webrtc.DataChannel, webrtc.DataChannelMessage)
}

type PairingOptions

type PairingOptions struct {
	ConnectOptions
	PairingRoomIDPrefix string
	Timeout             time.Duration
}

type RTCConn

type RTCConn struct {
	PC *webrtc.PeerConnection
	// contains filtered or unexported fields
}

func GetClinet

func GetClinet(ctx context.Context, options *ConnectOptions, clientOpt *ClientOptions) (*RTCConn, *socfs.FSClient, error)

func NewRTCConn

func NewRTCConn(signalingUrl, roomID, signalingKey string) (*RTCConn, error)

func (*RTCConn) Close

func (c *RTCConn) Close() error

func (*RTCConn) IsExistRoom

func (c *RTCConn) IsExistRoom() bool

func (*RTCConn) Start

func (c *RTCConn) Start(dataChannles []DataChannelHandler)

AddTrack/CreateDataChannel shoudl be done before Start()

func (*RTCConn) Wait

func (c *RTCConn) Wait(ctx context.Context) error

Jump to

Keyboard shortcuts

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