constant

package
v0.0.0-...-5ecf4e5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceFlag           = "service flag"
	ServiceConfigurations = "service configurations"
	ServiceClients        = "service clients"
	ServiceLogging        = "service logging"
	ServiceDevice         = "service device"
	ServiceGRPC           = "service GRPC"
	ServiceRTMP           = "service RTMP"
	ServiceTask           = "service task"
	ServiceHTTP           = "service HTTP"
	ServiceRTPProxy       = "service RTP proxy"
)

Main service names

View Source
const (
	KeyFrame      // 1
	MetaDataFrame // 2
)

Default video frame types

View Source
const (
	ConstDefaultConfigVersion                               = "2.0.0"
	ConstDefaultConfigMark                                  = "save"
	ConstContentJSON                                        = "application/json"
	ConstDeviceChannelReconnectionTimer                     = 2 * time.Second
	ConstDeviceChannelDialTimeout                           = 3 * time.Second
	ConstDeviceChannelReadWriteTimeout                      = 3 * time.Second
	ConstPoster                                             = "poster"
	ConstRecord                                             = "record"
	ConstLoggingLevel                                       = logrus.FatalLevel
	ConstDataFileMime                                       = ".udfv1"
	ConstMetaFileMime                                       = ".umfv1"
	ConstAnalyticsFileMime                                  = ".uafv1"
	ConstStatisticsFileMime                                 = ".usfv1"
	ConstTSFileMime                                         = ".ts"
	ConstTSFragmentName                                     = "fragment"
	ConstJPEGFileMime                                       = "image.jpeg"
	ConstEndM3U8ListTag                                     = "#EXT-X-ENDLIST"
	ConstExtINFTag                                          = "#EXTINF:"
	ConstExtM3U                                             = "#EXTM3U"
	ConstExtPlayListType                                    = "#EXT-X-PLAYLIST-TYPE:"
	ConstVOD                                                = "VOD"
	ConstExtTargetduration                                  = "#EXT-X-TARGETDURATION:"
	ConstExtM3UVersion                                      = "#EXT-X-VERSION:"
	ConstExtM3UVersionDefault                               = "3"
	ConstExtMediaSequence                                   = "#EXT-X-MEDIA-SEQUENCE:"
	ConstRecordHLSMinSegmentTime                            = 4
	ConstRecordTimeFormat                                   = "2006_01_02_15"
	ConstMaxRecordSelectHour                                = 24
	ConstMaxLicenseTry                                      = 6
	ConstOk                                                 = 1
	ConstLicenseEncoding                                    = "23$U$@"
	ConstStatusServer                                       = "https://localhost/api/device_status.php"
	ConstStatisticsServer                                   = "https://localhost/api/statistics_server.php"
	ConstLicenseServer                                      = "https://localhost/api/license_check_key.php"
	ConstHTTPContentType                                    = "Content-Type"
	ConstHTTPContentLength                                  = "Content-Length"
	ConstHTTPContentDisposition                             = "Content-Disposition"
	ConstHTTPContentAttachmentFilename                      = "attachment; filename="
	ConstHTTPMimeTS                                         = "video/MP2T"
	ConstHTTPMimeJPEG                                       = "image/jpeg"
	ConstHTTPMimeMP4                                        = "video/mp4"
	ConstHTTPMimeM3U8                                       = "application/vnd.apple.mpegurl"
	ConstMimeMP4                                            = ".mp4"
	ConstVersion                                            = "0.5"
	ConstSuccess                                            = "Success"
	ConstNone                                               = "None"
	ConstPong                                               = "Pong"
	ConstLoadingSystemService                               = "Loading system service"
	ConstSystemCorrectOffline                               = "System has finished working correctly"
	ConstInitializationPkgServiceFail                       = "Initialization pkg service fail:"
	ConstInitializationAllPkgServiceSuccess                 = "Initialization all pkg service success"
	ConstFinalizeAllPkgServiceFail                          = "Finalize all pkg service fail:"
	ConstInitializationModuleRTMPError                      = "Initialization module RTMP customError:"
	ConstInitializationModuleRTSPError                      = "Initialization module RTSP customError:"
	ConstInitializationModuleHTTPError                      = "Initialization module HTTP customError:"
	ConstInitializationModuleGRPCError                      = "Initialization module GRPC customError:"
	ConstInitializationModuleGRPCErrorFailedRegisterGateway = "Initialization module GRPC Failed Register Gateway customError:"
	ConstInitializationModuleGRPCErrorFailedDialServer      = "Initialization module GREP Failed Dial Server customError:"
	ConstAuthorization                                      = "authorization"
	ConstDefaultConfigurationPatch                          = "/etc/server/config.yaml"
	ConstBackupConfigurationPatch                           = "configs/config.yaml"
	ConstInternalSignalAccepted                             = "Internal signal accepted"
	ConstSystemSignalCopyToInternalSignal                   = "System signal copy to internal signal"
	ConstFlagNameDebug                                      = "FlagDebug"
	ConstFlagNameDebugLevel                                 = "FlagDebugLevel"
	ConstFlagConfigurationPatch                             = "FlagConfigurationPatch"
	ConstNameDebug                                          = "Debug"
	ConstNameDebugLevel                                     = "DebugLevel"
	ConstNameConfigurationPatch                             = "ConfigurationPatch"
	ConstNameDebugDescriptions                              = "enable / disable debug mode"
	ConstNameDebugDefault                                   = false
	ConstNameDebugLevelDefault                              = "customError"
	ConstNameDebugLevelDescriptions                         = "log level (string): trace, debug, info, waring, customError, fatal"
	ConstNameConfigurationPatchDescriptions                 = "full patch to yaml configuration file"
	ConstNameConfigurationPatchDefault                      = ""
	ConstValidateToken                                      = "server"
	ConstRunLevel                                           = "run level"
	ConstStopLevel                                          = "stop level"
	ConstDebugLevelError                                    = "customError"
	ConstSlash                                              = "/"
	ConstComma                                              = ","
	ConstSlashBack                                          = `/`
	ConstLogFormatText                                      = "text"
	ConstLogFormatJSON                                      = "json"
	ConstStringBreak                                        = "\r\n"
	ConstLogFormatNested                                    = "nested"
	ConstLogFormatNestedComponent                           = "component"
	ConstLogFormatNestedCategory                            = "category"
	ConstDefaultCameraLogin                                 = "admin"
	ConstOSWindows                                          = "windows"
	ConstDefaultChannel                                     = "0"
	ConstON                                                 = "ON"
	ConstOFF                                                = "OFF"
	ConstTracing                                            = "tracing"
	ConstDeviceUniqID                                       = "deviceUniqID"
	ConstChannelUniqID                                      = "channelUniqID"
	ConstTimeStart                                          = "timeStart"
	ConstTimeEnd                                            = "timeEnd"
	ConstSeekStart                                          = "seekStart"
	ConstSeekEnd                                            = "seekEnd"
	ConstTimeLine                                           = "timeLine"
	ConstRecordHeaderSize                                   = 50
	ConstRecordHeaderSplitSize                              = 46
	ConstDefaultIDX                                         = 0
)

