func (t *Timeout) UnmarshalJSON(b []byte) error {
	var (
		timeout time.Duration
		str     string
		err     error
	)
	if err = json.Unmarshal(b, &str); err != nil {
		return errors.New(`Error interpreting timeout as string`)
	}
	if timeout, err = time.ParseDuration(str); err != nil {
		return errors.New(`Error interpreting timeout as duration`)
	}
	converted := Timeout(timeout)
	t = &converted
	return nil
}
UnmarshalJSON converts a time string into a time.Duration
package config
import (
	"encoding/json"
	"errors"
	"os"
	"time"
	log "github.com/Sirupsen/logrus"
)
type Timeout time.Duration