metadata

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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 FeatureToggleIsEnabled added in v1.0.20

func FeatureToggleIsEnabled(ctx context.Context, toggle int) bool

func GetAppVersion

func GetAppVersion(ctx context.Context) (string, error)

func GetBuild

func GetBuild(ctx context.Context) (string, error)

func GetCustomKey

func GetCustomKey(ctx context.Context, key string) (string, error)

func GetDataFromCtx

func GetDataFromCtx(ctx context.Context, key string) (string, error)

func GetPlatform

func GetPlatform(ctx context.Context) (string, error)

func GetPlatformOS

func GetPlatformOS(ctx context.Context) (string, error)

Types

type MetadataError

type MetadataError error

type Platform added in v1.0.21

type Platform interface {
	IsValid() bool
	IsMobile() bool
	IsIos() bool
	IsAndroid() bool
	IsWeb() bool
	IsMobileWeb() bool
	IsDesktopWeb() bool
	Platform() string
}

func GetPlatformType added in v1.0.21

func GetPlatformType(ctx context.Context) (Platform, error)

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
const (
	RatioEqual Ratio = 0
	RatioGreat Ratio = 1
	RatioLess  Ratio = -1
	RatioError Ratio = math.MaxInt
)

func CompareVersions

func CompareVersions(ctx context.Context, vd VersionData) (Ratio, error)

type VersionData

type VersionData map[PlatformType]string

type VersionDataError

type VersionDataError error

Jump to

Keyboard shortcuts

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