Documentation ¶
Index ¶
- Constants
- func GetRequestID(ctx context.Context) (uint64, bool)
- func Getenv(ctx context.Context, key string) string
- func LookupEnv(ctx context.Context, key string) (string, bool)
- func Setenv(ctx context.Context, key, val string) error
- func WithEnviron(ctx context.Context, v []string) context.Context
- func WithLookupEnv(ctx context.Context, f lookupEnvFunc) context.Context
- func WithSetenv(ctx context.Context, f setenvFunc) context.Context
Constants ¶
const RequestIDKey = "csi.requestid"
RequestIDKey is the key used to put/get a CSI request ID in/fromt a Go context.
Variables ¶
This section is empty.
Functions ¶
func GetRequestID ¶
GetRequestID inspects the context for gRPC metadata and returns its request ID if available.
func LookupEnv ¶
LookupEnv returns the value of the provided environment variable by:
Inspecting the context for a key "os.Environ" with a string slice value. If such a key and value exist then the string slice is searched for the specified key and if found its value is returned.
Inspecting the context for a key "os.LookupEnv" with a value of func(string) (string, bool). If such a key and value exist then the function is used to attempt to discover the key's value. If the key and value are found they are returned.
Returning the result of os.LookupEnv.
func Setenv ¶
Setenv sets the value of the provided environment variable to the specified value by first inspecting the context for a key "os.Setenv" with a value of func(string, string) error. If the context does not contain such a function then os.Setenv is used instead.
func WithEnviron ¶
WithEnviron returns a new Context with the provided environment variable string slice.
func WithLookupEnv ¶
WithLookupEnv returns a new Context with the provided function.
Types ¶
This section is empty.