MCPcopy
hub / github.com/gofiber/fiber / ServicesLen

Method ServicesLen

state.go:292–302  ·  view source on GitHub ↗

ServicesLen returns the number of keys for services in the State.

()

Source from the content-addressed store, hash-verified

290
291// ServicesLen returns the number of keys for services in the State.
292func (s *State) ServicesLen() int {
293 length := 0
294 s.dependencies.Range(func(key, _ any) bool {
295 if str, ok := key.(string); ok && strings.HasPrefix(str, s.servicePrefix) {
296 length++
297 }
298 return true
299 })
300
301 return length
302}
303
304// GetService returns a service present in the application's State.
305func GetService[T Service](s *State, key string) (T, bool) {

Callers 5

Test_StartServicesFunction · 0.80
Test_ShutdownServicesFunction · 0.80
TestState_ServiceFunction · 0.80
shutdownServicesMethod · 0.80
logServicesMethod · 0.80

Calls 1

RangeMethod · 0.65

Tested by 3

Test_StartServicesFunction · 0.64
Test_ShutdownServicesFunction · 0.64
TestState_ServiceFunction · 0.64