common

package
v3.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: EPL-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureCertPool

func ConfigureCertPool(CAFilePath string, CADirPath string)

ConfigureCertPool trusts given certificates CAFilePath is a path to file which contains CA certificates.

Usually it contains Che server self-signed certificate.

CADirPath is a path to directory with CA certificates files.

Usually they contain all the trusted CA in the cluster.

func Connect

func Connect(endpoint string, token string) (*jsonrpc.Tunnel, error)

func ConnectOrFail

func ConnectOrFail(endpoint string, token string) *jsonrpc.Tunnel

Types

type Broker

type Broker interface {
	CloseConsumers()
	Bus() *event.Bus
	PushEvents(tun *jsonrpc.Tunnel, types ...string)
	PubStarted()
	PubFailed(err string)
	PubDone(tooling string)
	PubLog(text string)
	PrintPlan(metas []model.PluginMeta)
	PrintDebug(format string, v ...interface{})
	PrintInfo(format string, v ...interface{})
	PrintInfoBuffer(info []string)
	// It is not convenient in tests with mocks.
	// It should exit current context but when mocked it does not exit.
	// Instead use: PubLog, log.Fatal
	PrintFatal(format string, v ...interface{})
}

Broker holds utilities to interact with Che master to push different events

func NewBroker

func NewBroker() Broker

type BrokerImpl

type BrokerImpl interface {
	Start([]model.PluginMeta)
	PushEvents(tun *jsonrpc.Tunnel)
	ProcessPlugin(meta model.PluginMeta) error
}

BrokerImpl specifies the interface for a Broker implementation that processes plugins of a specific type

type Random

type Random interface {
	// Int returns int from range 0..n
	Int(n int) int

	// IntFromRange returns int from range from..to
	IntFromRange(from int, to int) int

	// String returns string of specified length with random lower-case letters
	String(length int) string
}

Random generates random numbers and strings

func NewRand

func NewRand() Random

type RandomImpl

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

func (*RandomImpl) Int

func (r *RandomImpl) Int(n int) int

func (*RandomImpl) IntFromRange

func (r *RandomImpl) IntFromRange(from int, to int) int

func (*RandomImpl) String

func (r *RandomImpl) String(length int) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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