Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeFrame(t FrameType, id uint32, payload []byte) []byte
- func NewAPI(opts APIOptions) *webrtc.API
- func PionLoggerFactory(logf func(format string, args ...any)) pionlogging.LoggerFactory
- type APIOptions
- type Addr
- type Browser
- type FSCapabilities
- type Frame
- type FrameType
- type Handler
- type Hello
- type Jerk
- type Link
- func (l *Link) AddCandidate(c *signal.Candidate) error
- func (l *Link) Close() error
- func (l *Link) Done() <-chan struct{}
- func (l *Link) Err() error
- func (l *Link) Open(ctx context.Context, open any, opts OpenOptions) (*Stream, error)
- func (l *Link) PeerConnection() *webrtc.PeerConnection
- func (l *Link) PeerHello() (Hello, bool)
- func (l *Link) Ready() <-chan struct{}
- func (l *Link) Role() Role
- type Mount
- type OpenOptions
- type Options
- type Policy
- type ResetError
- type Role
- type Routes
- type Stream
- func (s *Stream) Accept(opened any) error
- func (s *Stream) CloseWrite() error
- func (s *Stream) Conn() net.Conn
- func (s *Stream) Done() <-chan struct{}
- func (s *Stream) Err() error
- func (s *Stream) ID() uint32
- func (s *Stream) Kind() string
- func (s *Stream) Link() *Link
- func (s *Stream) Local() bool
- func (s *Stream) OpenPayload() json.RawMessage
- func (s *Stream) OpenedPayload() json.RawMessage
- func (s *Stream) Read(p []byte) (int, error)
- func (s *Stream) Reset(reason string) error
- func (s *Stream) SetReadDeadline(t time.Time) error
- func (s *Stream) SetWriteDeadline(t time.Time) error
- func (s *Stream) Shared() bool
- func (s *Stream) TryWrite(p []byte) (bool, error)
- func (s *Stream) Write(p []byte) (int, error)
- func (s *Stream) WriteTo(w io.Writer) (int64, error)
Constants ¶
View Source
const ( HeaderSize = 5 MaxPayload = 65536 MaxMessageSize = HeaderSize + MaxPayload Window = 256 * 1024 )
View Source
const ( Version = 1 ControlName = "slicc.link.v1" StreamName = "slicc.link.v1.stream" )
View Source
const CloseGrace = 10 * time.Second
View Source
const ReceiveBuffer = 4 << 20
Variables ¶
View Source
var ( ErrClosed = errors.New("link: closed") ErrHelloTimeout = errors.New("link: no HELLO from the peer") )
Functions ¶
func NewAPI ¶
func NewAPI(opts APIOptions) *webrtc.API
func PionLoggerFactory ¶
func PionLoggerFactory(logf func(format string, args ...any)) pionlogging.LoggerFactory
Types ¶
type APIOptions ¶
type FSCapabilities ¶ added in v1.23.0
type Frame ¶
func DecodeFrame ¶
type Hello ¶
type Hello struct {
V int `json:"v"`
Role Role `json:"role"`
Name string `json:"name,omitempty"`
Host string `json:"host,omitempty"`
Version string `json:"version,omitempty"`
Mode string `json:"mode,omitempty"`
Node string `json:"node,omitempty"`
Caps []string `json:"caps"`
Routes *Routes `json:"routes,omitempty"`
Policy *Policy `json:"policy,omitempty"`
SSHHostKey string `json:"sshHostKey,omitempty"`
Browsers []Browser `json:"browsers,omitempty"`
Mounts []Mount `json:"mounts,omitempty"`
Jerk *Jerk `json:"jerk,omitempty"`
Raw json.RawMessage `json:"-"`
}
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) PeerConnection ¶
func (l *Link) PeerConnection() *webrtc.PeerConnection
type Mount ¶ added in v1.23.0
type Mount struct {
Name string `json:"name"`
Readonly bool `json:"readonly"`
Capabilities FSCapabilities `json:"capabilities"`
}
type OpenOptions ¶
type OpenOptions struct {
}
type ResetError ¶
func ParseReset ¶
func ParseReset(reason string) *ResetError
func (*ResetError) Error ¶
func (e *ResetError) Error() string
func (*ResetError) Reason ¶
func (e *ResetError) Reason() string
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) CloseWrite ¶
func (*Stream) OpenPayload ¶
func (s *Stream) OpenPayload() json.RawMessage
func (*Stream) OpenedPayload ¶
func (s *Stream) OpenedPayload() json.RawMessage
func (*Stream) SetReadDeadline ¶ added in v1.14.0
func (*Stream) SetWriteDeadline ¶ added in v1.14.0
Click to show internal directories.
Click to hide internal directories.