Documentation
¶
Overview ¶
Package goalapi provides goals via the v1 api. goals are not yet included in the v2 api
Index ¶
Constants ¶
const ( // Click represents a click goal Click = "click" // Custom represents a custom event goal Custom = "custom" // PageView indicates a page view goal PageView = "pageview" )
Variables ¶
var Kinds = []string{Click, Custom, PageView}
Kinds are all the kinds that we can use for a goal
Functions ¶
func DeleteGoal ¶
DeleteGoal deletes a goal in the current environment
Types ¶
type ExperimentResults ¶
type ExperimentResults struct {
Change float64 `json:"change"`
ConfidenceScore float64 `json:"confidenceScore"`
ZScore float64 `json:"z_score"`
Control Variation `json:"control"`
Experiment Variation `json:"experiment"`
}
ExperimentResults holds the results of an experiment for a particular goal/flag combo
func GetExperimentResults ¶
func GetExperimentResults(goalID string, flagKey string) (*ExperimentResults, error)
GetExperimentResults returns the experiment results for a specific flag and goal
type Goal ¶
type Goal struct {
// ID of the goal
ID string `json:"_id,omitempty"`
// Name of the goal
Name string `json:"name,omitempty"`
// Description of the goal
Description string `json:"description,omitempty"`
// Kind tells whether the goal is custom, pageView or click
Kind string `json:"kind,omitempty"`
// Key for custom goals
Key *string `json:"key,omitempty"`
// IsActive indicates whether the goal is being tracked by a flag
IsActive bool `json:"isActive,omitempty"`
// LastModified is a unix epoch time in milliseconds specifying the last modification time of this goal.
LastModified float32 `json:"lastModified,omitempty"`
// AttachedFeatureCount is the number of attached goals
AttachedFeatureCount int `json:"_attachedFeatureCount,omitempty"`
// URLs are the url matchers attached to the goal
URLs []GoalURLMatchers `json:"urls,omitempty"`
// AttachedFeatures describes the flags attached to this goal. This is on the individual goal view.
AttachedFeatures []struct {
Key string `json:"key"`
Name string `json:"name"`
On bool `json:"on"`
} `json:"_attachedFeatures,omitempty"`
// IsDeleteable indicates if the goal can be deleted
IsDeleteable bool `json:"_isDeleteable,omitempty"`
// Source is the source of the goal
Source *struct {
// Name is the name of the source
Name string `json:"name"`
} `json:"_source,omitempty"`
// Version is the version of the goal
Version int `json:"_version,omitempty"`
}
Goal describes the goal type.
func CreateGoal ¶
CreateGoal creates a goal in the current environment
type GoalURLMatchers ¶
type GoalURLMatchers struct {
ExactURLs []URLMatcherExact `json:"exactUrls,omitempty"`
CanonicalURLs []URLMatcherCanonical `json:"canonicalUrls,omitempty"`
RegexURLs []URLMatcherRegex `json:"regexUrls,omitempty"`
SubstringURLs []URLMatcherSubstring `json:"substringUrls,omitempty"`
}
GoalURLMatchers describes the url matchers for a goal
type URLMatcherBase ¶
type URLMatcherBase struct {
Kind string `json:"kind"`
}
URLMatcherBase includes the kind of a url matcher in url matcher definitions
type URLMatcherCanonical ¶
type URLMatcherCanonical struct {
URLMatcherBase `json:",inline"`
URL string `json:"url"`
}
URLMatcherCanonical describes a canonical url matcher
type URLMatcherExact ¶
type URLMatcherExact struct {
URLMatcherBase `json:",inline"`
URL string `json:"url"`
}
URLMatcherExact describes an exact url matcher
type URLMatcherRegex ¶
type URLMatcherRegex struct {
URLMatcherBase `json:",inline"`
Pattern string `json:"pattern"`
}
URLMatcherRegex describes a regex url matcher
type URLMatcherSubstring ¶
type URLMatcherSubstring struct {
URLMatcherBase `json:",inline"`
Substring string `json:"substring"`
}
URLMatcherSubstring describes a substring url matcher
type Variation ¶
type Variation struct {
Conversions int `json:"conversions"`
Impressions int `json:"impressions"`
ConversionRate float64 `json:"conversionRate"`
StandardError float64 `json:"standardError"`
ConfidenceInterval float64 `json:"confidenceInterval"`
}
Variation holds data about each result