Documentation ¶
Index ¶
- Variables
- func CreateLogFile(dir string, name string) (io.Writer, error)
- func DieOnError(err error, msg string)
- func GenerateID() string
- func GetEnvOrDefault(name string, def string) string
- func GetEnvOrDie(name string, errMsg string) string
- type BuildKubeClientOptions
- type Command
- type FileCreator
- type GRPC
- type Kubernetes
- func (_k *Kubernetes) BuildClient(opt BuildKubeClientOptions) (*kubernetes.Clientset, error)
- func (_k *Kubernetes) BuildClientWithToken(host string, ca string, token string) (*kubernetes.Clientset, error)
- func (_k *Kubernetes) BuildPodDefinition(namespace string, name string, version string, id string, port string, ...) (*v1.Pod, error)
- func (_k Kubernetes) BuildServiceDefinition(namespace string, name string, id string, port string, serviceType string) (*v1.Service, error)
- func (_k Kubernetes) CreatePod(client *kubernetes.Clientset, def *v1.Pod) (*v1.Pod, error)
- func (_k Kubernetes) CreateService(client *kubernetes.Clientset, def *v1.Service) (*v1.Service, error)
- func (_k Kubernetes) KillPod(client *kubernetes.Clientset, namespace string, name string) error
- func (_k Kubernetes) KillService(client *kubernetes.Clientset, namespace string, name string) error
- func (_k Kubernetes) WaitForPod(client *kubernetes.Clientset, pod *v1.Pod, phase string) error
- type Port
- type Proto
Constants ¶
This section is empty.
Variables ¶
var TimeNow = func() time.Time { return time.Now() }
TimeNow returns the current time
Functions ¶
func CreateLogFile ¶
CreateLogFile creates file to be used as logger
func DieOnError ¶ added in v0.76.0
func GetEnvOrDefault ¶ added in v0.76.0
func GetEnvOrDie ¶ added in v0.77.0
Types ¶
type BuildKubeClientOptions ¶
BuildKubeClientOptions options to constract Kubernetes client
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command runs command in as subprocess
func (*Command) AddCommand ¶
AddCommand adds command argument to the command
type GRPC ¶
type GRPC struct{}
GRPC expose abilities on grpc connection
func (GRPC) Dial ¶
func (_g GRPC) Dial(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
Dial returns a connection grpc server
type Kubernetes ¶
type Kubernetes struct{}
Kubernetes expose abilities on run on kube cluster
func (*Kubernetes) BuildClient ¶
func (_k *Kubernetes) BuildClient(opt BuildKubeClientOptions) (*kubernetes.Clientset, error)
BuildClient returns a kubernetes client based on path to kubeconfig
func (*Kubernetes) BuildClientWithToken ¶
func (_k *Kubernetes) BuildClientWithToken(host string, ca string, token string) (*kubernetes.Clientset, error)
BuildClientWithToken returns a kubernetes client based on path to kubeconfig
func (*Kubernetes) BuildPodDefinition ¶
func (_k *Kubernetes) BuildPodDefinition(namespace string, name string, version string, id string, port string, volume string, volumeClaimName string, volumeMoutnPath string) (*v1.Pod, error)
BuildPodDefinition returns pod definition from arguments
func (Kubernetes) BuildServiceDefinition ¶
func (_k Kubernetes) BuildServiceDefinition(namespace string, name string, id string, port string, serviceType string) (*v1.Service, error)
BuildServiceDefinition returns service definition from argument
func (Kubernetes) CreatePod ¶
func (_k Kubernetes) CreatePod(client *kubernetes.Clientset, def *v1.Pod) (*v1.Pod, error)
CreatePod applies a pod definitions on given client
func (Kubernetes) CreateService ¶
func (_k Kubernetes) CreateService(client *kubernetes.Clientset, def *v1.Service) (*v1.Service, error)
CreateService applies a pod definitions on given client
func (Kubernetes) KillPod ¶
func (_k Kubernetes) KillPod(client *kubernetes.Clientset, namespace string, name string) error
KillPod deletes kubernetes service
func (Kubernetes) KillService ¶
func (_k Kubernetes) KillService(client *kubernetes.Clientset, namespace string, name string) error
KillService deletes kubernetes service
func (Kubernetes) WaitForPod ¶
func (_k Kubernetes) WaitForPod(client *kubernetes.Clientset, pod *v1.Pod, phase string) error
WaitForPod waits til pod reaches given phase
type Port ¶
type Port struct{}
Port expose ability to generate random available port on local machine
func (Port) GetAvailable ¶
GetAvailable returns available port on local machine
type Proto ¶
type Proto struct{}
Proto expose abilities to create new service client
func (Proto) New ¶
func (_p Proto) New(cc *grpc.ClientConn) v1.ServiceClient
New creates new service for given connection