This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package api | ||
|
||
import "github.com/kamilsk/forward/internal/kubernetes" | ||
|
||
// New returns new instance of Kubernetes provider above API. | ||
func New() *provider { | ||
return &provider{} | ||
} | ||
|
||
type provider struct{} | ||
|
||
// Find tries to find pods suitable by the pattern. | ||
func (*provider) Find(string) []kubernetes.Pod { | ||
panic("implement me") | ||
} | ||
|
||
// Forward initiates the port forwarding process. | ||
func (*provider) Forward(kubernetes.Pod, kubernetes.Mapping) { | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cli | ||
|
||
import "github.com/kamilsk/forward/internal/kubernetes" | ||
|
||
// New returns new instance of Kubernetes provider above CLI. | ||
func New() *provider { | ||
return &provider{} | ||
} | ||
|
||
type provider struct{} | ||
|
||
// Find tries to find pods suitable by the pattern. | ||
func (*provider) Find(string) []kubernetes.Pod { | ||
panic("implement me") | ||
} | ||
|
||
// Forward initiates the port forwarding process. | ||
func (*provider) Forward(kubernetes.Pod, kubernetes.Mapping) { | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package kubernetes | ||
|
||
type ( | ||
// Port is a type for port number. | ||
Port int16 | ||
// Local specifies local ports. | ||
Local Port | ||
// Remote specifies remote ports. | ||
Remote Port | ||
// Pod specifies a fully-qualified pod name. | ||
Pod string | ||
// Mapping specifies port forwarding rules. | ||
Mapping map[Local]Remote | ||
) | ||
|
||
// Interface defines a top-level behavior of Kubernetes provider (API or CLI). | ||
type Interface interface { | ||
// Find tries to find pods suitable by the pattern. | ||
Find(string) []Pod | ||
// Forward initiates the port forwarding process. | ||
Forward(Pod, Mapping) | ||
} |