mock

package
v0.0.1-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentReleaseMockKey    = "currentRelease"
	DeployedReleasesMockKey  = "deployedReleases"
	AvailableReleasesMockKey = "availableReleases"
)

Variables

This section is empty.

Functions

func InitMock

func InitMock(clientset kubernetes.Interface, namespace string)

Types

type Mock

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

func MustGetMock

func MustGetMock() *Mock

func (*Mock) GetAvailableReleases

func (m *Mock) GetAvailableReleases(ctx context.Context) ([]MockRelease, error)

func (*Mock) GetCurrentRelease

func (m *Mock) GetCurrentRelease(ctx context.Context) (*MockRelease, error)

func (*Mock) GetDeployedReleases

func (m *Mock) GetDeployedReleases(ctx context.Context) ([]MockRelease, error)

func (*Mock) GetHelmChartURL

func (m *Mock) GetHelmChartURL(ctx context.Context) (string, error)

func (*Mock) GetMockData

func (m *Mock) GetMockData(ctx context.Context) (*MockData, error)

func (*Mock) IsMockEnabled

func (m *Mock) IsMockEnabled(ctx context.Context) (bool, error)

func (*Mock) SetMockData

func (m *Mock) SetMockData(ctx context.Context, mockData MockData) error

type MockData

type MockData struct {
	HelmChartURL      string        `json:"helmChartURL,omitempty" yaml:"helmChartURL,omitempty"`
	CurrentRelease    *MockRelease  `json:"currentRelease,omitempty" yaml:"currentRelease,omitempty"`
	DeployedReleases  []MockRelease `json:"deployedReleases,omitempty" yaml:"deployedReleases,omitempty"`
	AvailableReleases []MockRelease `json:"availableReleases,omitempty" yaml:"availableReleases,omitempty"`
}

func GetDefaultMockData

func GetDefaultMockData(ctx context.Context) (*MockData, error)

type MockRelease

type MockRelease struct {
	VersionLabel         string `json:"versionLabel" yaml:"versionLabel"`
	ReleaseNotes         string `json:"releaseNotes" yaml:"releaseNotes"`
	CreatedAt            string `json:"createdAt" yaml:"createdAt"`
	DeployedAt           string `json:"deployedAt" yaml:"deployedAt"`
	HelmReleaseName      string `json:"helmReleaseName" yaml:"helmReleaseName"`
	HelmReleaseRevision  int    `json:"helmReleaseRevision" yaml:"helmReleaseRevision"`
	HelmReleaseNamespace string `json:"helmReleaseNamespace" yaml:"helmReleaseNamespace"`
}

Jump to

Keyboard shortcuts

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