handlers

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activate

func Activate(context *connectors.DecisionContext) func(http.ResponseWriter, *http.Request)

Activate returns a flag activation handler @Summary Activate a campaign @Tags Campaigns @Description Activate a campaign for a visitor ID @ID activate @Accept json @Produce json @Param request body activateBody true "Campaign activation request body" @Success 204 @Failure 400 {object} errorMessage @Failure 500 {object} errorMessage @Router /activate [post]

func Campaign

func Campaign(context *connectors.DecisionContext) func(http.ResponseWriter, *http.Request)

Campaign returns a campaign handler @Summary Get a single campaigns for the visitor @Tags Campaigns @Description Get a single campaign value and metadata for a visitor ID and context @ID get-campaign @Accept json @Produce json @Param id path string true "Campaign ID" @Param request body campaignsBodySwagger true "Campaign request body" @Success 200 {object} campaignResponse @Failure 400 {object} errorMessage @Failure 500 {object} errorMessage @Router /campaigns/{id} [post]

func Campaigns

func Campaigns(context *connectors.DecisionContext) func(http.ResponseWriter, *http.Request)

Campaigns returns a campaigns handler @Summary Get all campaigns for the visitor @Tags Campaigns @Description Get all campaigns value and metadata for a visitor ID and context @ID get-campaigns @Accept json @Produce json @Param request body campaignsBodySwagger true "Campaigns request body" @Success 200 {object} campaignsResponse @Failure 400 {object} errorMessage @Failure 500 {object} errorMessage @Router /campaigns [post]

func Flags

func Flags(context *connectors.DecisionContext) func(http.ResponseWriter, *http.Request)

Flags returns a flags handler @Summary Get all flags @Tags Flags @Description Get all flags value and metadata for a visitor ID and context @ID get-flags @Accept json @Produce json @Param request body campaignsBodySwagger true "Flag request body" @Success 200 {object} map[string]FlagInfo{} @Failure 400 {object} errorMessage @Failure 500 {object} errorMessage @Router /flags [post]

Types

type FlagInfo

type FlagInfo struct {
	Value    interface{}  `json:"value"`
	Metadata FlagMetadata `json:"metadata"`
}

FlagInfo represents the informations about a flag key

type FlagMetadata

type FlagMetadata struct {
	CampaignID         string  `json:"campaignId"`
	CampaignName       string  `json:"campaignName"`
	Slug               *string `json:"slug"`
	Type               string  `json:"type"`
	VariationGroupID   string  `json:"variationGroupId"`
	VariationGroupName string  `json:"variationGroupName"`
	VariationID        string  `json:"variationId"`
	VariationName      string  `json:"variationName"`
	Reference          bool    `json:"reference"`
}

FlagMetadata represents the metadata informations about a flag key

type MetricsResponse

type MetricsResponse struct {
	Cmdline               []string               `json:"cmdline"`
	Memstats              map[string]interface{} `json:"memstats"`
	HandlerErrors         float64                `json:"handlers.[name].errors"`
	HandlerResponseTime50 float64                `json:"handlers.[name].response_time.p50"`
	HandlerResponseTime90 float64                `json:"handlers.[name].response_time.p90"`
	HandlerResponseTime95 float64                `json:"handlers.[name].response_time.p95"`
	HandlerResponseTime99 float64                `json:"handlers.[name].response_time.p99"`
}

nolint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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