const.go 541 B

1234567891011121314151617181920
  1. package mhayaNatsCluster
  2. import (
  3. "fmt"
  4. )
  5. const (
  6. remoteSubjectFormat = "mhaya.%s.remote.%s.%s" // nodeType.nodeId
  7. localSubjectFormat = "mhaya.%s.local.%s.%s" // nodeType.nodeId
  8. )
  9. // getLocalSubject local message nats chan
  10. func getLocalSubject(prefix, nodeType, nodeId string) string {
  11. return fmt.Sprintf(localSubjectFormat, prefix, nodeType, nodeId)
  12. }
  13. // getRemoteSubject remote message nats chan
  14. func getRemoteSubject(prefix, nodeType, nodeId string) string {
  15. return fmt.Sprintf(remoteSubjectFormat, prefix, nodeType, nodeId)
  16. }