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:
21
cmd/cloudflared/tunnel/subcommand_context_teamnet.go
Normal file
21
cmd/cloudflared/tunnel/subcommand_context_teamnet.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user