abtesting

package
v1.106.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("consoleapi ab testing error")

Error - console ab testing error type.

Functions

This section is empty.

Types

type ABService

type ABService interface {
	// GetABValues gets AB test values for a specific user. It returns a default value on error.
	GetABValues(ctx context.Context, user console.User) (values map[string]interface{}, err error)
	// SendHit sends an "action" event to flagship.
	SendHit(ctx context.Context, user console.User, action string)
}

ABService is an interface for AB test methods.

type Config

type Config struct {
	Enabled        bool   `help:"whether or not AB testing is enabled" default:"false"`
	APIKey         string `help:"the Flagship API key"`
	EnvId          string `help:"the Flagship environment ID"`
	FlagshipURL    string `help:"the Flagship API URL" default:"https://decision.flagship.io/v2"`
	HitTrackingURL string `help:"the Flagship environment ID" default:"https://ariane.abtasty.com"`
}

Config contains configurations for the AB testing service.

type Service

type Service struct {
	Config Config
	// contains filtered or unexported fields
}

Service is a service that exposes all ab testing functionality.

func NewService

func NewService(log *zap.Logger, config Config) *Service

NewService is a constructor for AB service.

func (*Service) GetABValues

func (s *Service) GetABValues(ctx context.Context, user console.User) (values map[string]interface{}, err error)

GetABValues gets AB test values for a specific user.

func (*Service) SendHit

func (s *Service) SendHit(ctx context.Context, user console.User, action string)

SendHit sends an "action" event to flagship.

Jump to

Keyboard shortcuts

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