Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
define kubernetes package
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Jan 19, 2019
1 parent 94a4f0e commit 6680777
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/kubernetes/api/contract.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package api
20 changes: 20 additions & 0 deletions internal/kubernetes/api/provider.go
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")
}
1 change: 1 addition & 0 deletions internal/kubernetes/cli/contract.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package cli
20 changes: 20 additions & 0 deletions internal/kubernetes/cli/provider.go
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")
}
22 changes: 22 additions & 0 deletions internal/kubernetes/interface.go
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)
}

0 comments on commit 6680777

Please sign in to comment.