Documentation
¶
Index ¶
- Constants
- Variables
- func Init()
- func LoadAll(folder string)
- func MarshalAndWriteMsg(writer io.Writer, aMessage interface{}) (err error)
- func MarshalMsg(aMessage interface{}) (_ []byte, err error)
- func ReadAndUnmarshalMsg(reader io.Reader, aMessage interface{}) (err error)
- func SaveAll(list HostList, folder string)
- func SaveList(list HostList, filename string)
- func UpdateFromEsx(list HostList)
- type Host
- type HostList
- type MsgAll
- type MsgTTYReceiverInitReply
- type MsgTTYReceiverInitRequest
- type MsgTTYSenderInitReply
- type MsgTTYSenderInitRequest
- type MsgTTYSenderNewReceiverConnected
- type MsgTTYWinSize
- type MsgTTYWrite
- type ProtocolMessageIDType
- type ReceiverSessionInfo
- type RemoteEnvInfo
- type SenderSessionInfo
- type ServerSessionInfo
- type TTYProtocolConn
- func (protoConn *TTYProtocolConn) Close() error
- func (protoConn *TTYProtocolConn) InitReceiverServerConn(receiverInfo ReceiverSessionInfo) (serverInfo ServerSessionInfo, err error)
- func (protoConn *TTYProtocolConn) InitSender(senderInfo SenderSessionInfo) (serverInfo ServerSessionInfo, err error)
- func (protoConn *TTYProtocolConn) InitServer(serverInfo ServerSessionInfo) (senderInfo SenderSessionInfo, err error)
- func (protoConn *TTYProtocolConn) InitServerReceiverConn(serverInfo ServerSessionInfo) (receiverInfo ReceiverSessionInfo, err error)
- func (protoConn *TTYProtocolConn) ReadMessage() (msg MsgAll, err error)
- func (protoConn *TTYProtocolConn) SetWinSize(cols, rows int) error
- func (protoConn *TTYProtocolConn) Write(buff []byte) (int, error)
- func (protoConn *TTYProtocolConn) WriteRawData(buff []byte) (int, error)
Constants ¶
View Source
const ( MsgIDSenderInitRequest = "SenderInitRequest" MsgIDSenderInitReply = "SenderInitReply" MsgIDSenderNewReceiverConnected = "SenderNewReceiverConnected" MsgIDReceiverInitRequest = "ReceiverInitRequest" MsgIDReceiverInitReply = "ReceiverInitReply" MsgIDWrite = "Write" MsgIDWinSize = "WinSize" )
Variables ¶
View Source
var WholeList map[string]HostList
WholeList = list of all hosts list
Functions ¶
func MarshalAndWriteMsg ¶
func MarshalMsg ¶
func ReadAndUnmarshalMsg ¶
func UpdateFromEsx ¶
func UpdateFromEsx(list HostList)
UpdateFromEsx from esx glpi scan, load all files
Types ¶
type Host ¶
type Host struct {
Name string `json:"name"`
Connect struct {
Service string `json:"service"`
Address string `json:"address"`
Port int `json:"port"`
Credentials struct {
Key string `json:"key,omitempty"`
Login string `json:"login,omitempty"`
Password string `json:"password,omitempty"`
} `json:"credentials"`
} `json:"connect"`
Type string `json:"type"`
Parent string `json:"parent"`
Os string `json:"os"`
Ips []string `json:"ips"`
Comment string `json:"comment"`
Project string `json:"project"`
Domain string `json:"domain"`
Status string `json:"status"`
Ignore bool `json:"ignore"`
Activeusers []string `json:"activeusers"`
CPU struct {
Type string `json:"type"`
Count int `json:"count"`
} `json:"cpu"`
RAM string `json:"ram"`
Disks []struct {
Type string `json:"type"`
Capacity string `json:"capacity"`
} `json:"disks"`
Ports []int `json:"ports"`
Containers []struct {
Name string `json:"name"`
Services []string `json:"services"`
Ports []int `json:"ports"`
} `json:"containers"`
Crontabs []struct {
User string `json:"user"`
Frequency string `json:"frequency"`
Script string `json:"script"`
} `json:"crontabs"`
Firewall string `json:"firewall"`
Lastconnect string `json:"lastconnect"`
}
Host desc
type HostList ¶
type HostList struct {
Name string `json:"name"`
Domain string `json:"domain"`
Hosts []Host `json:"hosts"`
}
HostList is holding hosts list
type MsgAll ¶
type MsgAll struct {
Type ProtocolMessageIDType
Data []byte
}
Message used to encapsulate the rest of the bessages bellow
type MsgTTYReceiverInitReply ¶
type MsgTTYReceiverInitReply struct {
}
type MsgTTYReceiverInitRequest ¶
type MsgTTYReceiverInitRequest struct {
ChallengeReply string
}
type MsgTTYSenderInitReply ¶
type MsgTTYSenderInitReply struct {
ReceiverURLWebReadWrite string
}
type MsgTTYSenderInitRequest ¶
type MsgTTYSenderInitRequest struct {
Salt string
PasswordVerifierA string
Source RemoteEnvInfo
}
These messages are used between the server and the sender/receiver
type MsgTTYSenderNewReceiverConnected ¶
type MsgTTYSenderNewReceiverConnected struct {
Name string
}
type MsgTTYWinSize ¶
type MsgTTYWrite ¶
These messages are not intended for the server, so they are just forwarded by it to the remote side.
type ProtocolMessageIDType ¶
type ProtocolMessageIDType string
type ReceiverSessionInfo ¶
type ReceiverSessionInfo struct {
}
type RemoteEnvInfo ¶
type SenderSessionInfo ¶
type SenderSessionInfo struct {
Salt string
PasswordVerifierA string
Source RemoteEnvInfo
}
type ServerSessionInfo ¶
type ServerSessionInfo struct {
URLWebReadWrite string
}
type TTYProtocolConn ¶
type TTYProtocolConn struct {
// contains filtered or unexported fields
}
TTYProtocolConn is the interface used to communicate with the sending (master) side of the TTY session
func NewTTYProtocolConn ¶
func NewTTYProtocolConn(conn io.ReadWriteCloser) *TTYProtocolConn
func (*TTYProtocolConn) Close ¶
func (protoConn *TTYProtocolConn) Close() error
func (*TTYProtocolConn) InitReceiverServerConn ¶
func (protoConn *TTYProtocolConn) InitReceiverServerConn(receiverInfo ReceiverSessionInfo) (serverInfo ServerSessionInfo, err error)
func (*TTYProtocolConn) InitSender ¶
func (protoConn *TTYProtocolConn) InitSender(senderInfo SenderSessionInfo) (serverInfo ServerSessionInfo, err error)
Function to be called on the sender side, and which blocks until the protocol has been initialised
func (*TTYProtocolConn) InitServer ¶
func (protoConn *TTYProtocolConn) InitServer(serverInfo ServerSessionInfo) (senderInfo SenderSessionInfo, err error)
func (*TTYProtocolConn) InitServerReceiverConn ¶
func (protoConn *TTYProtocolConn) InitServerReceiverConn(serverInfo ServerSessionInfo) (receiverInfo ReceiverSessionInfo, err error)
func (*TTYProtocolConn) ReadMessage ¶
func (protoConn *TTYProtocolConn) ReadMessage() (msg MsgAll, err error)
func (*TTYProtocolConn) SetWinSize ¶
func (protoConn *TTYProtocolConn) SetWinSize(cols, rows int) error
func (*TTYProtocolConn) Write ¶
func (protoConn *TTYProtocolConn) Write(buff []byte) (int, error)
Function to send data from one the sender to the server and the other way around.
func (*TTYProtocolConn) WriteRawData ¶
func (protoConn *TTYProtocolConn) WriteRawData(buff []byte) (int, error)
Click to show internal directories.
Click to hide internal directories.