Explorar el Código

Add docs for ConsumerConfig#Validate.

Willem van Bergen hace 11 años
padre
commit
9d9be45ad0
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      consumer.go

+ 4 - 0
consumer.go

@@ -320,6 +320,10 @@ func (c *Consumer) getOffset(where OffsetTime, retry bool) (int64, error) {
 	return -1, block.Err
 	return -1, block.Err
 }
 }
 
 
+// Valides a ConsumerConfig instance. This will change zero
+// values into sensible defaults if possible, and it will return a
+// ConfigurationError if the specified value doesn't make sense and
+// cannot be corrected.
 func (config *ConsumerConfig) Validate() error {
 func (config *ConsumerConfig) Validate() error {
 	if config.DefaultFetchSize < 0 {
 	if config.DefaultFetchSize < 0 {
 		return ConfigurationError("Invalid DefaultFetchSize")
 		return ConfigurationError("Invalid DefaultFetchSize")