utils

package
v0.65.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeNow = func() time.Time { return time.Now() }

TimeNow returns the current time

Functions

func CreateLogFile

func CreateLogFile(dir string, name string) (io.Writer, error)

func GenerateID added in v0.39.0

func GenerateID() string

Types

type BuildKubeClientOptions added in v0.44.0

type BuildKubeClientOptions struct {
	KubeconfigPath string
	Host           string
	B64CRT         string
	Token          string
}

type Command added in v0.19.0

type Command struct {
	// contains filtered or unexported fields
}

func (*Command) AddCommand added in v0.53.0

func (_c *Command) AddCommand(cmd string)

func (*Command) AddEnv added in v0.53.0

func (_c *Command) AddEnv(key string, value string)

func (*Command) Bin added in v0.53.0

func (_c *Command) Bin(path string)

func (*Command) Create added in v0.19.0

func (_c *Command) Create() *exec.Cmd

Create builds exec.Cmd

type FileCreator

type FileCreator struct{}

FileCreator expose ability to operate on fs

func (*FileCreator) Create

func (_f *FileCreator) Create(dir string, name string) (io.Writer, error)

Create creates file in directory with mode = os.ModePerm

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 added in v0.20.0

type Kubernetes struct{}

Kubernetes expose abilities on run on kube cluster

func (*Kubernetes) BuildClient added in v0.20.0

func (_k *Kubernetes) BuildClient(opt BuildKubeClientOptions) (*kubernetes.Clientset, error)

BuildClient returns a kubernetes client based on path to kubeconfig

func (*Kubernetes) BuildClientWithToken added in v0.35.0

func (_k *Kubernetes) BuildClientWithToken(host string, ca string, token string) (*kubernetes.Clientset, error)

BuildClient returns a kubernetes client based on path to kubeconfig

func (*Kubernetes) BuildPodDefinition added in v0.20.0

func (_k *Kubernetes) BuildPodDefinition(namespace string, name string, version string, id string, port string, volume string, volumeClaimName string, volumeMoutnPath string) (*v1.Pod, error)

func (Kubernetes) BuildServiceDefinition added in v0.20.0

func (_k Kubernetes) BuildServiceDefinition(namespace string, name string, id string, port string, serviceType string) (*v1.Service, error)

func (Kubernetes) CreatePod added in v0.20.0

func (_k Kubernetes) CreatePod(client *kubernetes.Clientset, def *v1.Pod) (*v1.Pod, error)

CreatePod applies a pod definitions on given client

func (Kubernetes) CreateService added in v0.20.0

func (_k Kubernetes) CreateService(client *kubernetes.Clientset, def *v1.Service) (*v1.Service, error)

CreateService applies a pod definitions on given client

func (Kubernetes) KillPod added in v0.20.0

func (_k Kubernetes) KillPod(client *kubernetes.Clientset, namespace string, name string) error

KillPod deletes kubernetes service

func (Kubernetes) KillService added in v0.20.0

func (_k Kubernetes) KillService(client *kubernetes.Clientset, namespace string, name string) error

KillService deletes kubernetes service

func (Kubernetes) WaitForPod added in v0.20.0

func (_k Kubernetes) WaitForPod(client *kubernetes.Clientset, pod *v1.Pod, phase string) error

WaitForPod waits til pod reaches given phase

type Port added in v0.19.0

type Port struct{}

Port expose ability to generate random available port on local machine

func (Port) GetAvailable added in v0.19.0

func (_p Port) GetAvailable() (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL