Documentation ¶
Index ¶
- Constants
- Variables
- func AddCounter(bytes uint64)
- func CleanPid(pid string) string
- func ClearLog()
- 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 LoadOptions()
- func LogAdd(TMessage int, Messages string)
- func RandInt(min int, max int) int
- func RandomString(l int) string
- func SaveCounters()
- func SaveOptions()
- func SendEmail(to string, body string) (bool, error)
- func SwiftCounter()
- func UpdateCounterClient(adding bool)
- type VNC
- type YandexBody
- type YandexResp
Constants ¶
View Source
const ( //ReVisitVersion - версия сервера или ноды, пока не используется ReVisitVersion = "0.7" //общие константы CodeLength = 64 //длина code PasswordLength = 14 VNCFileList = "/opt/vnc.list" MaxLengthIDLog = 6 //длина идентификатора потока для логов MaxLengthIDNode = 8 LengthSalt = 16 LengthToken = 32 WebSessionTimeoutHour = 2 PredefinedPass = "0000" UriServiceIpIFY = "https://api.ipify.org/" UriYandexMap = "http://api.lbs.yandex.net/geolocation" ReqYandexMap = `` /* 326-byte string literal not displayed */ //константы ограничений 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 = "/opt/options.cfg" ModeRegular = 0 ModeMaster = 1 ModeNode = 2 //виды сообщений логов MessError = 1 MessInfo = 2 MessDetail = 3 MessFull = 4 CountersFilename = "/opt/counters.json" LogFilename = "/opt/log.txt" LogSize = 20 * 1024 * 1024 //20MB //константы ожидания WaitCount = 50 WaitIdle = 500 WaitAfterConnect = 250 WaitHelperCycle = 5 WaitPing = 10 WaitIdleAgent = 2 WaitConnection = 30 ProfilesFilename = "/opt/profiles.list" )
Variables ¶
View Source
var ( //опции по-умолчанию Options = options{ MainServerPort: "65471", DataServerPort: "65475", HttpServerPort: "8090", HttpsServerPort: "8091", HttpsCertPath: "/opt/cert.pem", HttpsKeyPath: "/opt/key.pem", SizeBuff: 16000, AdminLogin: "admin", AdminPass: "admin", Mode: ModeRegular, MyCoordinates: [2]float64{0, 0}, DebugFlag: true, MasterServer: "localhost", MasterPort: "65470", MasterPassword: "master", LogLevel: MessFull, } )
Functions ¶
func AddCounter ¶
func AddCounter(bytes uint64)
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 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 }
информация о внц и основные команды для управления им
type YandexBody ¶
type YandexResp ¶
type YandexResp struct {
Position YandexBody `json:"position"`
}
Click to show internal directories.
Click to hide internal directories.