MCPcopy
hub / github.com/spacecloud-io/space-cloud / SetConfig

Method SetConfig

gateway/modules/eventing/eventing.go:99–122  ·  view source on GitHub ↗

SetConfig sets the module config

(projectID string, eventing *config.EventingConfig)

Source from the content-addressed store, hash-verified

97
98// SetConfig sets the module config
99func (m *Module) SetConfig(projectID string, eventing *config.EventingConfig) error {
100 m.lock.Lock()
101 defer m.lock.Unlock()
102
103 if eventing == nil || !eventing.Enabled {
104 m.config.Enabled = false
105 return nil
106 }
107
108 if eventing.DBAlias == "" {
109 return errors.New("invalid eventing config provided")
110 }
111
112 m.project = projectID
113 m.config.Enabled = eventing.Enabled
114 m.config.DBAlias = eventing.DBAlias
115
116 // `m.config.InternalRules` cannot be set by the eventing module. Its used by other modules only.
117 if m.config.InternalRules == nil {
118 m.config.InternalRules = make(config.EventingTriggers)
119 }
120
121 return nil
122}
123
124// SetSchemaConfig sets schema config of eventing module
125func (m *Module) SetSchemaConfig(evSchemas config.EventingSchemas) error {

Callers

nothing calls this directly

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected