preparers

package
v0.1.139 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAliases

func ApplyAliases(ctx context.Context) (context.Context, error)

ApplyAliases consolidates flags with aliases into a single source-of-truth flag. After calling this, the main flags will have their values set as follows:

  • If the main flag was already set, it will keep its value.
  • If it was not set, but an alias was, it will take the value of the first specified alias flag. This will set flag.Changed to true, as if it were specified manually.
  • If none of the flags were set, the main flag will remain its default value.

func DetermineConfigDir

func DetermineConfigDir(ctx context.Context) (context.Context, error)

func InitClient

func InitClient(ctx context.Context) (context.Context, error)

func LoadConfig

func LoadConfig(ctx context.Context) (context.Context, error)

func SetOtelAuthenticationKey added in v0.1.135

func SetOtelAuthenticationKey(ctx context.Context) (context.Context, error)

This method sets the user auth token as an environment variable called FLY_OTEL_AUTH_KEY Why is this necessary? It's quite difficult to get the auth token when we initialize the tracer. There's no assurance it will exist at the time of creation, so we use this preparer to set it And then in the tracer, we use a GRPC interceptor to pull it out when sending the traces. *Another approach would be to load the config in the interceptor, and pull the tokens from it. except it only came to my mind after writing this so let's stick with this for now.

Types

type Preparer

type Preparer func(context.Context) (context.Context, error)

Jump to

Keyboard shortcuts

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