Documentation ¶
Index ¶
- Constants
- Variables
- func PrepareActivateConfigCommand(configID string, date time.Time) []byte
- func PrepareDeleteBackendDeclarationCommand(backend structure.BackendDeclaration) []byte
- func PrepareDeleteCommonConfigsCommand(id string) []byte
- func PrepareDeleteConfigsCommand(ids []string) []byte
- func PrepareDeleteModulesCommand(ids []string) []byte
- func PrepareModuleConnectedCommand(module entity.Module) []byte
- func PrepareModuleDisconnectedCommand(module entity.Module) []byte
- func PrepareUpdateBackendDeclarationCommand(backend structure.BackendDeclaration) []byte
- func PrepareUpdateConfigSchemaCommand(schema entity.ConfigSchema) []byte
- func PrepareUpsertCommonConfigCommand(config UpsertCommonConfig) []byte
- func PrepareUpsertConfigCommand(config UpsertConfig) []byte
- type ActivateConfig
- type ApplyLogResponse
- type Client
- type DeleteCommonConfig
- type DeleteConfigs
- type DeleteModules
- type ResponseWithError
- type SocketLeaderClient
- func (c *SocketLeaderClient) Ack(data []byte, timeout time.Duration) ([]byte, error)
- func (c *SocketLeaderClient) Close()
- func (c *SocketLeaderClient) Dial(timeout time.Duration) error
- func (c *SocketLeaderClient) SendDeclaration(backend structure.BackendDeclaration, timeout time.Duration) (string, error)
- type UpsertCommonConfig
- type UpsertConfig
Constants ¶
View Source
const ( ApplyCommandEvent = "CONFIG_CLUSTER:APPLY_COMMAND" ClusterParam = "cluster" )
View Source
const ( UpdateBackendDeclarationCommand DeleteBackendDeclarationCommand UpdateConfigSchemaCommand ModuleConnectedCommand ModuleDisconnectedCommand DeleteModulesCommand ActivateConfigCommand DeleteConfigsCommand UpsertConfigCommand DeleteCommonConfigsCommand UpsertCommonConfigCommand )
Variables ¶
View Source
var ( ErrNoLeader = errors.New("no leader in cluster") ErrLeaderClientNotInitialized = errors.New("leader client not initialized") ErrNotLeader = errors.New("node is not a leader") )
View Source
var ( // Set from config in main WsConnectionReadLimit int64 )
Functions ¶
func PrepareDeleteBackendDeclarationCommand ¶
func PrepareDeleteBackendDeclarationCommand(backend structure.BackendDeclaration) []byte
func PrepareUpdateBackendDeclarationCommand ¶
func PrepareUpdateBackendDeclarationCommand(backend structure.BackendDeclaration) []byte
func PrepareUpdateConfigSchemaCommand ¶
func PrepareUpdateConfigSchemaCommand(schema entity.ConfigSchema) []byte
func PrepareUpsertCommonConfigCommand ¶
func PrepareUpsertCommonConfigCommand(config UpsertCommonConfig) []byte
func PrepareUpsertConfigCommand ¶
func PrepareUpsertConfigCommand(config UpsertConfig) []byte
Types ¶
type ActivateConfig ¶
type ApplyLogResponse ¶
type ApplyLogResponse struct { ApplyError string Result json2.RawMessage }
func (ApplyLogResponse) Error ¶
func (a ApplyLogResponse) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewRaftClusterClient ¶
func (*Client) SyncApply ¶
func (client *Client) SyncApply(command []byte) (*ApplyLogResponse, error)
func (*Client) SyncApplyOnLeader ¶
func (client *Client) SyncApplyOnLeader(command []byte) (*ApplyLogResponse, error)
type DeleteCommonConfig ¶
type DeleteCommonConfig struct {
Id string
}
type DeleteConfigs ¶
type DeleteConfigs struct {
Ids []string
}
type DeleteModules ¶
type DeleteModules struct {
Ids []string
}
type ResponseWithError ¶
func NewResponse ¶
func NewResponse(value interface{}) ResponseWithError
func NewResponseErrorf ¶
func NewResponseErrorf(code codes.Code, format string, args ...interface{}) ResponseWithError
type SocketLeaderClient ¶
type SocketLeaderClient struct {
// contains filtered or unexported fields
}
func NewSocketLeaderClient ¶
func NewSocketLeaderClient(address string, leaderDisconnectionCallback func()) *SocketLeaderClient
func (*SocketLeaderClient) Close ¶
func (c *SocketLeaderClient) Close()
func (*SocketLeaderClient) SendDeclaration ¶
func (c *SocketLeaderClient) SendDeclaration(backend structure.BackendDeclaration, timeout time.Duration) (string, error)
type UpsertCommonConfig ¶
type UpsertCommonConfig struct { Config entity.CommonConfig Create bool }
Click to show internal directories.
Click to hide internal directories.