// EnvUint32 generates an uint32 id from envirment variables
// SERVER_ID: unique numeric value represents this server
// PROCESS_ID: unique numeric value represents this process.
EnvUint32 generates an uint32 id from envirment variables
SERVER_ID: unique numeric value represents this server
PROCESS_ID: unique numeric value represents this process.
// EnvUint32 generates an uint32 id from envirment variables // SERVER_ID : unique numeric value represents this server // PROCESS_ID : unique numeric value represents this process .
func EnvUint32(c *Uint32Config) (uint32, error) {
	serverIDText := os.Getenv(serverIDKey)
	serverID, err := strconv.ParseUint(serverIDText, 10, 32)
	if err != nil {
		return 0, fmt.Errorf("parsing serverID from env("+serverIDKey+") -> %v", err)
	}
	if serverID == 0 {
		return 0, fmt.Errorf("serverID cannot be less than one, current value: %d", serverID)
	}
	processIDText := os.Getenv(processIDKey)
	processID, err := strconv.ParseUint(processIDText, 10, 32)
	if err != nil {
		return 0, fmt.Errorf("parsing processID from env("+processIDKey+") -> %v", err)
	}
	return Uint32(uint32(serverID), uint32(processID), c), nil
}
func EnvUint32 ( c * Uint32Config ) ( uint32 , error ) { serverIDText := os . Getenv ( serverIDKey ) serverID , err := strconv . ParseUint ( serverIDText , 10 , 32 ) if err != nil { return 0 , fmt . Errorf ( " " + serverIDKey + " " , err ) } if serverID == 0 { return 0 , fmt . Errorf ( " " , serverID ) } processIDText := os . Getenv ( processIDKey ) processID , err := strconv . ParseUint ( processIDText , 10 , 32 ) if err != nil { return 0 , fmt . Errorf ( " " + processIDKey + " " , err ) } return Uint32 ( uint32 ( serverID ) , uint32 ( processID ) , c ) , nil }
EnvUint32 generates an uint32 id from envirment variables
SERVER_ID: unique numeric value represents this server
PROCESS_ID: unique numeric value represents this process.
EnvUint32 generates an uint32 id from envirment variables SERVER_ID : unique numeric value represents this server PROCESS_ID : unique numeric value represents this process .
// server ID // process ID