Documentation ¶
Index ¶
- Constants
- func GetRequiredAdminPermission(desc EndpointDescriptor) (string, bool)
- func HideSecrets(data []byte) ([]byte, error)
- func ModuleConnectedEvent(moduleName string) string
- func RequireAdminPermission(perm string) map[string]any
- type AddressConfiguration
- type BackendDeclaration
- type Client
- type ConfigData
- type EndpointDescriptor
- type EventHandler
- func (h *EventHandler) RemoteConfigReceiver(receiver RemoteConfigReceiver) *EventHandler
- func (h *EventHandler) RemoteConfigReceiverWithTimeout(receiver RemoteConfigReceiver, timeout time.Duration) *EventHandler
- func (h *EventHandler) RequireModule(moduleName string, upgrader HostsUpgrader) *EventHandler
- func (h *EventHandler) RoutesReceiver(receiver RoutesReceiver) *EventHandler
- type Handshake
- type HandshakeConfirmer
- type HandshakeData
- type HostsUpgrader
- type ModuleDependency
- type ModuleInfo
- type ModuleRequirements
- type RemoteConfigReceiver
- type RoutesReceiver
- type RoutingConfig
Constants ¶
View Source
const ( ErrorConnection = "ERROR_CONNECTION" ConfigError = "ERROR_CONFIG" ConfigSendConfigWhenConnected = "CONFIG:SEND_CONFIG_WHEN_CONNECTED" ConfigSendConfigChanged = "CONFIG:SEND_CONFIG_CHANGED" ConfigSendRoutesWhenConnected = "CONFIG:SEND_ROUTES_WHEN_CONNECTED" ConfigSendRoutesChanged = "CONFIG:SEND_ROUTES_CHANGED" ModuleReady = "MODULE:READY" ModuleSendRequirements = "MODULE:SEND_REQUIREMENTS" ModuleSendConfigSchema = "MODULE:SEND_CONFIG_SCHEMA" ModuleConnectionSuffix = "MODULE_CONNECTED" )
View Source
const (
RequiredAdminPermission = "reqAdminPerm"
)
Variables ¶
This section is empty.
Functions ¶
func GetRequiredAdminPermission ¶
func GetRequiredAdminPermission(desc EndpointDescriptor) (string, bool)
func HideSecrets ¶
func ModuleConnectedEvent ¶
func RequireAdminPermission ¶
Types ¶
type AddressConfiguration ¶
type BackendDeclaration ¶
type BackendDeclaration struct { ModuleName string Version string LibVersion string Endpoints []EndpointDescriptor RequiredModules []ModuleDependency Address AddressConfiguration }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(moduleInfo ModuleInfo, configData ConfigData, hosts []string, logger log.Logger) *Client
type ConfigData ¶
type ConfigData struct { Version string Schema json.RawMessage Config json.RawMessage }
type EndpointDescriptor ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func NewEventHandler ¶
func NewEventHandler() *EventHandler
func (*EventHandler) RemoteConfigReceiver ¶
func (h *EventHandler) RemoteConfigReceiver(receiver RemoteConfigReceiver) *EventHandler
func (*EventHandler) RemoteConfigReceiverWithTimeout ¶
func (h *EventHandler) RemoteConfigReceiverWithTimeout(receiver RemoteConfigReceiver, timeout time.Duration) *EventHandler
func (*EventHandler) RequireModule ¶
func (h *EventHandler) RequireModule(moduleName string, upgrader HostsUpgrader) *EventHandler
func (*EventHandler) RoutesReceiver ¶
func (h *EventHandler) RoutesReceiver(receiver RoutesReceiver) *EventHandler
type Handshake ¶
type Handshake struct {
// contains filtered or unexported fields
}
func NewHandshake ¶
func NewHandshake( moduleInfo ModuleInfo, configData ConfigData, requirements ModuleRequirements, confirmer HandshakeConfirmer, logger log.Logger, ) *Handshake
type HandshakeConfirmer ¶
type HandshakeConfirmer interface {
// contains filtered or unexported methods
}
type HandshakeData ¶
type HandshakeData struct {
// contains filtered or unexported fields
}
type HostsUpgrader ¶
type HostsUpgrader interface {
Upgrade(hosts []string)
}
type ModuleDependency ¶
type ModuleInfo ¶
type ModuleInfo struct { ModuleName string ModuleVersion string LibVersion string GrpcOuterAddress AddressConfiguration Endpoints []EndpointDescriptor }
type ModuleRequirements ¶
type RemoteConfigReceiver ¶
type RoutesReceiver ¶
type RoutesReceiver interface {
ReceiveRoutes(ctx context.Context, routes RoutingConfig) error
}
type RoutingConfig ¶
type RoutingConfig []BackendDeclaration
Click to show internal directories.
Click to hide internal directories.