internal

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() string

Now returns a timestamp string.

Types

type AppMetadata

type AppMetadata struct {
	Name              string            `json:"name"`
	Namespace         string            `json:"namespace,omitempty"`
	UID               string            `json:"uid,omitempty"`
	ResourceVersion   string            `json:"resourceVersion,omitempty"`
	CreationTimestamp string            `json:"creationTimestamp,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
	Annotations       map[string]string `json:"annotations,omitempty"`
}

type AppProject

type AppProject struct {
	Metadata AppMetadata    `json:"metadata"`
	Spec     AppProjectSpec `json:"spec"`
}

AppProject represents an ArgoCD project for multi-tenancy.

type AppProjectList

type AppProjectList struct {
	Items    []AppProject `json:"items"`
	Metadata ListMetadata `json:"metadata"`
}

AppProjectList is a list of projects.

type AppProjectSpec

type AppProjectSpec struct {
	Description              string                   `json:"description,omitempty"`
	SourceRepos              []string                 `json:"sourceRepos,omitempty"`
	SourceNamespaces         []string                 `json:"sourceNamespaces,omitempty"`
	Destinations             []ApplicationDestination `json:"destinations,omitempty"`
	ClusterResourceWhitelist []GroupKind              `json:"clusterResourceWhitelist,omitempty"`
}

type Application

type Application struct {
	Metadata AppMetadata       `json:"metadata"`
	Spec     ApplicationSpec   `json:"spec"`
	Status   ApplicationStatus `json:"status,omitempty"`
}

Application represents an ArgoCD application.

type ApplicationDestination

type ApplicationDestination struct {
	Server    string `json:"server,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name,omitempty"`
}

type ApplicationList

type ApplicationList struct {
	Items    []Application `json:"items"`
	Metadata ListMetadata  `json:"metadata"`
}

ApplicationList is a list of applications.

type ApplicationSource

type ApplicationSource struct {
	RepoURL        string `json:"repoURL"`
	Path           string `json:"path,omitempty"`
	TargetRevision string `json:"targetRevision,omitempty"`
	Chart          string `json:"chart,omitempty"`
}

type ApplicationSpec

type ApplicationSpec struct {
	Source      ApplicationSource      `json:"source"`
	Destination ApplicationDestination `json:"destination"`
	Project     string                 `json:"project,omitempty"`
	SyncPolicy  *SyncPolicy            `json:"syncPolicy,omitempty"`
}

type ApplicationStatus

type ApplicationStatus struct {
	Sync           SyncStatus         `json:"sync"`
	Health         HealthStatus       `json:"health"`
	Summary        ApplicationSummary `json:"summary,omitempty"`
	Resources      []ResourceStatus   `json:"resources,omitempty"`
	OperationState *OperationState    `json:"operationState,omitempty"`
	ReconciledAt   string             `json:"reconciledAt,omitempty"`
}

ApplicationStatus holds the observed state of the application.

type ApplicationSummary

type ApplicationSummary struct {
	Images []string `json:"images,omitempty"`
}

type Cluster

type Cluster struct {
	Server          string          `json:"server"`
	Name            string          `json:"name"`
	Config          ClusterConfig   `json:"config,omitempty"`
	ConnectionState ConnectionState `json:"connectionState,omitempty"`
}

Cluster represents a registered cluster.

type ClusterConfig

type ClusterConfig struct {
	TLSClientConfig TLSClientConfig `json:"tlsClientConfig,omitempty"`
}

type ClusterList

type ClusterList struct {
	Items    []Cluster    `json:"items"`
	Metadata ListMetadata `json:"metadata"`
}

ClusterList is a list of clusters.

type ConnectionState

type ConnectionState struct {
	Status  string `json:"status"` // Successful, Failed
	Message string `json:"message,omitempty"`
}

type GroupKind

type GroupKind struct {
	Group string `json:"group"`
	Kind  string `json:"kind"`
}

type HealthStatus

type HealthStatus struct {
	Status  string `json:"status"` // Healthy, Degraded, Progressing, Missing, Unknown
	Message string `json:"message,omitempty"`
}

type ListMetadata

type ListMetadata struct {
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

type Operation

type Operation struct {
	Sync *SyncOperation `json:"sync,omitempty"`
}

type OperationState

type OperationState struct {
	Operation  Operation `json:"operation"`
	Phase      string    `json:"phase"` // Running, Succeeded, Failed, Error
	Message    string    `json:"message,omitempty"`
	StartedAt  string    `json:"startedAt"`
	FinishedAt string    `json:"finishedAt,omitempty"`
}

type Repository

type Repository struct {
	Repo            string          `json:"repo"`
	Type            string          `json:"type,omitempty"`
	Name            string          `json:"name,omitempty"`
	ConnectionState ConnectionState `json:"connectionState,omitempty"`
}

Repository represents a registered git repository.

type RepositoryList

type RepositoryList struct {
	Items    []Repository `json:"items"`
	Metadata ListMetadata `json:"metadata"`
}

RepositoryList is a list of repositories.

type ResourceStatus

type ResourceStatus struct {
	Group     string        `json:"group,omitempty"`
	Version   string        `json:"version"`
	Kind      string        `json:"kind"`
	Namespace string        `json:"namespace,omitempty"`
	Name      string        `json:"name"`
	Status    string        `json:"status"` // Synced, OutOfSync
	Health    *HealthStatus `json:"health,omitempty"`
}

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router handles ArgoCD API requests.

func NewRouter

func NewRouter(store *Store, syncFn func(app *Application)) *Router

NewRouter creates an ArgoCD API router.

func (*Router) Handle

func (rt *Router) Handle(method, path string, body []byte) (int, []byte)

Handle routes a request to the appropriate handler.

type Session

type Session struct {
	Token string `json:"token"`
}

Session holds login session info.

type Settings

type Settings struct {
	URL               string   `json:"url,omitempty"`
	DexConfig         string   `json:"dexConfig,omitempty"`
	AppLabelKey       string   `json:"appLabelKey,omitempty"`
	KustomizeVersions []string `json:"kustomizeVersions,omitempty"`
}

Settings holds ArgoCD server settings.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds all ArgoCD resources in memory.

func NewStore

func NewStore(gatewayAddr string) *Store

NewStore creates a store with default project and in-cluster.

func (*Store) CreateApp

func (s *Store) CreateApp(app *Application) error

func (*Store) CreateProject

func (s *Store) CreateProject(proj *AppProject) error

func (*Store) CreateRepo

func (s *Store) CreateRepo(repo *Repository) error

func (*Store) DeleteApp

func (s *Store) DeleteApp(name string) error

func (*Store) DeleteRepo

func (s *Store) DeleteRepo(url string) error

func (*Store) GetApp

func (s *Store) GetApp(name string) (*Application, bool)

func (*Store) GetProject

func (s *Store) GetProject(name string) (*AppProject, bool)

func (*Store) GetRepo

func (s *Store) GetRepo(url string) (*Repository, bool)

func (*Store) ListApps

func (s *Store) ListApps() []Application

func (*Store) ListClusters

func (s *Store) ListClusters() []Cluster

func (*Store) ListProjects

func (s *Store) ListProjects() []AppProject

func (*Store) ListRepos

func (s *Store) ListRepos() []Repository

func (*Store) UpdateApp

func (s *Store) UpdateApp(app *Application)

type SyncOperation

type SyncOperation struct {
	Revision string `json:"revision,omitempty"`
}

type SyncPolicy

type SyncPolicy struct {
	Automated *SyncPolicyAutomated `json:"automated,omitempty"`
}

type SyncPolicyAutomated

type SyncPolicyAutomated struct {
	Prune    bool `json:"prune,omitempty"`
	SelfHeal bool `json:"selfHeal,omitempty"`
}

type SyncStatus

type SyncStatus struct {
	Status   string `json:"status"` // Synced, OutOfSync, Unknown
	Revision string `json:"revision,omitempty"`
}

type TLSClientConfig

type TLSClientConfig struct {
	Insecure bool `json:"insecure,omitempty"`
}

Jump to

Keyboard shortcuts

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