context

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// UserId is the the id of the user.
	UserId string

	// SessionId is the id of the session.
	SessionId string

	// RemoteAddress is the IP address of the machine.
	RemoteAddress string

	// Environment is the environment this application is running in.
	Environment string

	// AppName is the application name.
	AppName string

	// Properties is a map of additional properties.
	Properties map[string]string
}

Context specifies the context in which a feature toggle should be considered to be enabled or not.

func (Context) Field

func (ctx Context) Field(name string) string

Field allows accessing the fields of the context by name. The typed fields are searched first and if nothing matches, it will search the properties.

func (Context) Override

func (ctx Context) Override(src Context) *Context

Override will take all non-empty values in 'src' and replace the corresponding values in this context with those.

Jump to

Keyboard shortcuts

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