gateway

package module
v3.0.17 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 17 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

网关插件

该插件主要提供http协议访问,供其他插件公用http接口端口,并且提供一些基础的API

插件地址

github.com/Monibuca/plugin-gateway

插件引入

import (
    _ "github.com/Monibuca/plugin-gateway"
)

默认插件配置

[GateWay]
ListenAddr = ":8080"
#ListenAddrTLS = ":8082"
#CertFile = "xxx.cert"
#KeyFile = "xxx.key"
#StaticPath = ""
  • ListenAddr 公共http监听端口
  • ListenAddrTLS 公共https监听端口
  • CertFile https用的证书
  • KeyFile https用的证书的key
  • StaticPath 静态资源目录,设置后可以通过访问公共http监听端口来访问这些静态资源

自带的API接口

  • /api/gateway/sysInfo 系统信息,包含版本号(Version)和启动时间(StartTime)两个字段
  • /api/gateway/plugins 所有插件信息,是一个数组里面包含插件的名称(Name)、版本(Version)、README(ReadMe)、配置(Config)、热更新配置(HotConfig)
  • /api/gateway/config 返回原始配置文件
  • /api/gateway/stop?stream=xxx 终止某一个流,入参是流标识(stream)
  • /api/gateway/h264?stream=xxx&len=10 获取一段h264的流用于调试,入参数len代表需要获取的时长单位是秒
  • /api/gateway/getIFrame?stream=xxx 获取一个I帧数据,包含了SPS和PPS信息
  • /api/gateway/modifyConfig?name=xxx&key=xxx&value=xxx 修改可以热更新的配置,name是插件名(插件注册时设置)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginInfo

type PluginInfo struct {
	Name      string   //插件名称
	Config    string   //插件配置
	ReadMe    string   //README.md
	Version   string   //插件版本
	HotConfig []string //热更新配置
}

PluginInfo 插件信息

type PrintInfo

type PrintInfo struct {
	Audio   bool
	Ts      uint32
	Cts     uint32
	Payload string
}

type SnapShot

type SnapShot struct {
	Type    byte
	Size    int
	Payload []byte
}

Jump to

Keyboard shortcuts

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