Documentation ¶
Index ¶
- func ConfigFilePath() (string, error)
- func DeleteServer(sclient *hcloud.ServerClient, serverName string) error
- func DeleteVolume(vclient *hcloud.VolumeClient, serverName string) error
- func DestroyAllDeadServers(client *hcloud.Client) error
- func DumpJsonFile(obj map[string]string, path string) error
- func DumpJsonString(obj map[string]string, path string) (string, error)
- func FileExists(FilePath string) (bool, error)
- func GetSFTPClient(conn *ssh.Client) (*sftp.Client, error)
- func GetSSHFingerprint(pubkey string) (string, error)
- func GetServerAgeInHours(sclient *hcloud.ServerClient, serverName string) (int, error)
- func GetVolumeLinuxDeviceForServer(client *hcloud.Client, serverName string) (string, error)
- func ReadVarsJsonFile(path string) (map[string]string, error)
- func SFTPCopyFileToRemote(client *sftp.Client, dest string, source string) error
- func SFTPFileExistsAtRemote(conn *ssh.Client, path string) bool
- func ServerNameFromSHA256(sum string) string
- func TryDeleteServer(client *hcloud.Client, serverName string, maxTries int, interval int) error
- func UpdateSSHKeyLabel(sclient *hcloud.SSHKeyClient, sshKey *hcloud.SSHKey, key string, value string) (*hcloud.SSHKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
func DeleteServer ¶
func DeleteServer(sclient *hcloud.ServerClient, serverName string) error
func DeleteVolume ¶
func DeleteVolume(vclient *hcloud.VolumeClient, serverName string) error
func DestroyAllDeadServers ¶
Remove all servers at hetzner project which is running beyond 24 hours. This is because we want to reduce cost at all times and we really don't want dead expesive servers running around wasting our money. So to accomplish that we simply destroy servers older than 24 hours or with age of 24 hours. We destroy servers whenever we see them or connect with the api.
"If you are 1 day old then you are dead to me." -- Antony J.R
func FileExists ¶
func GetSSHFingerprint ¶
func GetServerAgeInHours ¶
func GetServerAgeInHours(sclient *hcloud.ServerClient, serverName string) (int, error)
func SFTPCopyFileToRemote ¶
func ServerNameFromSHA256 ¶
Short SHA256 Sum is used since sha256 sum is simply too long for a server name in Hetzner. It's concatenation of first 7 characters and last 7 characters of the original sha256 sum hex.
func TryDeleteServer ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.