Files
zeekayandHanzo Dev 8ee8950230 Go 1.27.1, and the code it can say more simply
The module declares go 1.27.1 and the adapter image follows. go fix
applied the modernizers and left ptrString and ptrBool with no callers,
so they are gone; omitzero is not applied, since it changes what the
JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-16 19:52:31 -07:00

71 lines
1.8 KiB
Go

package insights
import "context"
type noopClient struct {
Config
}
var (
emptyFlagValues = map[string]any{}
emptyEvaluatedFlagRecords = map[string]evaluatedFlagRecord{}
noopFeatureFlagResult = &FeatureFlagResult{Enabled: false}
noopFeatureFlagEvaluations = &FeatureFlagEvaluations{flags: emptyEvaluatedFlagRecords}
)
func newNoopClient(config Config) Client {
return &noopClient{Config: config}
}
func (c *noopClient) Enqueue(Message) error {
return ErrSDKDisabled
}
func (c *noopClient) EnqueueWithContext(context.Context, Message) error {
return ErrSDKDisabled
}
func (c *noopClient) IsFeatureEnabled(FeatureFlagPayload) (any, error) {
return false, ErrSDKDisabled
}
func (c *noopClient) GetFeatureFlag(FeatureFlagPayload) (any, error) {
return false, ErrSDKDisabled
}
func (c *noopClient) GetFeatureFlagResult(FeatureFlagPayload) (*FeatureFlagResult, error) {
return noopFeatureFlagResult, ErrSDKDisabled
}
func (c *noopClient) GetFeatureFlagPayload(FeatureFlagPayload) (string, error) {
return "", ErrSDKDisabled
}
func (c *noopClient) GetRemoteConfigPayload(string) (string, error) {
return "", ErrSDKDisabled
}
func (c *noopClient) GetAllFlags(FeatureFlagPayloadNoKey) (map[string]any, error) {
return emptyFlagValues, ErrSDKDisabled
}
func (c *noopClient) EvaluateFlags(EvaluateFlagsPayload) (*FeatureFlagEvaluations, error) {
return noopFeatureFlagEvaluations, ErrSDKDisabled
}
func (c *noopClient) EvaluateFlagsWithContext(context.Context, EvaluateFlagsPayload) (*FeatureFlagEvaluations, error) {
return noopFeatureFlagEvaluations, ErrSDKDisabled
}
func (c *noopClient) ReloadFeatureFlags() error {
return ErrSDKDisabled
}
func (c *noopClient) Close() error {
return ErrSDKDisabled
}
func (c *noopClient) CloseWithContext(context.Context) error {
return ErrSDKDisabled
}