zlmediakit

package
v0.0.0-...-502ee6a Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpServerStart

func HttpServerStart(port uint16, ssl bool) (uint16, error)

HttpServerStart 创建http[s]服务器

port htt监听端口,推荐80,传入0则随机分配 ssl 是否为ssl类型服务器

func RtcServerStart

func RtcServerStart(port uint16) (uint16, error)

RtcServerStart 创建rtc服务器

port rtc监听端口

func RtmpServerStart

func RtmpServerStart(port uint16, ssl bool) (uint16, error)

RtmpServerStart 创建rtmp[s]服务器

port rtmp监听端口,推荐1935,传入0则随机分配 ssl 是否为ssl类型服务器

func RtpServerStart

func RtpServerStart(port uint16) (uint16, error)

RtpServerStart 创建rtp服务器

port rtp监听端口(包括udp/tcp)

func RtspServerStart

func RtspServerStart(port uint16, ssl bool) (uint16, error)

RtspServerStart 创建rtsp[s]服务器

port rtsp监听端口,推荐554,传入0则随机分配 ssl 是否为ssl类型服务器

func SetLog

func SetLog(fileMaxSize, fileMaxCount int)

SetLog 设置日志文件

fileMaxSize 单个切片文件大小(MB) fileMaxCount 切片文件个数

func ShellServerStart

func ShellServerStart(port uint16) (uint16, error)

ShellServerStart 创建shell服务器

port shell监听端口

func SrtServerStart

func SrtServerStart(port uint16) (uint16, error)

SrtServerStart 创建srt服务器

port srt监听端口

func StopAllServer

func StopAllServer()

StopAllServer 关闭所有服务器,请在main函数退出时调用

Types

type Config

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

func EnvInit

func EnvInit(threadNum int, logLevel LogLevel, logMask LogMask, logFilePath string, logFileDays int, iniIsPath bool, ini string, sslIsPath bool, ssl string, sslPwd string) *Config

EnvInit 初始化环境,调用该库前需要先调用此函数

threadNum: 线程数 logLevel: 日志级别,支持0~4 logMask: 控制日志输出的掩模,请查看LOG_CONSOLE、LOG_FILE、LOG_CALLBACK等宏 logFilePath: 文件日志保存路径,路径可以不存在(内部可以创建文件夹),设置为NULL关闭日志输出至文件 logFileDays: 文件日志保存天数,设置为0关闭日志文件 iniIsPath: 配置文件是内容还是路径 ini: 配置文件内容或路径,可以为空,如果该文件不存在,那么将导出默认配置至该文件 sslIsPath: ssl证书是内容还是路径 ssl: ssl证书内容或路径,可以为空 sslPwd: 证书密码,可以为空

func (*Config) Ini

func (conf *Config) Ini() string

func (*Config) IniIsPath

func (conf *Config) IniIsPath() bool

func (*Config) LogFileDays

func (conf *Config) LogFileDays() int

func (*Config) LogFilePath

func (conf *Config) LogFilePath() string

func (*Config) LogLevel

func (conf *Config) LogLevel() LogLevel

func (*Config) LogMask

func (conf *Config) LogMask() LogMask

func (*Config) SetIni

func (conf *Config) SetIni(ini string)

func (*Config) SetIniIsPath

func (conf *Config) SetIniIsPath(iniIsPath bool)

func (*Config) SetLogFileDays

func (conf *Config) SetLogFileDays(logFileDays int)

func (*Config) SetLogFilePath

func (conf *Config) SetLogFilePath(logFilePath string)

func (*Config) SetLogLevel

func (conf *Config) SetLogLevel(logLevel LogLevel)

func (*Config) SetLogMask

func (conf *Config) SetLogMask(logMask LogMask)

func (*Config) SetSsl

func (conf *Config) SetSsl(ssl string)

func (*Config) SetSslIsPath

func (conf *Config) SetSslIsPath(sslIsPath bool)

func (*Config) SetSslPwd

func (conf *Config) SetSslPwd(sslPwd string)

func (*Config) SetThreadNum

func (conf *Config) SetThreadNum(threadNum int)

func (*Config) Ssl

func (conf *Config) Ssl() string

func (*Config) SslIsPath

func (conf *Config) SslIsPath() bool

func (*Config) SslPwd

func (conf *Config) SslPwd() string

func (*Config) ThreadNum

func (conf *Config) ThreadNum() int

type LogLevel

type LogLevel int
const (
	LTrace LogLevel = 0
	LDebug LogLevel = 1
	LInfo  LogLevel = 2
	LWarn  LogLevel = 3
	LError LogLevel = 4
)

type LogMask

type LogMask int
const (
	LogConsole  LogMask = 1 << 0
	LogFile     LogMask = 1 << 1
	LogCallback LogMask = 2 << 1
)

Jump to

Keyboard shortcuts

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