cgobackend

package
v0.0.0-...-1d0798a Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignalingPath   = "/webrtc/v1/offer"
	MediaStreamOpus = "audio/opus"

	HTTPMethodGet     = 1
	HTTPMethodPost    = 2
	HTTPMethodPut     = 3
	HTTPMethodPatch   = 4
	HTTPMethodDelete  = 5
	HTTPMethodHead    = 6
	HTTPMethodOptions = 7

	CipherChaCha20Poly1305 = 1
	CipherAES256GCM        = 2
	CipherPlaintext        = 3

	RTCChannelOpen   = 1
	RTCChannelClosed = 2
)

Variables

This section is empty.

Functions

func AEADOpen

func AEADOpen(mode int, key, nonce, ciphertext, aad []byte) ([]byte, error)

func AEADSeal

func AEADSeal(mode int, key, nonce, plaintext, aad []byte) ([]byte, error)

func DH

func DH(private, remotePublic []byte) (giznet.Key, error)

func HKDFSHA256

func HKDFSHA256(secret, salt []byte, info string, out []byte) error

func KeyPairFromPrivate

func KeyPairFromPrivate(private []byte) (giznet.KeyPair, error)

func Random

func Random(out []byte) error

func TimeInstantMs

func TimeInstantMs() int64

func TimeUnixMs

func TimeUnixMs() int64

Types

type Backend

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

func New

func New() *Backend

func (*Backend) AddICEServer

func (b *Backend) AddICEServer(url, username, credential string) error

func (*Backend) BufferedAmount

func (b *Backend) BufferedAmount(channelID int) (uint64, error)

func (*Backend) Close

func (b *Backend) Close()

func (*Backend) CloseDataChannel

func (b *Backend) CloseDataChannel(channelID int)

func (*Backend) CreateDataChannel

func (b *Backend) CreateDataChannel(label string, channelID int, ordered, reliable bool) error

func (*Backend) CreatePeer

func (b *Backend) CreatePeer() error

func (*Backend) HTTPRequest

func (b *Backend) HTTPRequest(method int, url string, headers []HTTPHeader, body []byte) (HTTPResponse, error)

func (*Backend) Poll

func (b *Backend) Poll(timeoutMS int)

func (*Backend) Send

func (b *Backend) Send(channelID int, data []byte, isText bool) error

func (*Backend) SetBufferedAmountLowThreshold

func (b *Backend) SetBufferedAmountLowThreshold(channelID int, bytes uint64) error

func (*Backend) SetEventSink

func (b *Backend) SetEventSink(sink EventSink)

func (*Backend) SetRemoteSDP

func (b *Backend) SetRemoteSDP(answer string) error

func (*Backend) StartOffer

func (b *Backend) StartOffer() (string, error)

type EventSink

type EventSink interface {
	RemoteChannel(channelID int, label string, ordered, reliable bool)
	ChannelState(channelID int, state int)
	ChannelMessage(channelID int, data []byte, isText bool)
	BufferedAmountLow(channelID int)
}

type HTTPHeader

type HTTPHeader struct {
	Name  string
	Value string
}

type HTTPResponse

type HTTPResponse struct {
	StatusCode int
	Body       []byte
}

Jump to

Keyboard shortcuts

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