Communication not editable settings

View Source
const (
	ConstContentTypeBinary  = "application/octet-stream"
	ConstContentTypeForm    = "application/x-www-form-urlencoded"
	ConstContentTypeJSON    = "application/json"
	ConstContentTypeHTML    = "text/html; charset=utf-8"
	ConstContentTypeText    = "text/plain; charset=utf-8"
	ConstContentTypeMpegURL = "application/vnd.apple.mpegurl"
	ConstContentTypeMP2T    = "video/MP2T"
)
View Source
const (
	ConstTaskDeleteFiles           = "0 10 * * * *" //Every 10 minutes of every hour (once an hour)
	ConstTaskGetImage              = "0 42 * * * *" //Every 42 minutes of every hour (once an hour)
	ConstTaskGetInstallationStatus = "0 30 * * * *" //Every 30 minutes of every hour (once an hour)
	ConstTaskSendStatus            = "0 * * * * *"  //Every 0 second (once per minute)
	ConstSendPlatformStatistics    = "30 * * * * *" //Every 30 seconds (once per minute)
)

cron settings section

View Source
const (
	ConstHTTPGET                       = "GET"
	ConstHTTPTimeOut                   = 30 * time.Minute
	ConstHTTPTimeJSON                  = `{"code": -1, "msg":"http: Handler timeout"}`
	ConstHTTPTimeMsg                   = "timeout happen, url:"
	ConstHTTPWWWPrefix                 = "www."
	ConstHTTPCurrentVersion            = "/V1"
	ConstHTTPCurrentGRPCPatch          = "/GRPC"
	ConstHTTPMethodAny                 = "/*any"
	ConstHTTPMethodDemoWebsocket       = "/demo/websocket.html"
	ConstHTTPMethodDemoWebRTC          = "/demo/webrtc.html"
	ConstHTTPMethod404                 = "assets/web/404.html"
	ConstHTTPMethodFavicon             = "assets/ico/favicon.ico"
	ConstHTTPMethodSwagger             = "/swagger/*any"
	ConstHTTPMethodDoc                 = "doc/doc.json"
	ConstHTTPMethodV1PlayerWebsocket   = "/Player/WebSocket/Live/:deviceUniqID/:channelUniqID"
	ConstHTTPMethodV1PlayerJPEG        = "/Player/JPEG/Live/:deviceUniqID/:channelUniqID/:fileName"
	ConstHTTPMethodV1PlayerHLSRecord   = "/Player/HLS/Record/:deviceUniqID/:channelUniqID/:timeStart/:timeEnd/:fileName"
	ConstHTTPMethodV1PlayerHLSRecordTS = "" /* 126-byte string literal not displayed */
	ConstHTTPMethodV1PlayerMP4Record   = "/Player/MP4/Record/:deviceUniqID/:channelUniqID/:timeStart/:timeEnd/:fileName"
	ConstHTTPUriDoc                    = "/doc/doc.json"
	ConstHTTPPatchFavicon              = "./assets/ico/favicon.ico"
	ConstHTTPPatchDemoWebsocket        = "./assets/web/demo/websocket.html"
	ConstHTTPPatchDemoWebRTC           = "./assets/web/demo/webrtc.html"
	ConstHTTPPatchDocSwagger           = "assets/docs/server.swagger.json"
)

