File size: 448 Bytes
fea99b3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | package ffx
import (
"context"
"fmt"
)
type staticService struct {
config AccessConfig
}
var _ Service = &staticService{}
func (s *staticService) IsFeatureEnabled(ctx context.Context, feature Feature) (bool, error) {
acc, ok := s.config[feature]
if !ok {
return false, fmt.Errorf("feature %s not found", feature)
}
return acc, nil
}
func NewStaticService(config AccessConfig) Service {
return &staticService{
config: config,
}
}
|