Documentation
¶
Index ¶
- Constants
- Variables
- func AddCounter(bytes uint64)
- func CleanOldCacheCoordinates()
- func CleanPid(pid string) string
- func CloseLogFile()
- func GetCoordinatesByYandex(addr string) [2]float64
- func GetCounterDay() []string
- func GetCounterDayWeek() []string
- func GetCounterDayYear() []string
- func GetCounterHour() []string
- func GetCounterMonth() []string
- func GetMyIp() string
- func GetMyIpByExternalApi() string
- func GetPid(serial string) string
- func GetSHA256(str string) string
- func LoadCounters()
- func LoadFile(name string, data interface{}) error
- func LoadOptions()
- func RandInt(min int, max int) int
- func RandomString(l int) string
- func ReOpenLogFile()
- func RotateLogFiles()
- func SaveCounters()
- func SaveFile(name string, data interface{}) error
- func SaveOptions()
- func SendEmail(to, subject, body string) (bool, error)
- func SwiftCounter()
- func UpdateCounterClient(adding bool)
- type VNC
- type YandexBody
- type YandexResp
Constants ¶
View Source
const ( WhitelabelName = "reVisit server" WhitelabelVersion = "0.7" CodeLength = 64 //длина code PasswordLength = 14 VNCFileList = "vnc.json" MaxLengthIDLog = 6 MaxLengthIDNode = 8 LengthSalt = 16 LengthToken = 32 WebSessionTimeoutHour = 2 PredefinedPass = "0000" UriServiceIpIFY = "https://api.ipify.org/" UriYandexMap = "https://api.lbs.yandex.net/geolocation" ReqYandexMap = `{"common": {"version": "1.0","api_key": "%s"},"ip": {"address_v4": "%s"}}` MinimalVersionForNodes = 0.97 MinimalVersionForStaticAlert = 0.98 StaticMessageEmpty = 0 StaticMessageNetworkError = 1 StaticMessageProxyError = 2 StaticMessageAuthError = 3 StaticMessageVncError = 4 StaticMessageTimeoutError = 5 StaticMessageAbsentError = 6 StaticMessageTypeError = 7 StaticMessageAuthFail = 8 StaticMessageRegFail = 9 StaticMessageRegMail = 10 StaticMessageRegSuccessful = 11 FileOptions = "options.json" ModeRegular = 0 ModeMaster = 1 ModeNode = 2 CountersFilename = "counters.json" LogName = "log.txt" WaitCount = 50 WaitIdle = 500 WaitAfterConnect = 250 WaitHelperCycle = 5 WaitPing = 10 WaitIdleAgent = 2 WaitConnection = 30 WriteTimeout = 13 ProfilesFilename = "profiles.json" )
Variables ¶
View Source
var ( Options = options{ MainServerPort: "65471", DataServerPort: "65475", HttpServerEnabled: true, HttpServerPort: "8090", HttpsServerEnabled: false, HttpsServerPort: "8091", HttpsCertPath: "cert.pem", HttpsKeyPath: "key.pem", SizeBuff: 16000, AdminLogin: "admin", AdminPass: "admin", Mode: ModeRegular, MyCoordinates: [2]float64{0, 0}, MasterServer: "data.rvisit.net", MasterPort: "65470", MasterPassword: "master", LogLevel: log.DebugLevel, IpCoordinateCacheTimeoutHours: 48, } )
Functions ¶
func AddCounter ¶
func AddCounter(bytes uint64)
func CleanOldCacheCoordinates ¶
func CleanOldCacheCoordinates()
func CloseLogFile ¶
func CloseLogFile()
func GetCoordinatesByYandex ¶
func GetCounterDay ¶
func GetCounterDay() []string
func GetCounterDayWeek ¶
func GetCounterDayWeek() []string
func GetCounterDayYear ¶
func GetCounterDayYear() []string
func GetCounterHour ¶
func GetCounterHour() []string
func GetCounterMonth ¶
func GetCounterMonth() []string
func GetMyIpByExternalApi ¶
func GetMyIpByExternalApi() string
func LoadCounters ¶
func LoadCounters()
func LoadOptions ¶
func LoadOptions()
func RandomString ¶
func ReOpenLogFile ¶
func ReOpenLogFile()
func RotateLogFiles ¶
func RotateLogFiles()
func SaveCounters ¶
func SaveCounters()
func SaveOptions ¶
func SaveOptions()
func SwiftCounter ¶
func SwiftCounter()
func UpdateCounterClient ¶
func UpdateCounterClient(adding bool)
Types ¶
type VNC ¶
type VNC struct {
FileServer string
FileClient string
//Команды используем для старта под админскими правами(обычно это создание сервиса)
CmdStartServer string
CmdStopServer string
CmdInstallServer string
CmdRemoveServer string
CmdConfigServer string
CmdManageServer string
//Команды используем для старта без админских прав
CmdStartServerUser string
CmdStopServerUser string
CmdInstallServerUser string
CmdRemoveServerUser string
CmdConfigServerUser string
CmdManageServerUser string
//Команды для vnc клиента
CmdStartClient string
CmdStopClient string
CmdInstallClient string
CmdRemoveClient string
CmdConfigClient string
CmdManageClient string
PortServerVNC string
Link string
Name string
Version string
Description string
}
VNC информация о vnc и основные команды для управления им
type YandexBody ¶
type YandexResp ¶
type YandexResp struct {
Position YandexBody `json:"position"`
}
Click to show internal directories.
Click to hide internal directories.