2020-07-31 16:27:09 -04:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package dns
|
|
|
|
|
|
|
|
func newManager(mconfig ManagerConfig) managerImpl {
|
|
|
|
switch {
|
2021-04-01 22:54:40 -07:00
|
|
|
case isResolvedActive():
|
2021-04-01 23:04:23 -07:00
|
|
|
return newResolvedManager(mconfig)
|
2020-07-31 16:27:09 -04:00
|
|
|
case isNMActive():
|
2021-04-01 23:04:23 -07:00
|
|
|
return newNMManager(mconfig)
|
2020-07-31 16:27:09 -04:00
|
|
|
case isResolvconfActive():
|
|
|
|
return newResolvconfManager(mconfig)
|
|
|
|
default:
|
|
|
|
return newDirectManager(mconfig)
|
|
|
|
}
|
|
|
|
}
|