experimentation

package
v0.0.0-...-1fd3d55 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package experimentation provides functionality for experimentation in azd. The AssignmentsManager can be used to retrieve the current assignment for the current machine.

Index

Constants

View Source
const AzdVersionParameterName string = "azdversion"

MachineIdParameterName is the name of the parameter used to identify the version of azd in the assignment request.

View Source
const MachineIdParameterName string = "machineid"

MachineIdParameterName is the name of the parameter used to identify the machine ID in the assignment request.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	Features          []string
	Flights           map[string]string
	Configs           []AssignmentConfig
	ParameterGroups   []string
	AssignmentContext string
}

Assignment is a subset of the information returned by the TAS service.

type AssignmentConfig

type AssignmentConfig struct {
	ID         string
	Parameters map[string]interface{}
}

AssignmentConfig is information about a specific config in an assignment.

type AssignmentsManager

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

AssignmentsManager manages interaction with the Assignments service, caching the results for 24 hours.

func NewAssignmentsManager

func NewAssignmentsManager(endpoint string, transport policy.Transporter) (*AssignmentsManager, error)

NewAssignmentsManager creates a new AssignmentManager, which will communicate with the TAS service. The AssignmentManager caches the assignment information for 24 hours in files in the user's config directory under the "experimentation" subdirectory.

func (*AssignmentsManager) Assignment

func (am *AssignmentsManager) Assignment(ctx context.Context) (*Assignment, error)

Assignment gets a the assignment information for this given machine.

When making a request, the current machine ID is passed as a parameter, named "machineid".

Jump to

Keyboard shortcuts

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