...

Package context

Overview ▾

Constants

const (
    Caller                  = "caller"
    ComponentType           = "componentType"
    ClusterType             = "clusterType"
    PreviousTelemetryStatus = "wasTelemetryEnabled"
    TelemetryStatus         = "isTelemetryEnabled"
    DevfileName             = "devfileName"
    Language                = "language"
    ProjectType             = "projectType"
    NOTFOUND                = "not-found"
    InteractiveMode         = "interactive"
    ExperimentalMode        = "experimental"
    Flags                   = "flags"
    Platform                = "platform"
    PlatformVersion         = "platformVersion"
    PreferenceParameter     = "parameter"
    PreferenceValue         = "value"
)
const (
    VSCode   = "vscode"
    IntelliJ = "intellij"
    JBoss    = "jboss"
)

func GetContextProperties

func GetContextProperties(ctx context.Context) map[string]interface{}

GetContextProperties retrieves all the values set in a given context

func GetPreviousTelemetryStatus

func GetPreviousTelemetryStatus(ctx context.Context) bool

GetPreviousTelemetryStatus gets the telemetry status that was seen before a command is run

func GetTelemetryStatus

func GetTelemetryStatus(ctx context.Context) bool

GetTelemetryStatus gets the current telemetry status that is set after a command is run

func NewContext

func NewContext(ctx context.Context) context.Context

NewContext returns a context more specifically to be used for telemetry data collection

func SetCaller

func SetCaller(ctx context.Context, caller string) error

SetCaller sets the caller property for telemetry to record the tool used to call odo. Passing an empty caller is not considered invalid, but means that odo was invoked directly from the command line. In all other cases, the value is verified against a set of allowed values. Also note that unexpected values are added to the telemetry context, even if an error is returned.

func SetClusterType

func SetClusterType(ctx context.Context, client kclient.ClientInterface)

SetClusterType sets clusterType property for telemetry data when a component is pushed or a project is created/set

func SetComponentType

func SetComponentType(ctx context.Context, value string)

SetComponentType sets componentType property for telemetry data when a component is created/pushed

func SetDevfileName

func SetDevfileName(ctx context.Context, devfileName string)

func SetExperimentalMode

func SetExperimentalMode(ctx context.Context, value bool)

func SetFlags

func SetFlags(ctx context.Context, flags *pflag.FlagSet)

SetFlags sets flags property for telemetry to record what flags were used

func SetInteractive

func SetInteractive(ctx context.Context, interactive bool)

func SetLanguage

func SetLanguage(ctx context.Context, language string)

func SetPlatform

func SetPlatform(ctx context.Context, client platform.Client)

SetPlatform sets platform and platform_version properties for telemetry data

func SetPreferenceParameter

func SetPreferenceParameter(ctx context.Context, param string, value *string)

SetPreferenceParameter tracks the preferences options usage, by recording both the parameter name and value. By default, values are anonymized. Only parameters explicitly declared in the 'clearTextPreferenceParams' list will be recorded verbatim. Setting value to nil means that the parameter has been unset in the preferences; so the value will not be recorded.

func SetPreviousTelemetryStatus

func SetPreviousTelemetryStatus(ctx context.Context, isEnabled bool)

SetPreviousTelemetryStatus sets telemetry status before a command is run

func SetProjectType

func SetProjectType(ctx context.Context, projectType string)

func SetSignal

func SetSignal(ctx context.Context, signal os.Signal)

func SetTelemetryStatus

func SetTelemetryStatus(ctx context.Context, isEnabled bool)

SetTelemetryStatus sets telemetry status after a command is run