forked from toolshed/abra
		
	refactor: formatter gets own package
This commit is contained in:
		| @ -5,12 +5,12 @@ import ( | |||||||
| 	"os" | 	"os" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
| 	"coopcloud.tech/abra/pkg/container" | 	"coopcloud.tech/abra/pkg/container" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/docker/docker/api/types" | 	"github.com/docker/docker/api/types" | ||||||
| 	"github.com/docker/docker/api/types/filters" | 	"github.com/docker/docker/api/types/filters" | ||||||
| 	"github.com/docker/docker/pkg/archive" | 	"github.com/docker/docker/pkg/archive" | ||||||
|  | |||||||
| @ -5,9 +5,9 @@ import ( | |||||||
| 	"sort" | 	"sort" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"coopcloud.tech/abra/pkg/ssh" | 	"coopcloud.tech/abra/pkg/ssh" | ||||||
| 	"coopcloud.tech/tagcmp" | 	"coopcloud.tech/tagcmp" | ||||||
| @ -209,7 +209,7 @@ can take some time. | |||||||
| 				tableCol = append(tableCol, []string{"status", "version", "upgrade"}...) | 				tableCol = append(tableCol, []string{"status", "version", "upgrade"}...) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			table := abraFormatter.CreateTable(tableCol) | 			table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 			for _, appStat := range serverStat.apps { | 			for _, appStat := range serverStat.apps { | ||||||
| 				tableRow := []string{appStat.recipe, appStat.appName, appStat.domain} | 				tableRow := []string{appStat.recipe, appStat.appName, appStat.domain} | ||||||
|  | |||||||
| @ -4,14 +4,14 @@ import ( | |||||||
| 	"strings" | 	"strings" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	stack "coopcloud.tech/abra/pkg/upstream/stack" | 	stack "coopcloud.tech/abra/pkg/upstream/stack" | ||||||
| 	"github.com/buger/goterm" | 	"github.com/buger/goterm" | ||||||
| 	"github.com/docker/cli/cli/command/formatter" | 	dockerFormatter "github.com/docker/cli/cli/command/formatter" | ||||||
| 	"github.com/docker/docker/api/types" | 	"github.com/docker/docker/api/types" | ||||||
| 	"github.com/docker/docker/api/types/filters" | 	"github.com/docker/docker/api/types/filters" | ||||||
| 	dockerClient "github.com/docker/docker/client" | 	dockerClient "github.com/docker/docker/client" | ||||||
| @ -71,7 +71,7 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	tableCol := []string{"image", "created", "status", "state", "ports"} | 	tableCol := []string{"image", "created", "status", "state", "ports"} | ||||||
| 	table := abraFormatter.CreateTable(tableCol) | 	table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 	for _, container := range containers { | 	for _, container := range containers { | ||||||
| 		var containerNames []string | 		var containerNames []string | ||||||
| @ -81,11 +81,11 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) { | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableRow := []string{ | 		tableRow := []string{ | ||||||
| 			abraFormatter.RemoveSha(container.Image), | 			formatter.RemoveSha(container.Image), | ||||||
| 			abraFormatter.HumanDuration(container.Created), | 			formatter.HumanDuration(container.Created), | ||||||
| 			container.Status, | 			container.Status, | ||||||
| 			container.State, | 			container.State, | ||||||
| 			formatter.DisplayablePorts(container.Ports), | 			dockerFormatter.DisplayablePorts(container.Ports), | ||||||
| 		} | 		} | ||||||
| 		table.Append(tableRow) | 		table.Append(tableRow) | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -6,10 +6,10 @@ import ( | |||||||
| 	"os" | 	"os" | ||||||
| 	"strconv" | 	"strconv" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/secret" | 	"coopcloud.tech/abra/pkg/secret" | ||||||
| 	"github.com/docker/docker/api/types" | 	"github.com/docker/docker/api/types" | ||||||
| 	"github.com/docker/docker/api/types/filters" | 	"github.com/docker/docker/api/types/filters" | ||||||
| @ -83,7 +83,7 @@ var appSecretGenerateCommand = &cli.Command{ | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableCol := []string{"name", "value"} | 		tableCol := []string{"name", "value"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
| 		for name, val := range secretVals { | 		for name, val := range secretVals { | ||||||
| 			table.Append([]string{name, val}) | 			table.Append([]string{name, val}) | ||||||
| 		} | 		} | ||||||
| @ -215,7 +215,7 @@ var appSecretLsCommand = &cli.Command{ | |||||||
| 		secrets := secret.ReadSecretEnvVars(app.Env) | 		secrets := secret.ReadSecretEnvVars(app.Env) | ||||||
|  |  | ||||||
| 		tableCol := []string{"Name", "Version", "Generated Name", "Created On Server"} | 		tableCol := []string{"Name", "Version", "Generated Name", "Created On Server"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 		cl, err := client.New(app.Server) | 		cl, err := client.New(app.Server) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
|  | |||||||
| @ -3,10 +3,10 @@ package app | |||||||
| import ( | import ( | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"coopcloud.tech/abra/pkg/upstream/stack" | 	"coopcloud.tech/abra/pkg/upstream/stack" | ||||||
| 	"github.com/docker/distribution/reference" | 	"github.com/docker/distribution/reference" | ||||||
| @ -81,7 +81,7 @@ Cloud recipe version. | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableCol := []string{"version", "service", "image", "digest"} | 		tableCol := []string{"version", "service", "image", "digest"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
| 		table.SetAutoMergeCellsByColumnIndex([]int{0}) | 		table.SetAutoMergeCellsByColumnIndex([]int{0}) | ||||||
|  |  | ||||||
| 		for serviceName, versionMeta := range versionsMeta { | 		for serviceName, versionMeta := range versionsMeta { | ||||||
|  | |||||||
| @ -1,10 +1,10 @@ | |||||||
| package app | package app | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/AlecAivazis/survey/v2" | 	"github.com/AlecAivazis/survey/v2" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
| @ -23,7 +23,7 @@ var appVolumeListCommand = &cli.Command{ | |||||||
| 			logrus.Fatal(err) | 			logrus.Fatal(err) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		table := abraFormatter.CreateTable([]string{"driver", "volume name"}) | 		table := formatter.CreateTable([]string{"driver", "volume name"}) | ||||||
| 		var volTable [][]string | 		var volTable [][]string | ||||||
| 		for _, volume := range volumeList { | 		for _, volume := range volumeList { | ||||||
| 			volRow := []string{ | 			volRow := []string{ | ||||||
|  | |||||||
| @ -6,10 +6,10 @@ import ( | |||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"path" | 	"path" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	gitPkg "coopcloud.tech/abra/pkg/git" | 	gitPkg "coopcloud.tech/abra/pkg/git" | ||||||
| 	"coopcloud.tech/abra/pkg/limit" | 	"coopcloud.tech/abra/pkg/limit" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
|  | |||||||
| @ -4,10 +4,10 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
| 	"coopcloud.tech/abra/pkg/dns" | 	"coopcloud.tech/abra/pkg/dns" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/git" | 	"coopcloud.tech/abra/pkg/git" | ||||||
| 	"coopcloud.tech/abra/pkg/lint" | 	"coopcloud.tech/abra/pkg/lint" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| @ -158,7 +158,7 @@ func DeployAction(c *cli.Context) error { | |||||||
| // DeployOverview shows a deployment overview | // DeployOverview shows a deployment overview | ||||||
| func DeployOverview(app config.App, version, message string) error { | func DeployOverview(app config.App, version, message string) error { | ||||||
| 	tableCol := []string{"server", "compose", "domain", "app name", "version"} | 	tableCol := []string{"server", "compose", "domain", "app name", "version"} | ||||||
| 	table := abraFormatter.CreateTable(tableCol) | 	table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 	deployConfig := "compose.yml" | 	deployConfig := "compose.yml" | ||||||
| 	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok { | 	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok { | ||||||
| @ -196,7 +196,7 @@ func DeployOverview(app config.App, version, message string) error { | |||||||
| // NewVersionOverview shows an upgrade or downgrade overview | // NewVersionOverview shows an upgrade or downgrade overview | ||||||
| func NewVersionOverview(app config.App, currentVersion, newVersion string) error { | func NewVersionOverview(app config.App, currentVersion, newVersion string) error { | ||||||
| 	tableCol := []string{"server", "compose", "domain", "app name", "current version", "to be deployed"} | 	tableCol := []string{"server", "compose", "domain", "app name", "current version", "to be deployed"} | ||||||
| 	table := abraFormatter.CreateTable(tableCol) | 	table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 	deployConfig := "compose.yml" | 	deployConfig := "compose.yml" | ||||||
| 	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok { | 	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok { | ||||||
|  | |||||||
| @ -4,8 +4,8 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"path" | 	"path" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| 	recipePkg "coopcloud.tech/abra/pkg/recipe" | 	recipePkg "coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"coopcloud.tech/abra/pkg/secret" | 	"coopcloud.tech/abra/pkg/secret" | ||||||
| @ -149,7 +149,7 @@ func NewAction(c *cli.Context) error { | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		secretCols := []string{"Name", "Value"} | 		secretCols := []string{"Name", "Value"} | ||||||
| 		secretTable := abraFormatter.CreateTable(secretCols) | 		secretTable := formatter.CreateTable(secretCols) | ||||||
| 		for secret := range secrets { | 		for secret := range secrets { | ||||||
| 			secretTable.Append([]string{secret, secrets[secret]}) | 			secretTable.Append([]string{secret, secrets[secret]}) | ||||||
| 		} | 		} | ||||||
| @ -164,7 +164,7 @@ func NewAction(c *cli.Context) error { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	tableCol := []string{"Name", "Domain", "Type", "Server"} | 	tableCol := []string{"Name", "Domain", "Type", "Server"} | ||||||
| 	table := abraFormatter.CreateTable(tableCol) | 	table := formatter.CreateTable(tableCol) | ||||||
| 	table.Append([]string{sanitisedAppName, Domain, recipe.Name, NewAppServer}) | 	table.Append([]string{sanitisedAppName, Domain, recipe.Name, NewAppServer}) | ||||||
|  |  | ||||||
| 	fmt.Println("") | 	fmt.Println("") | ||||||
|  | |||||||
| @ -3,9 +3,9 @@ package recipe | |||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/lint" | 	"coopcloud.tech/abra/pkg/lint" | ||||||
| 	recipePkg "coopcloud.tech/abra/pkg/recipe" | 	recipePkg "coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import ( | |||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
|  | |||||||
| @ -6,10 +6,10 @@ import ( | |||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	gitPkg "coopcloud.tech/abra/pkg/git" | 	gitPkg "coopcloud.tech/abra/pkg/git" | ||||||
| 	"coopcloud.tech/abra/pkg/recipe" | 	"coopcloud.tech/abra/pkg/recipe" | ||||||
| 	recipePkg "coopcloud.tech/abra/pkg/recipe" | 	recipePkg "coopcloud.tech/abra/pkg/recipe" | ||||||
| @ -282,7 +282,7 @@ func tagRelease(tagString string, repo *git.Repository) error { | |||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	hash := abraFormatter.SmallSHA(head.Hash().String()) | 	hash := formatter.SmallSHA(head.Hash().String()) | ||||||
| 	logrus.Debugf(fmt.Sprintf("created tag %s at %s", tagString, hash)) | 	logrus.Debugf(fmt.Sprintf("created tag %s at %s", tagString, hash)) | ||||||
|  |  | ||||||
| 	return nil | 	return nil | ||||||
|  | |||||||
| @ -1,9 +1,9 @@ | |||||||
| package recipe | package recipe | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | 	"coopcloud.tech/abra/pkg/autocomplete" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	recipePkg "coopcloud.tech/abra/pkg/recipe" | 	recipePkg "coopcloud.tech/abra/pkg/recipe" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
|  | |||||||
| @ -4,9 +4,9 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strconv" | 	"strconv" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/libdns/gandi" | 	"github.com/libdns/gandi" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
| @ -55,7 +55,7 @@ are listed. This zone must already be created on your provider account. | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 		for _, record := range records { | 		for _, record := range records { | ||||||
| 			value := record.Value | 			value := record.Value | ||||||
|  | |||||||
| @ -4,10 +4,10 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strconv" | 	"strconv" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/dns" | 	"coopcloud.tech/abra/pkg/dns" | ||||||
| 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/libdns/gandi" | 	"github.com/libdns/gandi" | ||||||
| 	"github.com/libdns/libdns" | 	"github.com/libdns/libdns" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| @ -135,7 +135,7 @@ You may also invoke this command in "wizard" mode and be prompted for input | |||||||
| 		createdRecord := createdRecords[0] | 		createdRecord := createdRecords[0] | ||||||
|  |  | ||||||
| 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 		value := createdRecord.Value | 		value := createdRecord.Value | ||||||
| 		if len(createdRecord.Value) > 30 { | 		if len(createdRecord.Value) > 30 { | ||||||
| @ -186,7 +186,7 @@ func autoConfigure(c *cli.Context, provider *gandi.Provider, zone string) error | |||||||
| 	records := []libdns.Record{atRecord, wildcardRecord} | 	records := []libdns.Record{atRecord, wildcardRecord} | ||||||
|  |  | ||||||
| 	tableCol := []string{"type", "name", "value", "TTL", "priority"} | 	tableCol := []string{"type", "name", "value", "TTL", "priority"} | ||||||
| 	table := abraFormatter.CreateTable(tableCol) | 	table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 	for _, record := range records { | 	for _, record := range records { | ||||||
| 		existingRecords, err := provider.GetRecords(c.Context, zone) | 		existingRecords, err := provider.GetRecords(c.Context, zone) | ||||||
|  | |||||||
| @ -4,9 +4,9 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strconv" | 	"strconv" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | 	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/AlecAivazis/survey/v2" | 	"github.com/AlecAivazis/survey/v2" | ||||||
| 	"github.com/libdns/gandi" | 	"github.com/libdns/gandi" | ||||||
| 	"github.com/libdns/libdns" | 	"github.com/libdns/libdns" | ||||||
| @ -88,7 +88,7 @@ You may also invoke this command in "wizard" mode and be prompted for input | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | 		tableCol := []string{"type", "name", "value", "TTL", "priority"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := formatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 		value := toDelete.Value | 		value := toDelete.Value | ||||||
| 		if len(toDelete.Value) > 30 { | 		if len(toDelete.Value) > 30 { | ||||||
|  | |||||||
| @ -3,9 +3,9 @@ package server | |||||||
| import ( | import ( | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
| 	"coopcloud.tech/abra/pkg/context" | 	"coopcloud.tech/abra/pkg/context" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/docker/cli/cli/connhelper/ssh" | 	"github.com/docker/cli/cli/connhelper/ssh" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
|  | |||||||
| @ -4,8 +4,8 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/libcapsul" | 	"coopcloud.tech/libcapsul" | ||||||
| 	"github.com/AlecAivazis/survey/v2" | 	"github.com/AlecAivazis/survey/v2" | ||||||
| 	"github.com/hetznercloud/hcloud-go/hcloud" | 	"github.com/hetznercloud/hcloud-go/hcloud" | ||||||
|  | |||||||
| @ -5,10 +5,10 @@ import ( | |||||||
| 	"os" | 	"os" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/AlecAivazis/survey/v2" | 	"github.com/AlecAivazis/survey/v2" | ||||||
| 	"github.com/hetznercloud/hcloud-go/hcloud" | 	"github.com/hetznercloud/hcloud-go/hcloud" | ||||||
| 	"github.com/sirupsen/logrus" | 	"github.com/sirupsen/logrus" | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import ( | |||||||
| 	"path" | 	"path" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"coopcloud.tech/abra/pkg/upstream/convert" | 	"coopcloud.tech/abra/pkg/upstream/convert" | ||||||
| 	loader "coopcloud.tech/abra/pkg/upstream/stack" | 	loader "coopcloud.tech/abra/pkg/upstream/stack" | ||||||
| 	stack "coopcloud.tech/abra/pkg/upstream/stack" | 	stack "coopcloud.tech/abra/pkg/upstream/stack" | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"strings" | 	"strings" | ||||||
|  |  | ||||||
| 	abraFormatter "coopcloud.tech/abra/cli/formatter" | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	"github.com/AlecAivazis/survey/v2" | 	"github.com/AlecAivazis/survey/v2" | ||||||
| 	"github.com/docker/docker/api/types" | 	"github.com/docker/docker/api/types" | ||||||
| 	"github.com/docker/docker/api/types/filters" | 	"github.com/docker/docker/api/types/filters" | ||||||
| @ -33,7 +33,7 @@ func GetContainer(c context.Context, cl *client.Client, filters filters.Args, pr | |||||||
| 		for _, container := range containers { | 		for _, container := range containers { | ||||||
| 			containerName := strings.Join(container.Names, " ") | 			containerName := strings.Join(container.Names, " ") | ||||||
| 			trimmed := strings.TrimPrefix(containerName, "/") | 			trimmed := strings.TrimPrefix(containerName, "/") | ||||||
| 			created := abraFormatter.HumanDuration(container.Created) | 			created := formatter.HumanDuration(container.Created) | ||||||
| 			containersRaw = append(containersRaw, fmt.Sprintf("%s (created %v)", trimmed, created)) | 			containersRaw = append(containersRaw, fmt.Sprintf("%s (created %v)", trimmed, created)) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | |||||||
| @ -10,10 +10,10 @@ import ( | |||||||
| 	"strings" | 	"strings" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/formatter" |  | ||||||
| 	"coopcloud.tech/abra/pkg/client" | 	"coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/compose" | 	"coopcloud.tech/abra/pkg/compose" | ||||||
| 	"coopcloud.tech/abra/pkg/config" | 	"coopcloud.tech/abra/pkg/config" | ||||||
|  | 	"coopcloud.tech/abra/pkg/formatter" | ||||||
| 	gitPkg "coopcloud.tech/abra/pkg/git" | 	gitPkg "coopcloud.tech/abra/pkg/git" | ||||||
| 	"coopcloud.tech/abra/pkg/upstream/stack" | 	"coopcloud.tech/abra/pkg/upstream/stack" | ||||||
| 	loader "coopcloud.tech/abra/pkg/upstream/stack" | 	loader "coopcloud.tech/abra/pkg/upstream/stack" | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user