mock

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnvironment

func NewEnvironment() *cli.Environment

NewEnvironment returns an environment which acts as a "black hole".

func NewTestServer

func NewTestServer(cluster Cluster) *httptest.Server

NewTestServer creates a new HTTP test server based on a Cluster.

Types

type Cluster

type Cluster struct {
	Version        string
	LoginProviders login.Providers
	AuthChallenge  string
	Links          []*linker.Link
}

Cluster is the mock definition for a DC/OS cluster.

type Context

type Context struct {
	*cli.Context
	// contains filtered or unexported fields
}

Context is an api.Context which can be mocked.

func NewContext

func NewContext(environment *cli.Environment) *Context

NewContext returns a new mock context.

func (*Context) Cluster

func (ctx *Context) Cluster() (*config.Cluster, error)

Cluster returns the current cluster.

func (*Context) Clusters

func (ctx *Context) Clusters() ([]*config.Cluster, error)

Clusters returns the configured clusters.

func (*Context) Logger

func (ctx *Context) Logger() *logrus.Logger

Logger returns the logger.

func (*Context) LoggerHook

func (ctx *Context) LoggerHook() *logrustest.Hook

LoggerHook returns the logger hook.

func (*Context) SetCluster

func (ctx *Context) SetCluster(cluster *config.Cluster)

SetCluster sets the current CLI cluster.

func (*Context) SetClusters

func (ctx *Context) SetClusters(clusters []*config.Cluster)

SetClusters sets the CLI clusters.

Jump to

Keyboard shortcuts

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