signald-go/cmd/signaldctl/common/signald.go

38 lines
609 B
Go

package common
import (
"log"
"github.com/jedib0t/go-pretty/v6/table"
"gitlab.com/signald/signald-go/signald"
)
const (
OutputFormatDefault = "default"
OutputFormatCSV = "csv"
OutputFormatTable = "table"
OutputFormatJSON = "json"
OutputFormatYAML = "yaml"
OutputFormatQR = "qr"
OutputFormatMarkdown = "md"
OutputFormatMan = "man"
AnnotationNoSocketConnection = "no-socket"
)
var (
Signald *signald.Signald
OutputFormat string
)
func Must(err error) {
if err != nil {
log.Fatal(err)
}
}
func StylizeTable(t table.Writer) {
t.SetStyle(table.StyleLight)
}