code: func encodeAttr(key string, value interface{}) *internal.Attr {
  	pb := &internal.Attr{Key: key}
  	switch value := value.(type) {
  	case string:
  		pb.Type = attrTypeString
  		pb.StringValue = value
  	case float64:
  		pb.Type = attrTypeFloat
  		pb.FloatValue = value
  	case uint64:
  		pb.Type = attrTypeInt
  		pb.IntValue = int64(value)
  	case int64:
  		pb.Type = attrTypeInt
  		pb.IntValue = value
  	case bool:
  		pb.Type = attrTypeBool
  		pb.BoolValue = value
  	}
  	return pb
  }
docs: // encodeAttr converts a key/value pair into an Attr internal representation.