Documentation ¶
Overview ¶
Monitor the uptime of gcp computer instances and act accordingly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintCheck ¶
func SecondsToHuman ¶
SecondsToHuman translate seconds into a human readable string with a specific length.
fmt.Printf("time: %s\n", SecondsToHuman(500))
Types ¶
type Instance ¶
type Instance struct { Name string Project string Zone string Status string LastStartTimestamp string TooOld bool Age int64 Action string MaxAge int }
Instance struct to contain the relevant element of an instance
type InstanceConfig ¶
type InstanceConfig struct { Project string // Name of the GCP Project Zone string // Name of the GCP Zone Name string // Name of the GCP Instance MaxAge int // Maximum amount of seconds the machine can be up Action string // Action to be taken when time exceeded }
InstanceConfig configuration of a single instance.
func NewInstanceConfig ¶
func NewInstanceConfig(instr string) (*InstanceConfig, error)
NewInstanceConfig initialize a new InstanceConfig
func (InstanceConfig) Description ¶
func (ic InstanceConfig) Description() string
Description return the description of an instance
type InstanceConfigs ¶
type InstanceConfigs struct { Bucketname string InstanceConfigs []InstanceConfig }
InstanceConfigs FIXME putin somthing useful
func NewInstanceConfigs ¶
func NewInstanceConfigs(bucketname string) *InstanceConfigs
NewInstanceConfigs initialize the InstanceConfigs object
Source Files ¶
Click to show internal directories.
Click to hide internal directories.