cli

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT = 120

Variables

This section is empty.

Functions

func ClearWorker added in v0.1.0

func ClearWorker(id int, client client.IArgoCDClient, context context.Context, projects <-chan *v1alpha1.AppProject, results chan<- WorkerResult)

func SetWorker added in v0.1.0

func SetWorker(id int, client client.IArgoCDClient, context context.Context, syncWindowsToSet []v1alpha1.SyncWindow, projects <-chan *v1alpha1.AppProject, results chan<- WorkerResult)

Types

type Argonap

type Argonap struct {
	*Config

	// Client
	ArgoCDClient          client.IArgoCDClient
	ArgoCDClientConnected bool

	// Allow swapping out stdout/stderr for testing.
	Out io.Writer
	Err io.Writer
}

Argonap is the logic/orchestrator.

func New

func New() *Argonap

New returns a new instance of argonap.

func NewWithConfig

func NewWithConfig(config Config) *Argonap

func (*Argonap) ClearSyncWindows

func (a *Argonap) ClearSyncWindows()

func (*Argonap) Connect

func (a *Argonap) Connect()

func (*Argonap) Error

func (a *Argonap) Error(msg interface{})

Error pritns an error to stderr and exits with error code 1.

func (*Argonap) Output

func (a *Argonap) Output(msg interface{})

Output prints a normal message to stdout.

func (*Argonap) OutputHeading

func (a *Argonap) OutputHeading(msg interface{})

OutputHeading prints a header to stdout.

func (*Argonap) OutputResult added in v0.1.0

func (a *Argonap) OutputResult(result WorkerResult)

OutputResult prints results to stdout.

func (*Argonap) SetSyncWindows

func (a *Argonap) SetSyncWindows()

type Config

type Config struct {
	ServerAddr      string
	Insecure        bool
	AuthToken       string
	DryRun          bool
	ProjectNames    []string
	LabelsAsStrings []string
	Labels          map[string]string
	SyncWindowsFile string
	Timeout         int
	Workers         int
}

type StatusType added in v0.1.0

type StatusType string
const (
	StatusSuccess    StatusType = "Success"
	StatusFailure    StatusType = "Failure"
	StatusIncomplete StatusType = "Incomplete"
)

type WorkerResult added in v0.1.0

type WorkerResult struct {
	Status      StatusType
	SyncWindows int
	ProjectName string
	Err         *error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL