Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertDeploymentHistoryToRollbackRows(history []DeploymentHistory) []model.RollbackRow
- func ConvertOperationState(argoApp ArgoApplication) *model.SyncStatusDetails
- func SetHTTPClient(client *http.Client)
- func SortEventsNewestFirst(events []model.ResourceEvent)
- type AccumulatingSSEReader
- type ApplicationDestination
- type ApplicationMetadata
- type ApplicationService
- func (s *ApplicationService) ConvertToApp(argoApp ArgoApplication) model.App
- func (s *ApplicationService) DeleteApplication(ctx context.Context, req DeleteRequest) error
- func (s *ApplicationService) DeleteResource(ctx context.Context, req DeleteResourceRequest) error
- func (s *ApplicationService) DisableAutoSync(ctx context.Context, name string, appNamespace *string) error
- func (s *ApplicationService) GetApplication(ctx context.Context, name string, appNamespace *string) (*ArgoApplication, error)
- func (s *ApplicationService) GetApplicationManifests(ctx context.Context, name string, revision string, appNamespace *string) ([]string, error)
- func (s *ApplicationService) GetManagedResourceDiffs(ctx context.Context, appName string, appNamespace string) ([]ManagedResourceDiff, error)
- func (s *ApplicationService) GetResourceTree(ctx context.Context, appName, appNamespace string) (*ResourceTree, error)
- func (s *ApplicationService) GetRevisionMetadata(ctx context.Context, name string, revision string, appNamespace *string) (*model.RevisionMetadata, error)
- func (s *ApplicationService) GetUserInfo(ctx context.Context) (string, error)
- func (s *ApplicationService) ListApplications(ctx context.Context) ([]model.App, error)
- func (s *ApplicationService) ListApplicationsWithMeta(ctx context.Context) (*ListApplicationsResult, error)
- func (s *ApplicationService) ListEvents(ctx context.Context, params ListEventsParams) ([]model.ResourceEvent, error)
- func (s *ApplicationService) ListResourceActions(ctx context.Context, params ListResourceActionsParams) ([]string, error)
- func (s *ApplicationService) RefreshApplication(ctx context.Context, name string, opts *RefreshOptions) error
- func (s *ApplicationService) RollbackApplication(ctx context.Context, request model.RollbackRequest) error
- func (s *ApplicationService) RunResourceAction(ctx context.Context, req ResourceActionRequest) error
- func (s *ApplicationService) SyncApplication(ctx context.Context, appName string, opts *SyncOptions) error
- func (s *ApplicationService) TerminateOperation(ctx context.Context, name string, appNamespace *string) error
- func (s *ApplicationService) WatchApplications(ctx context.Context, eventChan chan<- ApplicationWatchEvent) error
- func (s *ApplicationService) WatchApplicationsWithOptions(ctx context.Context, eventChan chan<- ApplicationWatchEvent, ...) error
- func (s *ApplicationService) WatchResourceTree(ctx context.Context, appName, appNamespace string, out chan<- ResourceTree) error
- type ApplicationSource
- type ApplicationSpec
- type ApplicationStatus
- type ApplicationWatchEvent
- type ArgoApplication
- type AutomatedSyncPolicy
- type Client
- func (c *Client) Delete(ctx context.Context, path string) ([]byte, error)
- func (c *Client) Get(ctx context.Context, path string) ([]byte, error)
- func (c *Client) Patch(ctx context.Context, path string, body interface{}) ([]byte, error)
- func (c *Client) Post(ctx context.Context, path string, body interface{}) ([]byte, error)
- func (c *Client) Put(ctx context.Context, path string, body interface{}) ([]byte, error)
- func (c *Client) Stream(ctx context.Context, path string) (*StreamResponse, error)
- type DeleteRequest
- type DeleteResourceRequest
- type DeploymentHistory
- type HealthStatus
- type IngressInfo
- type ListApplicationsResult
- type ListEventsParams
- type ListResourceActionsParams
- type ManagedResourceDiff
- type ManagedResourcesResponse
- type NetworkingInfo
- type Operation
- type OperationInitiator
- type OperationState
- type OwnerReference
- type RefreshOptions
- type ResourceActionRequest
- type ResourceHealth
- type ResourceInfo
- type ResourceNode
- type ResourceRef
- type ResourceResult
- type ResourceStatus
- type ResourceTree
- type ResourceTreeStreamResult
- type RevisionMetadataResponse
- type SSEConfig
- type SSEMetrics
- type StreamResponse
- type SyncOperation
- type SyncOperationResult
- type SyncOptions
- type SyncPolicy
- type SyncResourceTarget
- type SyncStatus
- type WatchEventResult
- type WatchOptions
Constants ¶
const ( KB = 1024 MB = 1024 * KB // Buffer size defaults DefaultInitialBufferV2 = 256 * KB // Start with 256KB DefaultMaxBufferV2 = 16 * MB // Maximum single buffer size DefaultMaxAccumulated = 32 * MB // Maximum accumulated event size // Growth increments for adaptive strategy SmallGrowthIncrement = 256 * KB // For buffers < 1MB MediumGrowthIncrement = 512 * KB // For buffers 1-4MB LargeGrowthIncrement = 1 * MB // For buffers 4-8MB XLargeGrowthIncrement = 2 * MB // For buffers > 8MB )
Size constants
Variables ¶
var ( ErrEventTooLarge = errors.New("SSE event exceeds maximum size") ErrBufferOverflow = errors.New("buffer overflow, growing") ErrStreamClosed = errors.New("SSE stream closed") )
Common SSE error types
var AppListFields = []string{
"metadata.resourceVersion",
"items.metadata.name",
"items.metadata.namespace",
"items.metadata.ownerReferences",
"items.spec",
"items.status.sync.status",
"items.status.health",
"items.status.operationState.phase",
"items.status.operationState.finishedAt",
"items.status.operationState.startedAt",
}
AppListFields contains the fields needed for the app list view. Uses items.spec (whole spec) because ArgoCD's field selection does not reliably support sub-field paths like items.spec.destination. This matches the approach used by ArgoCD's own web UI.
var AppWatchFields []string
AppWatchFields is intentionally empty — the stream endpoint does not support field selection. Only resourceVersion is passed to avoid the initial full dump.
Functions ¶
func ConvertDeploymentHistoryToRollbackRows ¶
func ConvertDeploymentHistoryToRollbackRows(history []DeploymentHistory) []model.RollbackRow
ConvertDeploymentHistoryToRollbackRows converts ArgoCD deployment history to rollback rows
func ConvertOperationState ¶
func ConvertOperationState(argoApp ArgoApplication) *model.SyncStatusDetails
ConvertOperationState converts an application's last-operation state into the sync-status pane's model. Returns nil if the app has never synced.
func SetHTTPClient ¶
SetHTTPClient sets a custom HTTP client to be used by all new Client instances
func SortEventsNewestFirst ¶
func SortEventsNewestFirst(events []model.ResourceEvent)
SortEventsNewestFirst sorts events in place, most recently seen first. Stable so that equally-timestamped events keep their server order.
Types ¶
type AccumulatingSSEReader ¶
type AccumulatingSSEReader struct {
// contains filtered or unexported fields
}
AccumulatingSSEReader reads SSE events without data loss on buffer overflow
func NewAccumulatingSSEReader ¶
func NewAccumulatingSSEReader(stream io.ReadCloser, config *SSEConfig) *AccumulatingSSEReader
NewAccumulatingSSEReader creates a new SSE reader that handles large events gracefully
func (*AccumulatingSSEReader) Close ¶
func (r *AccumulatingSSEReader) Close() error
Close closes the underlying stream and returns buffer to pool
func (*AccumulatingSSEReader) Metrics ¶
func (r *AccumulatingSSEReader) Metrics() SSEMetrics
Metrics returns the current SSE processing metrics
func (*AccumulatingSSEReader) ReadEvent ¶
func (r *AccumulatingSSEReader) ReadEvent() ([]byte, error)
ReadEvent reads the next SSE event, handling large events gracefully
func (*AccumulatingSSEReader) ReadLine ¶
func (r *AccumulatingSSEReader) ReadLine() (string, error)
ReadLine reads and concatenates all data lines from an SSE event
type ApplicationDestination ¶
type ApplicationDestination struct {
Name string `json:"name,omitempty"`
Server string `json:"server,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
ApplicationDestination identifies the target cluster and namespace
type ApplicationMetadata ¶
type ApplicationMetadata struct {
Name string `json:"name"`
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
Namespace string `json:"namespace,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
}
ApplicationMetadata holds the application CR's object metadata
type ApplicationService ¶
type ApplicationService struct {
// contains filtered or unexported fields
}
ApplicationService provides ArgoCD application operations
func NewApplicationService ¶
func NewApplicationService(server *model.Server) *ApplicationService
NewApplicationService creates a new application service
func (*ApplicationService) ConvertToApp ¶
func (s *ApplicationService) ConvertToApp(argoApp ArgoApplication) model.App
ConvertToApp converts an ArgoApplication to our model.App
func (*ApplicationService) DeleteApplication ¶
func (s *ApplicationService) DeleteApplication(ctx context.Context, req DeleteRequest) error
DeleteApplication deletes an application from ArgoCD
func (*ApplicationService) DeleteResource ¶
func (s *ApplicationService) DeleteResource(ctx context.Context, req DeleteResourceRequest) error
DeleteResource deletes a resource from the cluster via ArgoCD
func (*ApplicationService) DisableAutoSync ¶
func (s *ApplicationService) DisableAutoSync(ctx context.Context, name string, appNamespace *string) error
DisableAutoSync removes the automated sync policy so a rollback is not immediately synced back to the current target revision. Uses a merge patch rather than a spec update: our ApplicationSpec model is partial, and round-tripping it through PUT /spec would wipe fields we don't model.
func (*ApplicationService) GetApplication ¶
func (s *ApplicationService) GetApplication(ctx context.Context, name string, appNamespace *string) (*ArgoApplication, error)
GetApplication fetches a single application with full details including history
func (*ApplicationService) GetApplicationManifests ¶
func (s *ApplicationService) GetApplicationManifests(ctx context.Context, name string, revision string, appNamespace *string) ([]string, error)
GetApplicationManifests fetches the rendered manifests for an application at a revision
func (*ApplicationService) GetManagedResourceDiffs ¶
func (s *ApplicationService) GetManagedResourceDiffs(ctx context.Context, appName string, appNamespace string) ([]ManagedResourceDiff, error)
GetManagedResourceDiffs fetches managed resource diffs for an application
func (*ApplicationService) GetResourceTree ¶
func (s *ApplicationService) GetResourceTree(ctx context.Context, appName, appNamespace string) (*ResourceTree, error)
GetResourceTree retrieves the resource tree for an application
func (*ApplicationService) GetRevisionMetadata ¶
func (s *ApplicationService) GetRevisionMetadata(ctx context.Context, name string, revision string, appNamespace *string) (*model.RevisionMetadata, error)
GetRevisionMetadata fetches git metadata for a specific revision
func (*ApplicationService) GetUserInfo ¶
func (s *ApplicationService) GetUserInfo(ctx context.Context) (string, error)
GetUserInfo validates user authentication by checking session info and returns the session's username (empty if the server omits it).
func (*ApplicationService) ListApplications ¶
ListApplications retrieves all applications from ArgoCD
func (*ApplicationService) ListApplicationsWithMeta ¶
func (s *ApplicationService) ListApplicationsWithMeta(ctx context.Context) (*ListApplicationsResult, error)
ListApplicationsWithMeta retrieves all applications with metadata (resourceVersion) for coordinating with watch streams
func (*ApplicationService) ListEvents ¶
func (s *ApplicationService) ListEvents(ctx context.Context, params ListEventsParams) ([]model.ResourceEvent, error)
ListEvents fetches Kubernetes events for an application or one of its resources, normalized and sorted newest-first.
func (*ApplicationService) ListResourceActions ¶
func (s *ApplicationService) ListResourceActions(ctx context.Context, params ListResourceActionsParams) ([]string, error)
ListResourceActions retrieves available actions for a specific resource
func (*ApplicationService) RefreshApplication ¶
func (s *ApplicationService) RefreshApplication(ctx context.Context, name string, opts *RefreshOptions) error
RefreshApplication triggers a refresh for the specified application. Normal refresh compares with git; hard refresh invalidates the manifest cache.
func (*ApplicationService) RollbackApplication ¶
func (s *ApplicationService) RollbackApplication(ctx context.Context, request model.RollbackRequest) error
RollbackApplication performs a rollback operation
func (*ApplicationService) RunResourceAction ¶
func (s *ApplicationService) RunResourceAction(ctx context.Context, req ResourceActionRequest) error
RunResourceAction executes a resource action via ArgoCD's resource actions API v2 This is used for actions like promote, abort, pause, etc. on Argo Rollouts
func (*ApplicationService) SyncApplication ¶
func (s *ApplicationService) SyncApplication(ctx context.Context, appName string, opts *SyncOptions) error
SyncApplication triggers a sync for the specified application
func (*ApplicationService) TerminateOperation ¶
func (s *ApplicationService) TerminateOperation(ctx context.Context, name string, appNamespace *string) error
TerminateOperation cancels the application's in-flight operation.
func (*ApplicationService) WatchApplications ¶
func (s *ApplicationService) WatchApplications(ctx context.Context, eventChan chan<- ApplicationWatchEvent) error
WatchApplications starts watching for application changes
func (*ApplicationService) WatchApplicationsWithOptions ¶
func (s *ApplicationService) WatchApplicationsWithOptions(ctx context.Context, eventChan chan<- ApplicationWatchEvent, opts *WatchOptions) error
WatchApplicationsWithOptions starts watching with configurable options
func (*ApplicationService) WatchResourceTree ¶
func (s *ApplicationService) WatchResourceTree(ctx context.Context, appName, appNamespace string, out chan<- ResourceTree) error
WatchResourceTree starts a streaming watch for an application's resource tree
type ApplicationSource ¶
type ApplicationSource struct {
RepoURL string `json:"repoURL,omitempty"`
Path string `json:"path,omitempty"`
TargetRevision string `json:"targetRevision,omitempty"`
}
ApplicationSource identifies where an application's manifests come from
type ApplicationSpec ¶
type ApplicationSpec struct {
Project string `json:"project,omitempty"`
// Single source (legacy/traditional)
Source *ApplicationSource `json:"source,omitempty"`
// Multiple sources (newer multi-source support)
Sources []ApplicationSource `json:"sources,omitempty"`
Destination ApplicationDestination `json:"destination"`
SyncPolicy *SyncPolicy `json:"syncPolicy,omitempty"`
}
ApplicationSpec holds the application's desired configuration
func (*ApplicationSpec) AutoSyncEnabled ¶
func (s *ApplicationSpec) AutoSyncEnabled() bool
AutoSyncEnabled reports whether the automated sync policy is active
type ApplicationStatus ¶
type ApplicationStatus struct {
Sync SyncStatus `json:"sync"`
Health HealthStatus `json:"health"`
OperationState OperationState `json:"operationState,omitempty"`
History []DeploymentHistory `json:"history,omitempty"`
Resources []ResourceStatus `json:"resources,omitempty"`
}
ApplicationStatus holds the application's observed state
type ApplicationWatchEvent ¶
type ApplicationWatchEvent struct {
Type string `json:"type"`
Application ArgoApplication `json:"application"`
}
ApplicationWatchEvent represents an event from the watch stream
type ArgoApplication ¶
type ArgoApplication struct {
Metadata ApplicationMetadata `json:"metadata"`
Spec ApplicationSpec `json:"spec"`
Status ApplicationStatus `json:"status"`
}
ArgoApplication represents an ArgoCD application from the API
func (*ArgoApplication) GetPrimarySource ¶
func (app *ArgoApplication) GetPrimarySource() *ApplicationSource
GetPrimarySource returns either the single source or the first source from multiple sources
func (*ArgoApplication) HasMultipleSources ¶
func (app *ArgoApplication) HasMultipleSources() bool
HasMultipleSources returns true if the application uses multiple sources
type AutomatedSyncPolicy ¶
type AutomatedSyncPolicy struct {
Enabled *bool `json:"enabled,omitempty"`
}
AutomatedSyncPolicy mirrors spec.syncPolicy.automated; Enabled defaults to true when the automated block is present (pre-3.1 servers have no field)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an HTTP client for ArgoCD API
func (*Client) Delete ¶
Delete performs a DELETE request without retries; see Post. See Get for timeout responsibility.
func (*Client) Get ¶
Get performs a GET request with retry logic. Callers are responsible for setting a timeout on ctx (e.g. via appcontext.WithAPITimeout or WithMinAPITimeout). Do not add a timeout here — it would undercut WithMinAPITimeout callers that need a longer deadline for slow operations like diffs and rollbacks.
func (*Client) Patch ¶
Patch performs a PATCH request without retries; see Post. See Get for timeout responsibility.
func (*Client) Post ¶
Post performs a POST request without retries: a network error can occur after the server has already executed the request, so re-sending could run a sync/rollback/delete twice. See Get for timeout responsibility.
type DeleteRequest ¶
type DeleteRequest struct {
AppName string
AppNamespace *string
Cascade bool
PropagationPolicy string
}
DeleteRequest represents a request to delete an application
type DeleteResourceRequest ¶
type DeleteResourceRequest struct {
AppName string
AppNamespace *string
ResourceName string
Kind string
Namespace string
Version string
Group string
Orphan bool
Force bool
}
DeleteResourceRequest represents a request to delete a resource from an application
type DeploymentHistory ¶
type DeploymentHistory struct {
ID int `json:"id"`
Revision string `json:"revision"`
DeployedAt time.Time `json:"deployedAt"`
DeployStartedAt *time.Time `json:"deployStartedAt,omitempty"`
InitiatedBy OperationInitiator `json:"initiatedBy,omitempty"`
Source *ApplicationSource `json:"source,omitempty"`
}
DeploymentHistory represents a deployment history entry from ArgoCD API
type HealthStatus ¶
type HealthStatus struct {
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}
HealthStatus holds the application's health assessment
type IngressInfo ¶
IngressInfo represents ingress information from ArgoCD API
type ListApplicationsResult ¶
ListApplicationsResult wraps the list result with metadata for watch coordination
type ListEventsParams ¶
type ListEventsParams struct {
AppName string
AppNamespace string // "" = unset
ResourceUID string
ResourceName string
ResourceNamespace string
}
ListEventsParams identifies whose events to fetch: the application itself, or one of its resources when all three Resource fields are set.
type ListResourceActionsParams ¶
type ListResourceActionsParams struct {
AppName string
AppNamespace *string
ResourceName string
Namespace string
Kind string
Group string
Version string
}
ListResourceActionsParams contains parameters for listing resource actions
type ManagedResourceDiff ¶
type ManagedResourceDiff struct {
Group string `json:"group,omitempty"`
Kind string `json:"kind,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
TargetState string `json:"targetState,omitempty"`
LiveState string `json:"liveState,omitempty"`
Diff string `json:"diff,omitempty"`
Hook bool `json:"hook,omitempty"`
NormalizedLiveState string `json:"normalizedLiveState,omitempty"`
PredictedLiveState string `json:"predictedLiveState,omitempty"`
}
ManagedResourceDiff represents ArgoCD managed resource diff item
type ManagedResourcesResponse ¶
type ManagedResourcesResponse struct {
Items []ManagedResourceDiff `json:"items"`
}
ManagedResourcesResponse represents response for managed resources
type NetworkingInfo ¶
type NetworkingInfo struct {
TargetLabels map[string]string `json:"targetLabels,omitempty"`
TargetRefs []ResourceRef `json:"targetRefs,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Ingress []IngressInfo `json:"ingress,omitempty"`
}
NetworkingInfo represents networking information from ArgoCD API
type Operation ¶
type Operation struct {
Sync *SyncOperation `json:"sync,omitempty"`
InitiatedBy OperationInitiator `json:"initiatedBy,omitempty"`
}
Operation describes the requested operation
type OperationInitiator ¶
type OperationInitiator struct {
Username string `json:"username,omitempty"`
Automated bool `json:"automated,omitempty"`
}
OperationInitiator identifies who or what started an operation
type OperationState ¶
type OperationState struct {
Phase string `json:"phase,omitempty"`
Message string `json:"message,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Operation Operation `json:"operation,omitempty"`
SyncResult *SyncOperationResult `json:"syncResult,omitempty"`
}
OperationState holds the state of the application's last operation
type OwnerReference ¶
type OwnerReference struct {
APIVersion string `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
UID string `json:"uid,omitempty"`
}
OwnerReference represents a Kubernetes owner reference
type RefreshOptions ¶
type RefreshOptions struct {
Hard bool // If true, performs hard refresh (invalidates cache)
AppNamespace *string // Optional app namespace for multi-tenant clusters
}
RefreshOptions specifies options for refreshing an application
type ResourceActionRequest ¶
type ResourceActionRequest struct {
AppName string // Name of the ArgoCD application
AppNamespace *string // Optional namespace of the ArgoCD application (for multi-tenant)
ResourceName string // Name of the resource to act on
Namespace string // Namespace of the resource
Kind string // Kind of the resource
Group string // API group of the resource
Version string // API version of the resource
Action string // Action to perform
}
ResourceActionRequest represents a request to run a resource action via ArgoCD This type is required by the existing RunResourceAction method in applications.go
type ResourceHealth ¶
type ResourceHealth struct {
Status *string `json:"status,omitempty"`
Message *string `json:"message,omitempty"`
}
ResourceHealth represents the health status from ArgoCD API
type ResourceInfo ¶
ResourceInfo represents additional information about a resource from ArgoCD API
type ResourceNode ¶
type ResourceNode struct {
Kind string `json:"kind"`
Name string `json:"name"`
Namespace *string `json:"namespace,omitempty"`
Version string `json:"version"`
Group string `json:"group"`
UID string `json:"uid"`
Health *ResourceHealth `json:"health,omitempty"`
Status string `json:"status"`
NetworkingInfo *NetworkingInfo `json:"networkingInfo,omitempty"`
ResourceRef ResourceRef `json:"resourceRef"`
ParentRefs []ResourceRef `json:"parentRefs,omitempty"`
Info []ResourceInfo `json:"info,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
}
ResourceNode represents a Kubernetes resource from ArgoCD API
type ResourceRef ¶
type ResourceRef struct {
Kind string `json:"kind"`
Name string `json:"name"`
Namespace *string `json:"namespace,omitempty"`
Group string `json:"group"`
Version string `json:"version"`
UID string `json:"uid"`
}
ResourceRef represents a reference to a Kubernetes resource from ArgoCD API
type ResourceResult ¶
type ResourceResult struct {
Group string `json:"group,omitempty"`
Kind string `json:"kind,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
HookType string `json:"hookType,omitempty"`
HookPhase string `json:"hookPhase,omitempty"`
}
ResourceResult holds the outcome of syncing a single resource
type ResourceStatus ¶
type ResourceStatus struct {
Group string `json:"group"`
Kind string `json:"kind"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Status string `json:"status"` // Sync status: "Synced", "OutOfSync"
Version string `json:"version"`
Health *ResourceHealth `json:"health,omitempty"`
RequiresPruning bool `json:"requiresPruning,omitempty"`
// RequiresDeletionConfirmation is set by Argo CD when the resource carries
// Prune=confirm or Delete=confirm.
RequiresDeletionConfirmation bool `json:"requiresDeletionConfirmation,omitempty"`
}
ResourceStatus holds sync/health status for a managed resource (from Application.status.resources[])
type ResourceTree ¶
type ResourceTree struct {
Nodes []ResourceNode `json:"nodes"`
}
ResourceTree represents the resource tree response from ArgoCD API
type ResourceTreeStreamResult ¶
type ResourceTreeStreamResult struct {
Result ResourceTree `json:"result"`
}
ResourceTreeStreamResult wraps streaming responses for resource tree
type RevisionMetadataResponse ¶
type RevisionMetadataResponse struct {
Author string `json:"author"`
Date time.Time `json:"date"`
Message string `json:"message"`
Tags []string `json:"tags,omitempty"`
}
RevisionMetadataResponse represents git metadata response from ArgoCD API
type SSEConfig ¶
type SSEConfig struct {
InitialBuffer int // Start size (default 256KB)
MaxBuffer int // Max single buffer (default 16MB)
MaxAccumulated int // Max accumulated event (default 32MB)
GrowthStrategy string // "adaptive" (default) or "fixed"
// Adaptive growth sizes
SmallGrowth int // 256KB for < 1MB
MediumGrowth int // 512KB for 1-4MB
LargeGrowth int // 1MB for 4-8MB
XLargeGrowth int // 2MB for > 8MB
}
SSEConfig holds configuration for SSE processing
func DefaultSSEConfig ¶
func DefaultSSEConfig() *SSEConfig
DefaultSSEConfig returns the default SSE configuration
type SSEMetrics ¶
type SSEMetrics struct {
BufferResizes int
MaxEventSize int
CurrentBuffer int
AccumulatedBytes int
EventsProcessed int
}
SSEMetrics tracks SSE processing metrics
type StreamResponse ¶
type StreamResponse struct {
Body io.ReadCloser
Headers map[string][]string
}
StreamResponse contains the SSE stream and response headers
type SyncOperation ¶
type SyncOperation struct {
Revision string `json:"revision,omitempty"`
// DryRun and Resources qualify what the operation actually did: a dry run
// applies nothing, and a non-empty Resources means only a subset was synced.
DryRun bool `json:"dryRun,omitempty"`
Prune bool `json:"prune,omitempty"`
Resources []SyncResourceTarget `json:"resources,omitempty"`
}
SyncOperation holds the sync request parameters
type SyncOperationResult ¶
type SyncOperationResult struct {
Revision string `json:"revision,omitempty"`
Resources []ResourceResult `json:"resources,omitempty"`
}
SyncOperationResult holds the outcome of a sync operation
type SyncOptions ¶
type SyncOptions struct {
Prune bool `json:"prune,omitempty"`
DryRun bool `json:"dryRun,omitempty"`
Force bool `json:"force,omitempty"`
AppNamespace string `json:"appNamespace,omitempty"`
Resources []SyncResourceTarget `json:"resources,omitempty"`
}
type SyncPolicy ¶
type SyncPolicy struct {
Automated *AutomatedSyncPolicy `json:"automated,omitempty"`
}
SyncPolicy holds the parts of the sync policy argonaut inspects
type SyncResourceTarget ¶
type SyncResourceTarget struct {
Group string `json:"group"`
Kind string `json:"kind"`
Name string `json:"name"`
Namespace string `json:"namespace"`
}
SyncOptions represents options for syncing an application SyncResourceTarget represents a specific resource to sync
type SyncStatus ¶
type SyncStatus struct {
Status string `json:"status,omitempty"`
ComparedTo struct {
Source *ApplicationSource `json:"source,omitempty"`
Sources []ApplicationSource `json:"sources,omitempty"`
} `json:"comparedTo"`
Revision string `json:"revision,omitempty"`
Revisions []string `json:"revisions,omitempty"`
}
SyncStatus holds the application's sync comparison state
type WatchEventResult ¶
type WatchEventResult struct {
Result ApplicationWatchEvent `json:"result"`
}
WatchEventResult wraps the watch event in the expected format
type WatchOptions ¶
type WatchOptions struct {
ResourceVersion string // Start watching from this version (avoids initial full dump)
Fields []string // Field selection for watch events
Projects []string // Filter by project names
}
WatchOptions configures the watch stream