argocd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgoCDClient

type ArgoCDClient struct {
	Options *ArgoCDClientOptions
	// contains filtered or unexported fields
}

func (*ArgoCDClient) GetUrl

func (c *ArgoCDClient) GetUrl() string

func (*ArgoCDClient) List

type ArgoCDClientOptions

type ArgoCDClientOptions struct {
	Address         string
	Insecure        bool
	AuthTokenEnvVar string
}

type ArgoCDWrapper

type ArgoCDWrapper struct {
	ArgoCDClientOptions *ArgoCDWrapperOptions
	ListWorkerPool      pond.ResultPool[[]ListApplicationsResult]
	ManifestsWorkerPool pond.ResultPool[[]string]
	ApplicationClient   IArgoCDClient
}

func (*ArgoCDWrapper) GetManifests

func (a *ArgoCDWrapper) GetManifests(ctx context.Context, applicationName string, liveRef string, targetRef string) (*GetManifestsResponse, error)

func (*ArgoCDWrapper) GetUrl

func (a *ArgoCDWrapper) GetUrl() string

func (*ArgoCDWrapper) ListApplicationsByLabels

func (a *ArgoCDWrapper) ListApplicationsByLabels(ctx context.Context, labels map[string]string) ([]ListApplicationsResult, error)

type ArgoCDWrapperOptions

type ArgoCDWrapperOptions struct {
	ListPoolWorkers        int
	ManifestsPoolWorkers   int
	DoNotInstrumentWorkers bool
}

type GetManifestsResponse

type GetManifestsResponse struct {
	LiveManifests   []string
	TargetManifests []string
}

type IArgoCDClient

type IArgoCDClient interface {
	// List returns all ArgoCD applications
	List(ctx context.Context, in *application.ApplicationQuery) (*v1alpha1.ApplicationList, error)
	GetApplicationManifests(ctx context.Context, in *application.ApplicationManifestQuery) (*repoServerApiClient.ManifestResponse, error)
	GetUrl() string
}

ArgoCDClient defines the interface for interacting with ArgoCD

func NewArgoCDClient

func NewArgoCDClient(options *ArgoCDClientOptions) (IArgoCDClient, error)

type IArgoCDWrapper

type IArgoCDWrapper interface {
	ListApplicationsByLabels(ctx context.Context, labels map[string]string) ([]ListApplicationsResult, error)
	GetManifests(ctx context.Context, applicationName string, liveRef string, targetRef string) (*GetManifestsResponse, error)
	GetUrl() string
}

func New

func New(client IArgoCDClient, argoCDName string, options *ArgoCDWrapperOptions) (IArgoCDWrapper, error)

type ListApplicationsResult

type ListApplicationsResult struct {
	Name         string
	Project      string
	Namespace    string
	Health       v1alpha1.HealthStatus
	SyncStatus   v1alpha1.SyncStatus
	LiveRevision string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