dynamicparameters

package
v2.28.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProvisionersMatched = xerrors.New("no provisioners matched")

Functions

func GetModuleFiles

func GetModuleFiles() map[string][]byte

GetModuleFiles returns a map of module files to be used with ExtraFiles

func TemplateContent

func TemplateContent() (string, error)

func TemplateTarData added in v2.28.0

func TemplateTarData() ([]byte, error)

Types

type Config

type Config struct {
	TemplateVersion   uuid.UUID `json:"template_version"`
	Metrics           *Metrics  `json:"-"`
	MetricLabelValues []string  `json:"metric_label_values"`
}

type Metrics

type Metrics struct {
	LatencyInitialResponseSeconds prometheus.HistogramVec
	LatencyChangeResponseSeconds  prometheus.HistogramVec
}

func NewMetrics

func NewMetrics(reg prometheus.Registerer, labelNames ...string) *Metrics

type Partition added in v2.28.0

type Partition struct {
	TemplateVersion       codersdk.TemplateVersion
	ConcurrentEvaluations int
}

func SetupPartitions added in v2.28.0

func SetupPartitions(
	ctx context.Context, client SDKForDynamicParametersSetup,
	orgID uuid.UUID, templateName string, provisionerTags map[string]string,
	numEvals int64,
	logger slog.Logger,
) ([]Partition, error)

type ProvisionerJobUnexpectedStatusError added in v2.28.0

type ProvisionerJobUnexpectedStatusError struct {
	TemplateVersionID uuid.UUID
	Status            codersdk.ProvisionerJobStatus
	JobError          string
}

func (ProvisionerJobUnexpectedStatusError) Error added in v2.28.0

type Runner

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

func NewRunner

func NewRunner(client *codersdk.Client, cfg Config) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, _ string, logs io.Writer) (retErr error)

Run executes the dynamic parameters test, which:

1. connects to the dynamic parameters stream 2. waits for the initial response 3. sends a change request 4. waits for the change response 5. closes the stream

type SDKForDynamicParametersSetup added in v2.28.0

type SDKForDynamicParametersSetup interface {
	TemplateByName(ctx context.Context, orgID uuid.UUID, templateName string) (codersdk.Template, error)
	CreateTemplate(ctx context.Context, orgID uuid.UUID, createReq codersdk.CreateTemplateRequest) (codersdk.Template, error)
	CreateTemplateVersion(ctx context.Context, orgID uuid.UUID, createReq codersdk.CreateTemplateVersionRequest) (codersdk.TemplateVersion, error)
	Upload(ctx context.Context, contentType string, reader io.Reader) (codersdk.UploadResponse, error)
	TemplateVersion(ctx context.Context, versionID uuid.UUID) (codersdk.TemplateVersion, error)
}

Jump to

Keyboard shortcuts

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