package main import "go.wit.com/log" /* this parses the command line arguements this enables command line options from other packages like 'gui' and 'log' */ var argv args type args struct { Xml []string `arg:"--libvirt" help:"add current xml files: --libvirt /etc/libvirt/qemu/*.xml"` Save bool `arg:"--save" default:"false" help:"save config protobuf after libvirt file import"` Config string `arg:"--config" help:"defaults to ~/.config/virtigo/"` Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` Daemon bool `arg:"--daemon" help:"run in daemon mode"` } // Uptime bool `arg:"--uptime" default:"true" help:"allow uptime checks for things like Kuma"` // Hosts []string `arg:"--hosts" help:"hosts to connect to"` func (a args) Description() string { return ` virtigo will help control your cluster of hypervisiors This maintains a master list of all your vm's (aka 'droplets') in your homelab cloud. You can import libvirt xml files. This app talks to your hypervisors via the virtigod daemon. Runs a http server so you can control your virtual machines with things like: start virtual machines with: curl http://virtigo.wit.com/start?www.wit.com Import your existing libvirt xml files with: virtigo --libvirt ~/mymachines/*.xml --save ` } func (args) Version() string { return "virtigo " + Version } var INFO *log.LogFlag var POLL *log.LogFlag var WARN *log.LogFlag var SPEW *log.LogFlag var EVENT *log.LogFlag func init() { full := "go.wit.com/apps/virtigo" short := "virtigo" INFO = log.NewFlag("INFO", false, full, short, "general virtigo") POLL = log.NewFlag("POLL", false, full, short, "virtigo polling") SPEW = log.NewFlag("SPEW", true, full, short, "bad things") EVENT = log.NewFlag("EVENT", true, full, short, "hypeprvisor/droplet events") }