utils

package
v0.1.1-0...-288313b Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseLocalUDPConn

func CloseLocalUDPConn(conn *net.UDPConn) error

Close UDP connection.

func CreateDir

func CreateDir(path string) error

Check and create a directory if it doesn't exist.

func DeleteDir

func DeleteDir(path string) error

Delete all contents of a directory.

func GetOutputDir

func GetOutputDir() string

Return `output` directory path.

func GetPublicIP

func GetPublicIP() string

Get Public IP address. credits: https://github.com/Glimesh/broadcast-box

func NewLocalUDPConn

func NewLocalUDPConn(port int) (*net.UDPConn, error)

Dial port for UDP connection and return it.

func OpenFile

func OpenFile(path string) (*os.File, error)

Opens a file or creates if it doesnt exist and return it.

func WriteRTPPacketToUDPConn

func WriteRTPPacketToUDPConn(conn *net.UDPConn, rtpPacket *rtp.Packet) error

Write RTP packets to UDP connection.

func WriteToFile

func WriteToFile(path, content string) error

Create new file and write the `content` to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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