mode.mx raw

   1  // Package mode provides a domain-local ACL mode indicator readable by
   2  // packages that need to know the current access control mode without
   3  // circular dependencies.
   4  package mode
   5  
   6  // ACLMode holds the current ACL mode. Plain variable — single
   7  // cooperative thread per domain, no atomic needed.
   8  var ACLMode []byte
   9  
  10  // IsOpen returns true if the ACL mode is "none" (open relay mode).
  11  func IsOpen() bool {
  12  	return len(ACLMode) == 4 &&
  13  		ACLMode[0] == 'n' && ACLMode[1] == 'o' &&
  14  		ACLMode[2] == 'n' && ACLMode[3] == 'e'
  15  }
  16