links

package
v0.47.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLinks(links map[string]string, linkName string) (string, error)
func GetEnvironmentLinks(provider Provider, cat *catalog.Catalog, envName string) (map[string]string, error)

func GetOrSelectLinkUrl

func GetOrSelectLinkUrl(links map[string]string, linkName string) (string, error)
func GetProjectLinks(provider Provider, cat *catalog.Catalog, projectName string) (map[string]string, error)
func GetReleaseLinks(provider Provider, cat *catalog.Catalog, envName, releaseName string) (map[string]string, error)

Types

type Provider

type Provider interface {
	GetEnvironmentLinks(environment *v1alpha1.Environment) (map[string]string, error)
	GetProjectLinks(project *v1alpha1.Project) (map[string]string, error)
	GetReleaseLinks(release *v1alpha1.Release) (map[string]string, error)
}

func NewProvider

func NewProvider(infoProvider info.Provider, templates config.Templates) Provider

type ProviderMock added in v0.45.1

type ProviderMock struct {
	// GetEnvironmentLinksFunc mocks the GetEnvironmentLinks method.
	GetEnvironmentLinksFunc func(environment *v1alpha1.Environment) (map[string]string, error)

	// GetProjectLinksFunc mocks the GetProjectLinks method.
	GetProjectLinksFunc func(project *v1alpha1.Project) (map[string]string, error)

	// GetReleaseLinksFunc mocks the GetReleaseLinks method.
	GetReleaseLinksFunc func(release *v1alpha1.Release) (map[string]string, error)
	// contains filtered or unexported fields
}

ProviderMock is a mock implementation of Provider.

func TestSomethingThatUsesProvider(t *testing.T) {

	// make and configure a mocked Provider
	mockedProvider := &ProviderMock{
		GetEnvironmentLinksFunc: func(environment *v1alpha1.Environment) (map[string]string, error) {
			panic("mock out the GetEnvironmentLinks method")
		},
		GetProjectLinksFunc: func(project *v1alpha1.Project) (map[string]string, error) {
			panic("mock out the GetProjectLinks method")
		},
		GetReleaseLinksFunc: func(release *v1alpha1.Release) (map[string]string, error) {
			panic("mock out the GetReleaseLinks method")
		},
	}

	// use mockedProvider in code that requires Provider
	// and then make assertions.

}
func (mock *ProviderMock) GetEnvironmentLinks(environment *v1alpha1.Environment) (map[string]string, error)

GetEnvironmentLinks calls GetEnvironmentLinksFunc.

func (*ProviderMock) GetEnvironmentLinksCalls added in v0.45.1

func (mock *ProviderMock) GetEnvironmentLinksCalls() []struct {
	Environment *v1alpha1.Environment
}

GetEnvironmentLinksCalls gets all the calls that were made to GetEnvironmentLinks. Check the length with:

len(mockedProvider.GetEnvironmentLinksCalls())
func (mock *ProviderMock) GetProjectLinks(project *v1alpha1.Project) (map[string]string, error)

GetProjectLinks calls GetProjectLinksFunc.

func (*ProviderMock) GetProjectLinksCalls added in v0.45.1

func (mock *ProviderMock) GetProjectLinksCalls() []struct {
	Project *v1alpha1.Project
}

GetProjectLinksCalls gets all the calls that were made to GetProjectLinks. Check the length with:

len(mockedProvider.GetProjectLinksCalls())
func (mock *ProviderMock) GetReleaseLinks(release *v1alpha1.Release) (map[string]string, error)

GetReleaseLinks calls GetReleaseLinksFunc.

func (*ProviderMock) GetReleaseLinksCalls added in v0.45.1

func (mock *ProviderMock) GetReleaseLinksCalls() []struct {
	Release *v1alpha1.Release
}

GetReleaseLinksCalls gets all the calls that were made to GetReleaseLinks. Check the length with:

len(mockedProvider.GetReleaseLinksCalls())

Jump to

Keyboard shortcuts

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