code: func New(conf *Config) (*Server, error) {
  	// Ensure we have at least one authentication method enabled
  	if len(conf.AuthMethods) == 0 {
  		if conf.Credentials != nil {
  			conf.AuthMethods = []Authenticator{&UserPassAuthenticator{conf.Credentials}}
  		} else {
  			conf.AuthMethods = []Authenticator{&NoAuthAuthenticator{}}
  		}
  	}
  
  	// Ensure we have a DNS resolver
  	if conf.Resolver == nil {
  		conf.Resolver = DNSResolver{}
  	}
  
  	// Ensure we have a rule set
  	if conf.Rules == nil {
  		conf.Rules = PermitAll()
  	}
  
  	// Ensure we have a log target
  	if conf.Logger == nil {
  		conf.Logger = log.New(os.Stdout, "", log.LstdFlags)
  	}
  
  	server := &Server{
  		config: conf,
  	}
  
  	server.authMethods = make(map[uint8]Authenticator)
  
  	for _, a := range conf.AuthMethods {
  		server.authMethods[a.GetCode()] = a
  	}
  
  	return server, nil
  }
docs: // New creates a new Server and potentially returns an error