2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-02-05 22:16:58 +00:00
|
|
|
|
2020-04-30 20:20:09 +00:00
|
|
|
package router
|
2020-02-05 22:16:58 +00:00
|
|
|
|
|
|
|
import (
|
2020-02-15 03:23:16 +00:00
|
|
|
"tailscale.com/types/logger"
|
2020-02-05 22:16:58 +00:00
|
|
|
)
|
|
|
|
|
2021-03-27 04:47:28 +00:00
|
|
|
// NewFake returns a Router that does nothing when called and always
|
|
|
|
// returns nil errors.
|
|
|
|
func NewFake(logf logger.Logf) Router {
|
|
|
|
return fakeRouter{logf: logf}
|
2020-02-05 22:16:58 +00:00
|
|
|
}
|
|
|
|
|
2020-02-14 23:03:25 +00:00
|
|
|
type fakeRouter struct {
|
|
|
|
logf logger.Logf
|
2020-02-05 22:16:58 +00:00
|
|
|
}
|
|
|
|
|
2020-02-14 23:03:25 +00:00
|
|
|
func (r fakeRouter) Up() error {
|
2020-12-21 18:58:06 +00:00
|
|
|
r.logf("[v1] warning: fakeRouter.Up: not implemented.")
|
2020-02-05 22:16:58 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-05-12 07:08:52 +00:00
|
|
|
func (r fakeRouter) Set(cfg *Config) error {
|
2020-12-21 18:58:06 +00:00
|
|
|
r.logf("[v1] warning: fakeRouter.Set: not implemented.")
|
2020-02-05 22:16:58 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-02-14 23:03:25 +00:00
|
|
|
func (r fakeRouter) Close() error {
|
2020-12-21 18:58:06 +00:00
|
|
|
r.logf("[v1] warning: fakeRouter.Close: not implemented.")
|
2020-02-11 23:21:24 +00:00
|
|
|
return nil
|
2020-02-05 22:16:58 +00:00
|
|
|
}
|