1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-09 04:30:31 +08:00

TUN-3669: Teamnet commands to add/show Teamnet routes.

This commit is contained in:
Adam Chalmers
2020-12-21 20:06:46 -06:00
parent 2ea491b1d0
commit 94c639d225
8 changed files with 528 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
package tunnel
import (
"github.com/cloudflare/cloudflared/teamnet"
)
func (sc *subcommandContext) listRoutes(filter *teamnet.Filter) ([]*teamnet.Route, error) {
client, err := sc.client()
if err != nil {
return nil, err
}
return client.ListRoutes(filter)
}
func (sc *subcommandContext) addRoute(newRoute teamnet.NewRoute) (teamnet.Route, error) {
client, err := sc.client()
if err != nil {
return teamnet.Route{}, err
}
return client.AddRoute(newRoute)
}