interfaces

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AntiAffinityGroupRule

type AntiAffinityGroupRule struct {
	GroupPathPrefix string
	AllowNames      []string
	IgnorePaths     []string
}

type AntiAffinityListRule added in v0.3.0

type AntiAffinityListRule struct {
	Label        string
	PathPrefixes []string
}

type CheckImportRequest

type CheckImportRequest struct {
	PackagePath string
	ImportPaths []string
}

type Config

type Config interface {
	ListRulesByPath(*ListRulesByPathRequest) (*ListRulesByPathResponse, error)
}

type ConfigMock

type ConfigMock struct {
	// ListRulesByPathFunc mocks the ListRulesByPath method.
	ListRulesByPathFunc func(listRulesByPathRequest *ListRulesByPathRequest) (*ListRulesByPathResponse, error)
	// contains filtered or unexported fields
}

ConfigMock is a mock implementation of Config.

func TestSomethingThatUsesConfig(t *testing.T) {

	// make and configure a mocked Config
	mockedConfig := &ConfigMock{
		ListRulesByPathFunc: func(listRulesByPathRequest *ListRulesByPathRequest) (*ListRulesByPathResponse, error) {
			panic("mock out the ListRulesByPath method")
		},
	}

	// use mockedConfig in code that requires Config
	// and then make assertions.

}

func (*ConfigMock) ListRulesByPath

func (mock *ConfigMock) ListRulesByPath(listRulesByPathRequest *ListRulesByPathRequest) (*ListRulesByPathResponse, error)

ListRulesByPath calls ListRulesByPathFunc.

func (*ConfigMock) ListRulesByPathCalls

func (mock *ConfigMock) ListRulesByPathCalls() []struct {
	ListRulesByPathRequest *ListRulesByPathRequest
}

ListRulesByPathCalls gets all the calls that were made to ListRulesByPath. Check the length with:

len(mockedConfig.ListRulesByPathCalls())

type ImportChecker

type ImportChecker interface {
	CheckImports(*CheckImportRequest) error
}

type ListRulesByPathRequest

type ListRulesByPathRequest struct {
	PackagePath string
}

type ListRulesByPathResponse

type ListRulesByPathResponse struct {
	AntiAffinityGroupRules []*AntiAffinityGroupRule
	AntiAffinityListRules  []*AntiAffinityListRule
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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