service

package
v0.0.0-...-ed4ef5d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoFeatureFlagClient

func NewGoFeatureFlagClient(
	proxyConf *config.Config,
	logger *zap.Logger,
	proxyNotifier notifier.Notifier,
) (*ffclient.GoFeatureFlag, error)

func NewNotifierRelayProxy

func NewNotifierRelayProxy(websocketService WebsocketService) notifier.Notifier

Types

type Monitoring

type Monitoring interface {
	Health() model.HealthResponse
	Info() model.InfoResponse
}

Monitoring is the interface of the monitoring service

func NewMonitoring

func NewMonitoring(goFF *ffclient.GoFeatureFlag) Monitoring

NewMonitoring creates a new implementation of Monitoring

type Services

type Services struct {
	// MonitoringService is the service in charge of managing the monitoring
	MonitoringService Monitoring
	// WebsocketBroadcasterService is the service in charge to manage the websockets in the relay proxy
	WebsocketService WebsocketService
	// GOFeatureFlagService is the GO Feature Flag goff we are using in the relay proxy.
	GOFeatureFlagService *goff.GoFeatureFlag
}

type WebsocketConn

type WebsocketConn interface {
	WriteJSON(v interface{}) error
}

WebsocketConn is an interface to be able to mock websocket.Conn

type WebsocketService

type WebsocketService interface {
	// Register is adding the connection to the list of open connection.
	Register(c WebsocketConn)
	// Deregister is removing the connection from the list of open connection.
	Deregister(c WebsocketConn)
	// BroadcastFlagChanges is sending the diff cache struct to the client.
	BroadcastFlagChanges(diff notifier.DiffCache)
	// Close deregister all open connections.
	Close()
}

WebsocketService is the service interface that handle the websocket connections This service is able to broadcast a notification to all the open websockets

func NewWebsocketService

func NewWebsocketService() WebsocketService

NewWebsocketService is a constructor to create a new WebsocketService.

Jump to

Keyboard shortcuts

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