Documentation ¶
Index ¶
- func GenerateDate() time.Time
- func GenerateId() string
- func StringsToMap(list []string) map[string]struct{}
- type CommonConfigStore
- func (cs *CommonConfigStore) Create(config entity.CommonConfig) entity.CommonConfig
- func (cs *CommonConfigStore) DeleteByIds(ids []string) int
- func (cs *CommonConfigStore) GetAll() []entity.CommonConfig
- func (cs CommonConfigStore) GetByIds(ids []string) []entity.CommonConfig
- func (cs CommonConfigStore) GetByName(name string) []entity.CommonConfig
- func (cs *CommonConfigStore) UpdateById(config entity.CommonConfig)
- type ConfigStore
- func (cs *ConfigStore) Activate(config entity.Config, date time.Time) []entity.Config
- func (cs *ConfigStore) Create(config entity.Config) entity.Config
- func (cs *ConfigStore) DeleteByIds(ids []string) int
- func (cs *ConfigStore) FilterByCommonConfigs(commonIds []string) []entity.Config
- func (cs ConfigStore) GetActiveByModuleId(moduleId string) *entity.Config
- func (cs ConfigStore) GetByIds(ids []string) []entity.Config
- func (cs ConfigStore) GetByModuleIds(ids []string) []entity.Config
- func (cs *ConfigStore) UpdateById(config entity.Config)
- type Mesh
- func (m Mesh) BackendExist(backend structure.BackendDeclaration) (exist bool)
- func (m Mesh) CheckBackendChanged(backend structure.BackendDeclaration) (changed bool)
- func (m *Mesh) DeleteBackend(backend structure.BackendDeclaration) (deleted bool)
- func (m Mesh) GetBackends(module string) []structure.BackendDeclaration
- func (m Mesh) GetModuleAddresses(moduleName string) []structure.AddressConfiguration
- func (m Mesh) GetRoutes() structure.RoutingConfig
- func (m *Mesh) UpsertBackend(backend structure.BackendDeclaration) (changed bool)
- type ModuleStore
- func (ms *ModuleStore) Create(module entity.Module)
- func (ms *ModuleStore) DeleteByIds(ids []string) []entity.Module
- func (ms *ModuleStore) GetAll() []entity.Module
- func (ms ModuleStore) GetById(id string) *entity.Module
- func (ms ModuleStore) GetByName(name string) *entity.Module
- func (ms *ModuleStore) UpdateByName(module entity.Module)
- type NodesMap
- type ReadonlyCommonConfigStore
- type ReadonlyConfigStore
- type ReadonlyMesh
- type ReadonlyModuleStore
- type ReadonlySchemaStore
- type ReadonlyState
- type SchemaStore
- type State
- func (s State) CommonConfigs() ReadonlyCommonConfigStore
- func (s State) Configs() ReadonlyConfigStore
- func (s State) Mesh() ReadonlyMesh
- func (s State) Modules() ReadonlyModuleStore
- func (s State) Schemas() ReadonlySchemaStore
- func (s *State) WritableCommonConfigs() WriteableCommonConfigStore
- func (s *State) WritableConfigs() WriteableConfigStore
- func (s *State) WritableMesh() WriteableMesh
- func (s *State) WritableModules() WriteableModuleStore
- func (s *State) WritableSchemas() WriteableSchemaStore
- type WritableState
- type WriteableCommonConfigStore
- type WriteableConfigStore
- type WriteableMesh
- type WriteableModuleStore
- type WriteableSchemaStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDate ¶
func GenerateId ¶
func GenerateId() string
func StringsToMap ¶
Types ¶
type CommonConfigStore ¶
type CommonConfigStore struct {
Configs []entity.CommonConfig
}
func NewCommonConfigStore ¶
func NewCommonConfigStore() *CommonConfigStore
func (*CommonConfigStore) Create ¶
func (cs *CommonConfigStore) Create(config entity.CommonConfig) entity.CommonConfig
func (*CommonConfigStore) DeleteByIds ¶
func (cs *CommonConfigStore) DeleteByIds(ids []string) int
func (*CommonConfigStore) GetAll ¶
func (cs *CommonConfigStore) GetAll() []entity.CommonConfig
func (CommonConfigStore) GetByIds ¶
func (cs CommonConfigStore) GetByIds(ids []string) []entity.CommonConfig
func (CommonConfigStore) GetByName ¶
func (cs CommonConfigStore) GetByName(name string) []entity.CommonConfig
func (*CommonConfigStore) UpdateById ¶
func (cs *CommonConfigStore) UpdateById(config entity.CommonConfig)
type ConfigStore ¶
func NewConfigStore ¶
func NewConfigStore() *ConfigStore
func (*ConfigStore) DeleteByIds ¶
func (cs *ConfigStore) DeleteByIds(ids []string) int
func (*ConfigStore) FilterByCommonConfigs ¶
func (cs *ConfigStore) FilterByCommonConfigs(commonIds []string) []entity.Config
func (ConfigStore) GetActiveByModuleId ¶
func (cs ConfigStore) GetActiveByModuleId(moduleId string) *entity.Config
func (ConfigStore) GetByModuleIds ¶
func (cs ConfigStore) GetByModuleIds(ids []string) []entity.Config
func (*ConfigStore) UpdateById ¶
func (cs *ConfigStore) UpdateById(config entity.Config)
type Mesh ¶
type Mesh struct { // { "ModuleName": { "address": BackendDeclaration, ...}, ... } ModulesMap map[string]NodesMap }
func (Mesh) BackendExist ¶
func (m Mesh) BackendExist(backend structure.BackendDeclaration) (exist bool)
func (Mesh) CheckBackendChanged ¶
func (m Mesh) CheckBackendChanged(backend structure.BackendDeclaration) (changed bool)
func (*Mesh) DeleteBackend ¶
func (m *Mesh) DeleteBackend(backend structure.BackendDeclaration) (deleted bool)
func (Mesh) GetBackends ¶
func (m Mesh) GetBackends(module string) []structure.BackendDeclaration
func (Mesh) GetModuleAddresses ¶
func (m Mesh) GetModuleAddresses(moduleName string) []structure.AddressConfiguration
func (Mesh) GetRoutes ¶
func (m Mesh) GetRoutes() structure.RoutingConfig
func (*Mesh) UpsertBackend ¶
func (m *Mesh) UpsertBackend(backend structure.BackendDeclaration) (changed bool)
type ModuleStore ¶
func NewModuleStore ¶
func NewModuleStore() *ModuleStore
func (*ModuleStore) Create ¶
func (ms *ModuleStore) Create(module entity.Module)
func (*ModuleStore) DeleteByIds ¶
func (ms *ModuleStore) DeleteByIds(ids []string) []entity.Module
func (*ModuleStore) GetAll ¶
func (ms *ModuleStore) GetAll() []entity.Module
func (*ModuleStore) UpdateByName ¶
func (ms *ModuleStore) UpdateByName(module entity.Module)
type NodesMap ¶
type NodesMap map[string]structure.BackendDeclaration
type ReadonlyCommonConfigStore ¶
type ReadonlyCommonConfigStore interface { GetByIds(ids []string) []entity.CommonConfig GetByName(name string) []entity.CommonConfig GetAll() []entity.CommonConfig }
type ReadonlyConfigStore ¶
type ReadonlyMesh ¶
type ReadonlyMesh interface { CheckBackendChanged(backend structure.BackendDeclaration) (changed bool) BackendExist(backend structure.BackendDeclaration) (exist bool) GetModuleAddresses(moduleName string) []structure.AddressConfiguration GetBackends(module string) []structure.BackendDeclaration GetRoutes() structure.RoutingConfig }
type ReadonlyModuleStore ¶
type ReadonlySchemaStore ¶
type ReadonlySchemaStore interface {
GetByModuleIds(ids []string) []entity.ConfigSchema
}
type ReadonlyState ¶
type ReadonlyState interface { Mesh() ReadonlyMesh Configs() ReadonlyConfigStore Schemas() ReadonlySchemaStore Modules() ReadonlyModuleStore CommonConfigs() ReadonlyCommonConfigStore }
type SchemaStore ¶
type SchemaStore struct {
Schemas []entity.ConfigSchema
}
func NewSchemaStore ¶
func NewSchemaStore() *SchemaStore
func (*SchemaStore) DeleteByIds ¶
func (ss *SchemaStore) DeleteByIds(ids []string) int
func (SchemaStore) GetByModuleIds ¶
func (ss SchemaStore) GetByModuleIds(ids []string) []entity.ConfigSchema
func (*SchemaStore) Upsert ¶
func (ss *SchemaStore) Upsert(schema entity.ConfigSchema) entity.ConfigSchema
type State ¶
type State struct { MeshStore *Mesh ConfigsStore *ConfigStore SchemasStore *SchemaStore ModulesStore *ModuleStore CommonConfigsStore *CommonConfigStore }
func NewStateFromSnapshot ¶
func NewStateFromSnapshot(configs []entity.Config, schemas []entity.ConfigSchema, modules []entity.Module, commConfigs []entity.CommonConfig) *State
func (State) CommonConfigs ¶
func (s State) CommonConfigs() ReadonlyCommonConfigStore
func (State) Configs ¶
func (s State) Configs() ReadonlyConfigStore
func (State) Mesh ¶
func (s State) Mesh() ReadonlyMesh
func (State) Modules ¶
func (s State) Modules() ReadonlyModuleStore
func (State) Schemas ¶
func (s State) Schemas() ReadonlySchemaStore
func (*State) WritableCommonConfigs ¶
func (s *State) WritableCommonConfigs() WriteableCommonConfigStore
func (*State) WritableConfigs ¶
func (s *State) WritableConfigs() WriteableConfigStore
func (*State) WritableMesh ¶
func (s *State) WritableMesh() WriteableMesh
func (*State) WritableModules ¶
func (s *State) WritableModules() WriteableModuleStore
func (*State) WritableSchemas ¶
func (s *State) WritableSchemas() WriteableSchemaStore
type WritableState ¶
type WritableState interface { ReadonlyState WritableMesh() WriteableMesh WritableConfigs() WriteableConfigStore WritableSchemas() WriteableSchemaStore WritableModules() WriteableModuleStore WritableCommonConfigs() WriteableCommonConfigStore }
type WriteableCommonConfigStore ¶
type WriteableCommonConfigStore interface { ReadonlyCommonConfigStore Create(config entity.CommonConfig) entity.CommonConfig UpdateById(config entity.CommonConfig) DeleteByIds(ids []string) int }
type WriteableConfigStore ¶
type WriteableMesh ¶
type WriteableMesh interface { ReadonlyMesh UpsertBackend(backend structure.BackendDeclaration) (changed bool) DeleteBackend(backend structure.BackendDeclaration) (deleted bool) }
type WriteableModuleStore ¶
type WriteableSchemaStore ¶
type WriteableSchemaStore interface { ReadonlySchemaStore Upsert(schema entity.ConfigSchema) entity.ConfigSchema DeleteByIds(ids []string) int }
Click to show internal directories.
Click to hide internal directories.