controller

package
v1.0.0-dev-2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Handler(c echo.Context) error
}

Controller is the interface used by all controller struct

func NewAPIFlagChange

func NewAPIFlagChange(flagsetManager service.FlagsetManager, metrics metric.Metrics) Controller

func NewAPIFlagConfiguration

func NewAPIFlagConfiguration(flagsetManager service.FlagsetManager, metrics metric.Metrics) Controller

func NewAllFlags

func NewAllFlags(flagsetManager service.FlagsetManager, metrics metric.Metrics) Controller

func NewCollectEvalData

func NewCollectEvalData(
	flagsetManager service.FlagsetManager,
	metrics metric.Metrics,
	logger *zap.Logger,
) Controller

NewCollectEvalData initialize the controller for the /data/collector endpoint

func NewFlagEval

func NewFlagEval(flagsetMngr service.FlagsetManager, metrics metric.Metrics) Controller

func NewForceFlagsRefresh

func NewForceFlagsRefresh(flagsetManager service.FlagsetManager, metrics metric.Metrics) Controller

NewForceFlagsRefresh initialize the controller for the /data/collector endpoint

func NewHealth

func NewHealth(monitoring service.Monitoring) Controller

NewHealth is a constructor to create a new controller for the health method

func NewInfo

func NewInfo(monitoring service.Monitoring) Controller

func NewWsFlagChange

func NewWsFlagChange(websocketService service.WebsocketService, logger *zap.Logger) Controller

NewWsFlagChange is the constructor to create a new controller to handle websocket request to be notified about flag changes.

type FlagChangeAPICtrl

type FlagChangeAPICtrl struct {
	// contains filtered or unexported fields
}

func (*FlagChangeAPICtrl) Handler

func (h *FlagChangeAPICtrl) Handler(c echo.Context) error

Handler is the endpoint to poll if you want to know if there is a configuration change in the flags @Summary Endpoint to poll if you want to know if there is a configuration change in the flags @Tags GO Feature Flag Evaluation API @Description Making a **GET** request to the URL `/v1/flag/change` will give you the hash of the current @Description configuration, you can use this hash to know if the configuration has changed. @Security ApiKeyAuth @Security XApiKeyAuth @Produce json @Accept json @Param If-None-Match header string false "The request will be processed only if ETag doesn't match." @Success 200 {object} FlagChangeResponse "Success" @Success 304 {string} string "Etag: \"117-0193435c612c50d93b798619d9464856263dbf9f\"" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /v1/flag/change [get]

type FlagChangeResponse

type FlagChangeResponse struct {
	Hash  uint32            `json:"hash"`
	Flags map[string]uint32 `json:"flags"`
}

type FlagConfigurationAPICtrl

type FlagConfigurationAPICtrl struct {
	// contains filtered or unexported fields
}

func (*FlagConfigurationAPICtrl) Handler

Handler is the endpoint to poll if you want to get the configuration of the flags. @Summary Endpoint to poll if you want to get the configuration of the flags. @Tags GO Feature Flag Evaluation API @Description Making a **POST** request to the URL `/v1/flag/configuration` will give you the list of @Description the flags to use them for local evaluation in your provider. @Security ApiKeyAuth @Security XApiKeyAuth @Produce json @Accept json @Param data body FlagConfigurationRequest false "List of flags to get the configuration from." @Param If-None-Match header string false "The request will be processed only if ETag doesn't match." @Success 200 {object} FlagConfigurationResponse "Success" @Success 304 {string} string "Etag: \"117-0193435c612c50d93b798619d9464856263dbf9f\"" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /v1/flag/configuration [post]

type FlagConfigurationError

type FlagConfigurationError = string
const (
	FlagConfigErrorInvalidRequest  FlagConfigurationError = "INVALID_REQUEST"
	FlagConfigErrorRetrievingFlags FlagConfigurationError = "RETRIEVING_FLAGS_ERROR"
)

type FlagConfigurationRequest

type FlagConfigurationRequest struct {
	Flags []string `json:"flags"`
}

type FlagConfigurationResponse

type FlagConfigurationResponse struct {
	Flags                       map[string]flag.Flag `json:"flags,omitempty"`
	EvaluationContextEnrichment map[string]any       `json:"evaluationContextEnrichment,omitempty"`
	ErrorCode                   string               `json:"errorCode,omitempty"`
	ErrorDetails                string               `json:"errorDetails,omitempty"`
}

type OFREPController

type OFREPController interface {
	Handler(c echo.Context) error
	OFREPHandler(c echo.Context) error
}

Jump to

Keyboard shortcuts

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