controller

package
v1.55.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 26 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 NewSSEFlagChange

func NewSSEFlagChange(
	sseService stream.SSEService,
	flagsetManager service.FlagsetManager,
	logger *zap.Logger,
) Controller

NewSSEFlagChange is the constructor to create a new controller to handle SSE requests 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
}

type WSFlagChange

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

WSFlagChange is the implementation of the controller

func NewWsFlagChange

func NewWsFlagChange(websocketService stream.WebsocketService, logger *zap.Logger) *WSFlagChange

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

func (*WSFlagChange) Handler

func (f *WSFlagChange) Handler(c echo.Context) error

Handler is the entry point for the websocket endpoint to get notified when a flag has been edited @Summary Websocket endpoint to be notified about flag changes @Tags GO Feature Flag Evaluation Stream API @Description This endpoint is a websocket endpoint to be notified about flag changes; @Description every change pushes a notifier.DiffCache message to the client. @Produce json @Accept json @Param apiKey query string false "apiKey to authorize the connection to the relay proxy" @Success 200 {object} notifier.DiffCache "Success" @Failure 400 {object} modeldocs.HTTPErrorDoc "Bad Request" @Failure 401 {object} modeldocs.HTTPErrorDoc "Unauthorized" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /stream/v1/ws/flag/change [get]

func (*WSFlagChange) LegacyHandler

func (f *WSFlagChange) LegacyHandler(c echo.Context) error

Handler is the entry point for the websocket endpoint to get notified when a flag has been edited @Summary Websocket endpoint to be notified about flag changes @Tags GO Feature Flag Evaluation Stream API @Deprecated @Description Deprecated: use /stream/v1/ws/flag/change instead. This endpoint @Description is a websocket endpoint to be notified about flag changes; every @Description change pushes a notifier.DiffCache message to the client. @Produce json @Accept json @Param apiKey query string false "apiKey to authorize the connection to the relay proxy" @Success 200 {object} notifier.DiffCache "Success" @Failure 400 {object} modeldocs.HTTPErrorDoc "Bad Request" @Failure 401 {object} modeldocs.HTTPErrorDoc "Unauthorized" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /ws/v1/flag/change [get]

Jump to

Keyboard shortcuts

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