Clone the twdehands SDK into mrktplaats and retarget naming and defaults for app.marktplaats.nl while keeping the same request/response bodies and endpoint behavior.
24 lines
619 B
Go
24 lines
619 B
Go
package mrktplaats
|
|
|
|
import "context"
|
|
|
|
// ConfigService handles A/B tests and feature flags.
|
|
type ConfigService struct {
|
|
t *transport
|
|
}
|
|
|
|
// LabsConfig contains A/B test assignments and feature flags.
|
|
type LabsConfig struct {
|
|
ABSwitches map[string]string `json:"abSwitches"`
|
|
FeatureSwitches map[string]bool `json:"featureSwitches"`
|
|
}
|
|
|
|
// Labs returns the current A/B test and feature flag configuration.
|
|
func (s *ConfigService) Labs(ctx context.Context) (*LabsConfig, error) {
|
|
var resp LabsConfig
|
|
if err := s.t.get(ctx, "/app/v1/labs/config", nil, &resp); err != nil {
|
|
return nil, err
|
|
}
|
|
return &resp, nil
|
|
}
|