Documentation ¶
Index ¶
- func AiBaseUuid() string
- func AllowCros(c *gin.Context)
- func AppUuid() string
- func BToMb(b uint64) uint64
- func BToU16(b []byte, index int, offset int) uint16
- func BToU32(b []byte, index int, offset int) uint32
- func BToU64(b []byte, index int, offset int) uint64
- func BindConfig(config map[string]interface{}, s interface{}) error
- func BindSourceConfig(config map[string]interface{}, s interface{}) error
- func BtoMB(bytes uint64) float64
- func CLog(format string, v ...interface{})
- func CRC16(data []byte) uint16
- func CatOsRelease() (map[string]string, error)
- func CommandExists(command string) bool
- func CronTaskUuid() string
- func DataSchemaUuid() string
- func DeviceUuid() string
- func GenCode(fields []Field, big bool, more bool) string
- func Get(client http.Client, url string) string
- func GetDefaultDataOrder(Type, Order string) string
- func GetINISection(iniPath string, s string) *ini.Section
- func GetOSDistribution() (string, error)
- func GetPwd() string
- func GetUbuntuVersion() (string, error)
- func GiveMeMicroseconds(c int64) time.Duration
- func GiveMeMilliseconds(c int64) time.Duration
- func GiveMeSeconds(c int64) time.Duration
- func GoID() int
- func GoodsUuid() string
- func GroupUuid() string
- func HNC8PointUUID() string
- func HandleZeroValue[V int16 | int32 | int64 | float32 | float64](v *V) *V
- func HostNameI() ([]string, error)
- func INIToStruct(iniPath string, s string, v interface{}) error
- func InIMapToStruct(section *ini.Section, s interface{}) error
- func InUuid() string
- func IsListDuplicated(list []string) bool
- func IsValidName(username string) bool
- func KDNPointUUID() string
- func MakeLongUUID(prefix string) string
- func MakeUUID(prefix string) string
- func MaoToTerm(input interface{}, output interface{}) error
- func ModbusPointUUID() string
- func NowTime() string
- func NowTs() int64
- func OutUuid() string
- func Paginate(pageNum int, pageSize int, sliceLength int) (int, int)
- func ParseModbusValue(DataBlockType string, DataBlockOrder string, Weight float32, ...) string
- func ParseUSignedValue(DataBlockType string, DataBlockOrder string, Weight float32, ...) string
- func PathExists(path string) bool
- func PluginUuid() string
- func Post(client http.Client, data interface{}, url string, headers map[string]string) (string, error)
- func PushLocalCameraToJpegStreamServer(FromDevice, pushAddr string) *exec.Cmd
- func PushLocalCameraToRTMPServer(FromDevice, pushAddr string) *exec.Cmd
- func PushLocalCameraToWsServer(FromDevice, pushAddr string) *exec.Cmd
- func PushRtspToJpegStreamServer(From, ToUrl string) *exec.Cmd
- func PushRtspToRTMPServer(inputUrl, pushAddr string) *exec.Cmd
- func PushRtspToWsServer(inputUrl, pushAddr string) *exec.Cmd
- func ReadAtLeast(ctx context.Context, r io.Reader, buf []byte, min int) (n int, err error)
- func RuleUuid() string
- func SContains(s []string, e string) bool
- func ShowGGpuAndCpuInfo()
- func SiemensPointUUID() string
- func Sleep(ts int)
- func SliceReceive(ctx context.Context, iio io.Reader, resultBuffer []byte, showError bool, ...) (int, error)
- func SliceReceiveAtLeast(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration, ...) (int, error)
- func SliceReceiveWithError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
- func SliceReceiveWithoutError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
- func SliceRequest(ctx context.Context, iio io.ReadWriter, writeBytes []byte, resultBuffer []byte, ...) (int, error)
- func TraceMemStats()
- func TransformConfig(s1 []byte, s2 interface{}) error
- func TrimZero(s string) string
- func U16ToB(v uint16, b []byte)
- func U32ToB(v uint32, b []byte)
- func U64ToB(v uint64, b []byte)
- func UserLuaUuid() string
- func VisualUuid() string
- func XOR(src []byte) int
- func Zone() string
- type AddressInfo
- type CpuUsage
- type DiskUsage
- type Field
- type GenLuaConfig
- type NetworkInterfaceUsage
- type Resolution
- type SystemDevices
- type Utsname
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AiBaseUuid ¶
func AiBaseUuid() string
func BindConfig ¶
Bind config to struct config: a Map, s: a struct variable
func BindSourceConfig ¶
func CatOsRelease ¶ added in v0.6.3
* * Linux: cat /etc/os-release *
func CommandExists ¶ added in v0.6.4
func CronTaskUuid ¶ added in v0.6.4
func CronTaskUuid() string
func DataSchemaUuid ¶ added in v0.6.3
func DataSchemaUuid() string
func DeviceUuid ¶
func DeviceUuid() string
func GetDefaultDataOrder ¶ added in v0.6.6
* * 默认字节序 *
func GetOSDistribution ¶ added in v0.5.1
* * 获取操作系统发行版版本 runtime.GOARCH:
386: 32-bit Intel/AMD x86 architecture amd64: 64-bit Intel/AMD x86 architecture arm: ARM architecture (32-bit) arm64: ARM architecture (64-bit) ppc64: 64-bit PowerPC architecture ppc64le: 64-bit little-endian PowerPC architecture mips: MIPS architecture (32-bit) mips64: MIPS architecture (64-bit) s390x: IBM System z architecture (64-bit) wasm: WebAssembly architecture
runtime.GOOS:
darwin: macOS freebsd: FreeBSD linux: Linux windows: Windows netbsd: NetBSD openbsd: OpenBSD plan9: Plan 9 dragonfly: DragonFly BSD
*
func HandleZeroValue ¶ added in v0.6.6
* * 处理空指针初始值 *
func INIToStruct ¶
func MakeLongUUID ¶ added in v0.6.3
func MaoToTerm ¶
func MaoToTerm(input interface{}, output interface{}) error
Map转成结构体 Decode takes an input structure and uses reflection to translate it to the output structure.
output must be a pointer to a map or struct.
func ParseModbusValue ¶ added in v0.6.6
func ParseModbusValue( DataBlockType string, DataBlockOrder string, Weight float32, byteSlice [256]byte) string
* *解析 Modbus 的值 有符号, 注意:如果想解析值,必须不能超过4字节,目前常见的数一般都是4字节,也许后期会有8字节,但是目前暂时不支持 *
func ParseUSignedValue ¶ added in v0.6.6
func ParseUSignedValue(DataBlockType string, DataBlockOrder string, Weight float32, byteSlice [256]byte) string
* *解析西门子的值 无符号 *
func PathExists ¶ added in v0.6.5
func PluginUuid ¶
func PluginUuid() string
func Post ¶
func Post(client http.Client, data interface{}, url string, headers map[string]string) (string, error)
* * HTTP POST *
func PushLocalCameraToJpegStreamServer ¶ added in v0.6.7
* * 推本地的摄像头到远程流服务器 *ffmpeg.exe -hide_banner -r 24 -rtsp_transport tcp -re -i video="USB2.0 PC CAMERA" -c:v mjpeg -f mjpeg -headers "Content-Type:multipart/x-mixed-replace" "http://127.0.0.1:9401/jpeg_stream/push?liveId=123"
func PushLocalCameraToRTMPServer ¶ added in v0.6.7
* * 摄像头推流到RTMP服务器 *
func PushLocalCameraToWsServer ¶ added in v0.6.7
* * 推送摄像头到Websocket Server ffmpeg.exe -hide_banner -r 24 -rtsp_transport tcp -re -i device=/dev/video0 -c:v mjpeg -f mjpeg -headers "Content-Type:multipart/x-mixed-replace" "http://127.0.0.1:9401/jpeg_stream/push?liveId=123"
func PushRtspToJpegStreamServer ¶ added in v0.6.7
* * 推送Rtsp流 ffmpeg.exe -hide_banner -r 24 -rtsp_transport tcp -re -i rtsp://192.168.1.210:554/av0_0 -c:v mjpeg -f mjpeg -headers "Content-Type:multipart/x-mixed-replace" "http://127.0.0.1:9401/jpeg_stream/push?liveId=123"
func PushRtspToRTMPServer ¶ added in v0.6.7
* * Push to rtmp ffmpeg.exe -hide_banner -rtsp_transport tcp -re -i rtsp://192.168.1.210:554/av0_0 -q 5 -f flv rtmp://127.0.0.1:1935
func PushRtspToWsServer ¶ added in v0.6.7
* * 推送RTSP到Websocket Server ffmpeg.exe -hide_banner -r 24 -rtsp_transport tcp -re -i rtsp://192.168.1.210:554/av0_0 -i .\meteorology.png -filter_complex "[0:v][1:v]overlay=10:10:alpha=0.5" -q 5 -f mpegts -fflags nobuffer -c:v libx264 -an http://127.0.0.1:9400/h264_stream/push?liveId=123
func ReadAtLeast ¶
func SliceReceive ¶
func SliceReceive(ctx context.Context, iio io.Reader, resultBuffer []byte, showError bool, td time.Duration) (int, error)
* * 通过一个定时时间片读取 *
func SliceReceiveAtLeast ¶
func SliceReceiveAtLeast(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration, min int) (int, error)
* * 某个时间片期望最少收到字节数 *
func SliceReceiveWithError ¶
func SliceReceiveWithError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
* * 读取数据的时候,如果出现错误就返回 *
func SliceReceiveWithoutError ¶
func SliceReceiveWithoutError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
* * 读取数据的时候,如果出现错误则判断是否是串口引起的超时,如果是就忽略 *
func SliceRequest ¶
func SliceRequest(ctx context.Context, iio io.ReadWriter, writeBytes []byte, resultBuffer []byte, showError bool, td time.Duration) (int, error)
* * 时间片读写请求 *
func TransformConfig ¶
JSON String to a struct, (can't validate map!!!)
func VisualUuid ¶ added in v0.6.1
func VisualUuid() string
Types ¶
type AddressInfo ¶ added in v0.6.6
type AddressInfo struct { AddressType string // 寄存器类型: DB I Q DataBlockType string // 数据类型: BYTE SHORT INT DataBlockSize int // 数据长度 DataBlockOrder string // 字节序 DataBlockNumber int // 数据块号 ElementNumber int // 元素号 BitNumber int // 位号,只针对I、Q }
AddressInfo 包含解析后的地址信息
func (AddressInfo) String ¶ added in v0.6.6
func (O AddressInfo) String() string
type DiskUsage ¶ added in v0.5.1
type DiskUsage struct { DeviceID string `json:"deviceID"` FreeSpace float64 `json:"freeSpace"` Size float64 `json:"size"` }
* * 磁盘 *
type GenLuaConfig ¶
type NetworkInterfaceUsage ¶ added in v0.5.1
type NetworkInterfaceUsage struct { Name string CurrentBandwidth uint64 BytesTotalPerSec uint64 BytesReceivedPerSec uint64 BytesSentPerSec uint64 PacketsPerSec uint64 }
* * 网卡 *
func NetInterfaceUsage ¶ added in v0.5.1
func NetInterfaceUsage() ([]NetworkInterfaceUsage, error)
* * 获取网卡实时速率 *
func (NetworkInterfaceUsage) String ¶ added in v0.5.1
func (m NetworkInterfaceUsage) String() string
type Resolution ¶ added in v0.6.7
* * Jpeg Stream 帧 *
func CvMatToImageBytes ¶ added in v0.6.7
func CvMatToImageBytes(FrameBuffer []byte) ([]byte, Resolution, error)
func GetVideoResolution ¶ added in v0.6.7
func GetVideoResolution(FrameBuffer []byte) Resolution
func (Resolution) String ¶ added in v0.6.7
func (O Resolution) String() string
type SystemDevices ¶ added in v0.5.1
type SystemDevices struct { Uarts []string `json:"uarts"` Videos []string `json:"videos"` Audios []string `json:"audios"` }
* * 系统设备 *
func (SystemDevices) String ¶ added in v0.5.1
func (m SystemDevices) String() string
type Utsname ¶ added in v0.5.1
type Utsname struct {
// contains filtered or unexported fields
}
* * Cgo 实现, 用来获取Linux的系统参数 *
func ReleaseInfo ¶ added in v0.5.1
func ReleaseInfo() Utsname
Source Files ¶
- byte_order_handle.go
- codec.go
- common_misc.go
- config_util.go
- console_util.go
- encode_util.go
- ffmpeg_stream_pusher.go
- generic_http_server.go
- gocv_utils.go
- hardware_util_linux.go
- http_util.go
- ini_util.go
- io_util.go
- lua_gen.go
- os_common.go
- os_hw_interface.go
- os_util_linux.go
- siemens_addr_parse_util.go
- string_util.go
- time_utils.go
- uuid_util.go