gray

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrayConfig

type GrayConfig struct {
	TailMemberIDs []string // 按照MemberID 尾号灰度
	MemberIDs     []string // 精准匹配 MemberID
	Percent       int64    // memberID 未命中灰度策略,根据比例灰度判断是否命中 范围0~100
}

GrayConfig 基于用户ID灰度开关配置

type GraySwitch

type GraySwitch struct {
	// contains filtered or unexported fields
}

func NewGraySwitch

func NewGraySwitch(c *GrayConfig) *GraySwitch

func (*GraySwitch) IsGray

func (g *GraySwitch) IsGray(ctx context.Context, memberID string) bool

IsGray 返回true表示命中灰度策略

func (*GraySwitch) IsGrayByMemberIDInt

func (g *GraySwitch) IsGrayByMemberIDInt(ctx context.Context, MemberIDInt int64) bool

IsGray 返回true表示命中灰度策略

Jump to

Keyboard shortcuts

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