MCPcopy
hub / github.com/google/seesaw / ConfigStatus

Method ConfigStatus

engine/ipc.go:244–274  ·  view source on GitHub ↗

ConfigStatus returns status information about this Seesaw's current configuration.

(ctx *ipc.Context, reply *seesaw.ConfigStatus)

Source from the content-addressed store, hash-verified

242
243// ConfigStatus returns status information about this Seesaw's current configuration.
244func (s *SeesawEngine) ConfigStatus(ctx *ipc.Context, reply *seesaw.ConfigStatus) error {
245 s.trace("ConfigStatus", ctx)
246 if ctx == nil {
247 return errContext
248 }
249
250 if !ctx.CanRead() {
251 return errAccess
252 }
253
254 s.engine.clusterLock.RLock()
255 cluster := s.engine.cluster
256 s.engine.clusterLock.RUnlock()
257
258 if cluster == nil {
259 return errors.New("no cluster configuration loaded")
260 }
261
262 cs := cluster.Status
263
264 reply.LastUpdate = cs.LastUpdate
265 reply.Attributes = make([]seesaw.ConfigMetadata, 0, len(cs.Attributes))
266 for _, a := range cs.Attributes {
267 reply.Attributes = append(reply.Attributes, a)
268 }
269 reply.Warnings = make([]string, 0, len(cs.Warnings))
270 for _, warning := range cs.Warnings {
271 reply.Warnings = append(reply.Warnings, warning)
272 }
273 return nil
274}
275
276// ConfigReload requests a configuration reload.
277func (s *SeesawEngine) ConfigReload(ctx *ipc.Context, reply *int) error {

Callers

nothing calls this directly

Calls 2

traceMethod · 0.95
CanReadMethod · 0.80

Tested by

no test coverage detected