http server section

View Source
const (
	UNDEFINED = iota
	ONLINE
	WAIT
	CONNECT
	CONNECTED
	DISCONNECTED
	ERROR
)

Status of channels that can be

View Source
const (
	RTMP = iota
	RTSP
)

Description of basic types of delivery protocols

View Source
const (
	ErrorDeviceNotFound                  = errorCustom("deviceElement not found")
	ErrorDeviceChannelNotCodecInfo       = errorCustom("deviceElement channel not codec info")
	ErrorDeviceChannelReceiveCloseSignal = errorCustom("deviceElement channel receive close signal")
	ErrorDeviceChannelRouteAV            = errorCustom("deviceElement channel route AV")
	ErrorDeviceChannelCloseMuxer         = errorCustom("deviceElement channel close muxer")
	ErrorBadMachineID                    = errorCustom("bad machine ID")
	ErrorOnvifMediaUrlNotFound           = errorCustom("onvif media url not found")
	ErrorOnvifTokenNotFound              = errorCustom("onvif token not found")
	ErrorBadURL                          = errorCustom("bad url")
	ErrMetaDataNotFound                  = errorCustom("meta data not found")
)

Basic Messages

View Source
const (
	ErrorBadLicense       = errorCustom("validation bad validation")
	ErrorBadLicenseStatus = errorCustom("validation bad validation status")
)

License Messages

View Source
const (
	ErrorBadPortPort = errorCustom("bad port number")
)

ErrorBadPortPort - Server messages

View Source
const (
	MessageStop = iota
)

MessageStop - Thread Processing Signals

Variables

View Source
var (
	SystemRecordDirectory = "record"
	SystemByteDelimiter   = []byte{255, 0, 255, 0, 255, 0}
	MachineID             = ""
)

Basic record parameters

View Source
var (
	ErrNoAuthHeader      = status.Error(codes.Unauthenticated, "authorization header required")
	ErrCouldNotAuthorize = status.Error(codes.Internal, "authorization failed")
	ErrIncorrectToken    = status.Error(codes.Unauthenticated, "authorization fail incorrect token")
	ErrIncorrectPeriod   = status.Error(codes.Unauthenticated, "customError incorrect period")
	ErrDeviceNotFound    = status.Error(codes.NotFound, "device not found")
	ErrChannelNotFound   = status.Error(codes.NotFound, "channel not found")
	ErrSpectatorNotFound = status.Error(codes.NotFound, "spectator not found")
)

Mistakes from different places

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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