watch

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an SSE watch client for Kargo resources.

func NewClient

func NewClient(baseURL string, httpClient *http.Client, token string) *Client

NewClient creates a new watch client.

func (*Client) StreamAnalysisRunLogs

func (c *Client) StreamAnalysisRunLogs(
	ctx context.Context,
	project string,
	analysisRun string,
	metricName string,
	containerName string,
) (<-chan string, <-chan error)

StreamAnalysisRunLogs streams logs from an analysis run.

func (*Client) WatchClusterConfig

func (c *Client) WatchClusterConfig(
	ctx context.Context,
) (<-chan Event[*kargoapi.ClusterConfig], <-chan error)

WatchClusterConfig watches the ClusterConfig. Cancel the provided context to stop watching.

func (*Client) WatchProjectConfig

func (c *Client) WatchProjectConfig(
	ctx context.Context,
	project string,
) (<-chan Event[*kargoapi.ProjectConfig], <-chan error)

WatchProjectConfig watches the ProjectConfig for a specific project. Cancel the provided context to stop watching.

func (*Client) WatchPromotion

func (c *Client) WatchPromotion(
	ctx context.Context,
	project string,
	promotion string,
) (<-chan Event[*kargoapi.Promotion], <-chan error)

WatchPromotion watches a specific Promotion for changes. Cancel the provided context to stop watching.

func (*Client) WatchPromotions

func (c *Client) WatchPromotions(
	ctx context.Context,
	project string,
) (<-chan Event[*kargoapi.Promotion], <-chan error)

WatchPromotions watches all Promotions in a project for changes. Cancel the provided context to stop watching.

func (*Client) WatchStage

func (c *Client) WatchStage(
	ctx context.Context,
	project string,
	stage string,
) (<-chan Event[*kargoapi.Stage], <-chan error)

WatchStage watches a specific Stage for changes. Cancel the provided context to stop watching.

func (*Client) WatchStages

func (c *Client) WatchStages(
	ctx context.Context,
	project string,
) (<-chan Event[*kargoapi.Stage], <-chan error)

WatchStages watches all Stages in a project for changes. Cancel the provided context to stop watching.

func (*Client) WatchWarehouse

func (c *Client) WatchWarehouse(
	ctx context.Context,
	project string,
	warehouse string,
) (<-chan Event[*kargoapi.Warehouse], <-chan error)

WatchWarehouse watches a specific Warehouse for changes. Cancel the provided context to stop watching.

func (*Client) WatchWarehouses

func (c *Client) WatchWarehouses(
	ctx context.Context,
	project string,
) (<-chan Event[*kargoapi.Warehouse], <-chan error)

WatchWarehouses watches all Warehouses in a project for changes. Cancel the provided context to stop watching.

type Event

type Event[T any] struct {
	Type   EventType
	Object T
}

Event represents a watch event for a specific resource type.

type EventType

type EventType string

EventType represents the type of watch event.

const (
	Added    EventType = "ADDED"
	Modified EventType = "MODIFIED"
	Deleted  EventType = "DELETED"
)

type LogEntry

type LogEntry struct {
	Chunk string `json:"chunk"`
}

LogEntry represents a single log line from an analysis run.

Jump to

Keyboard shortcuts

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