Documentation
¶
Index ¶
- Constants
- Variables
- func AddKeyValueToCtx(ctx context.Context, metaKey, key, value string) (context.Context, error)
- func AddPairsToCtx(ctx context.Context, metaKey string, pairs Pairs) (context.Context, error)
- func FeatureToggleIsEnabled(ctx context.Context, toggle int) bool
- func GetAppVersion(ctx context.Context) (string, error)
- func GetBuild(ctx context.Context) (string, error)
- func GetCustomKey(ctx context.Context, key string) (string, error)
- func GetDataFromCtx(ctx context.Context, key string) (string, error)
- func GetDatesFromCtx(ctx context.Context, key string) ([]string, error)
- func GetFreyaMethodsPath(ctx context.Context, method string) (context.Context, string)
- func GetFreyaTraceID(ctx context.Context) (context.Context, string)
- func GetPlatform(ctx context.Context) (string, error)
- func GetPlatformOS(ctx context.Context) (string, error)
- func GetValueFromCtx(ctx context.Context, metaKey, key string) (string, error)
- func GetValueFromCtxWithDefault(ctx context.Context, metaKey, key, defaultValue string) (string, error)
- type MetadataError
- type Pair
- type Pairs
- type Platform
- type PlatformType
- func (p PlatformType) IsAndroid() bool
- func (p PlatformType) IsDesktopWeb() bool
- func (p PlatformType) IsIos() bool
- func (p PlatformType) IsMobile() bool
- func (p PlatformType) IsMobileWeb() bool
- func (p PlatformType) IsValid() bool
- func (p PlatformType) IsWeb() bool
- func (p PlatformType) Platform() string
- type Ratio
- type VersionData
- type VersionDataError
Constants ¶
View Source
const ( FreyaTraceID = "freya_trace_id" FreyaMethodsPath = "freya_methods_path" )
View Source
const ( AppInfoFieldAppVersion = "app_version" // AppInfoFieldPlatformOSVersion версия операционной системы для mobile, для веб название браузера и его версия AppInfoFieldPlatformOSVersion = "platform_os_version" AppInfoFieldBuild = "build" AppInfoFieldPlatform = "platform" )
Variables ¶
View Source
var ( ErrEmptyMetadata MetadataError = errors.New("empty metadata in context") ErrKeyNotFound MetadataError = errors.New("not found key") ErrEmptyValuesInKey MetadataError = errors.New("empty values in key") ErrEmptyCondition VersionDataError = errors.New("empty condition for platform") ErrConditionVersion VersionDataError = errors.New("invalid condition version") ErrContextVersion VersionDataError = errors.New("invalid context version") )
Functions ¶
func AddKeyValueToCtx ¶ added in v1.2.0
func AddPairsToCtx ¶ added in v1.2.0
func FeatureToggleIsEnabled ¶ added in v1.0.20
func GetDatesFromCtx ¶ added in v1.2.0
func GetFreyaMethodsPath ¶ added in v1.2.0
func GetFreyaTraceID ¶ added in v1.2.0
func GetValueFromCtx ¶ added in v1.2.0
Types ¶
type MetadataError ¶
type MetadataError error
type Pair ¶ added in v1.2.0
func (Pair) MarshalEasyJSON ¶ added in v1.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Pair) MarshalJSON ¶ added in v1.2.0
MarshalJSON supports json.Marshaler interface
func (*Pair) UnmarshalEasyJSON ¶ added in v1.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Pair) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Pairs ¶ added in v1.2.0
type Pairs []Pair
func GetPairsFromCtx ¶ added in v1.2.0
func GetPairsFromCtxWithKey ¶ added in v1.2.0
func (Pairs) MarshalEasyJSON ¶ added in v1.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Pairs) MarshalJSON ¶ added in v1.2.0
MarshalJSON supports json.Marshaler interface
func (*Pairs) UnmarshalEasyJSON ¶ added in v1.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Pairs) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Platform ¶ added in v1.0.21
type PlatformType ¶
type PlatformType string
const ( PlatformTypeIOS PlatformType = "ios" PlatformTypeANDROID PlatformType = "android" PlatformTypeWEB PlatformType = "web" PlatformTypeWEBMobile PlatformType = "web-mobile" PlatformTypeWEBMobile2 PlatformType = "web_mobile" PlatformTypeDesktop PlatformType = "desktop" PlatformTypeWebDesktop PlatformType = "web-desktop" PlatformTypeWebDesktop2 PlatformType = "web_desktop" )
func (PlatformType) IsAndroid ¶ added in v1.0.21
func (p PlatformType) IsAndroid() bool
func (PlatformType) IsDesktopWeb ¶ added in v1.0.21
func (p PlatformType) IsDesktopWeb() bool
func (PlatformType) IsIos ¶ added in v1.0.21
func (p PlatformType) IsIos() bool
func (PlatformType) IsMobile ¶ added in v1.0.21
func (p PlatformType) IsMobile() bool
func (PlatformType) IsMobileWeb ¶ added in v1.0.21
func (p PlatformType) IsMobileWeb() bool
func (PlatformType) IsValid ¶ added in v1.0.21
func (p PlatformType) IsValid() bool
func (PlatformType) IsWeb ¶ added in v1.0.21
func (p PlatformType) IsWeb() bool
func (PlatformType) Platform ¶ added in v1.0.21
func (p PlatformType) Platform() string
type Ratio ¶
type Ratio int
func CompareVersions ¶
func CompareVersions(ctx context.Context, vd VersionData) (Ratio, error)
type VersionData ¶
type VersionData map[PlatformType]string
type VersionDataError ¶
type VersionDataError error
Click to show internal directories.
Click to hide internal directories.