serviceKey returns a key for a service in the State. A key is composed of the State's servicePrefix (hashed) and the hash of the service string. This way we can avoid collisions and have a unique key for each service.
(key string)
| 239 | // A key is composed of the State's servicePrefix (hashed) and the hash of the service string. |
| 240 | // This way we can avoid collisions and have a unique key for each service. |
| 241 | func (s *State) serviceKey(key string) string { |
| 242 | // hash the service string to avoid collisions |
| 243 | return s.servicePrefix + hex.EncodeToString([]byte(key)) |
| 244 | } |
| 245 | |
| 246 | // setService sets a service in the State. |
| 247 | func (s *State) setService(srv Service) { |
no outgoing calls