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表示命中灰度策略
Click to show internal directories.
Click to hide internal directories.