Documentation ¶
Index ¶
- Constants
- func CollectOperations(ctx context.Context, ytc yt.Client, period time.Duration, opNamespace string, ...) <-chan []yt.OperationStatus
- func TrackChildren(ctx context.Context, root ypath.Path, period time.Duration, ytc yt.Client, ...) <-chan []ypath.Path
- type Agent
- type Config
- type HealthState
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func CollectOperations ¶ added in v0.0.3
func TrackChildren ¶
func TrackChildren(ctx context.Context, root ypath.Path, period time.Duration, ytc yt.Client, l log.Logger) <-chan []ypath.Path
TrackChildren is a primitive for subscription on changes of Cypress nodes in the given subtree. It emits relative paths w.r.t. root of changed nodes.
At the beginning it notifies caller about all nodes in the subtree. After that, it performs lightweight "get with attributes" requests with given periodicity and tracks node revision change events including node disappearance events. Note that each pass which did not result in any event still produces an empty slice which allows building reliable logic assuming the absence of future modifications (see waitForPaths helper from tests for an example)
Current implementation does not descend into opaque nodes.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(proxy string, ytc yt.Client, l log.Logger, controller strawberry.Controller, config *Config) *Agent
func (*Agent) GetAgentInfo ¶
func (a *Agent) GetAgentInfo() strawberry.AgentInfo
func (*Agent) GetHealthStatus ¶
func (a *Agent) GetHealthStatus() monitoring.HealthStatus
func (*Agent) OperationNamespace ¶
OperationNamespace generates a special value unique across controllers which allows to mark and effectively filter its operations.
type Config ¶
type Config struct { // Root points to root directory with operation states. Root ypath.Path `yson:"root"` // PassPeriod defines how often agent performs its passes. PassPeriod *yson.Duration `yson:"pass_period"` // CollectOperationsPeriod defines how often agent collects running operations. CollectOperationsPeriod *yson.Duration `yson:"collect_operations_period"` // RevisionCollectPeriod defines how often agent collects Cypress node revisions via batch ListNode. RevisionCollectPeriod *yson.Duration `yson:"revision_collect_period"` // Stage of the controller, e.g. production, prestable, etc. Stage string `yson:"stage"` // RobotUsername is the name of the robot from which all the operations are started. // It is used to check permission to the pool during setting "pool" option. RobotUsername string `yson:"robot_username"` // PassWorkerNumber is the number of workers used to process oplets. PassWorkerNumber *int `yson:"pass_worker_number"` // DefaultNetworkProject is the default network project used for oplets. DefaultNetworkProject *string `yson:"default_network_project"` // ClusterURLTemplate is a template executed via text/template library to get cluster URL. // Cluster URL is used for generating "fancy" links for debug purposes only. // If template parsing or execution fails, panic is called. // Available template parameters: Proxy. // E.g. "https://example.com/{{.Proxy}}" ClusterURLTemplate string `yson:"cluster_url_template"` }
Config contains strawberry-specific configuration.
func (*Config) CollectOperationsPeriodOrDefault ¶ added in v0.0.3
func (*Config) PassPeriodOrDefault ¶
func (*Config) PassWorkerNumberOrDefault ¶
func (*Config) RevisionCollectPeriodOrDefault ¶
type HealthState ¶
type HealthState struct {
// contains filtered or unexported fields
}
func NewHealthState ¶
func NewHealthState() *HealthState
func (*HealthState) Load ¶
func (s *HealthState) Load() monitoring.HealthStatus
func (*HealthState) Store ¶
func (s *HealthState) Store(err error)