defclient

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefinitionClient

type DefinitionClient interface {
	GetWorkloadDefinition(name string) (*v1alpha2.WorkloadDefinition, error)
	GetTraitDefition(name string) (*v1alpha2.TraitDefinition, error)
}

DefinitionClient is a interface

type Factory

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

Factory can get wd|td|app

func NewDefinitionClient

func NewDefinitionClient(cli client.Client) *Factory

NewDefinitionClient generate definition fetcher

func (*Factory) GetTraitDefition

func (f *Factory) GetTraitDefition(name string) (*v1alpha2.TraitDefinition, error)

GetTraitDefition Get TraitDefition

func (*Factory) GetWorkloadDefinition

func (f *Factory) GetWorkloadDefinition(name string) (*v1alpha2.WorkloadDefinition, error)

GetWorkloadDefinition Get WorkloadDefinition

type MockClient

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

MockClient simulate the behavior of client

func (*MockClient) AddTD

func (mock *MockClient) AddTD(s string) error

AddTD add triat definition to Mock Manager

func (*MockClient) AddWD

func (mock *MockClient) AddWD(s string) error

AddWD add workload definition to Mock Manager

func (*MockClient) GetTraitDefition

func (mock *MockClient) GetTraitDefition(name string) (*v1alpha2.TraitDefinition, error)

GetTraitDefition Get TraitDefition

func (*MockClient) GetWorkloadDefinition

func (mock *MockClient) GetWorkloadDefinition(name string) (*v1alpha2.WorkloadDefinition, error)

GetWorkloadDefinition Get WorkloadDefinition

Jump to

Keyboard shortcuts

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