Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AntiAffinityGroupRule ¶
type AntiAffinityGroupRule struct {
// contains filtered or unexported fields
}
AntiAffinityGroupRule defines import path anti-affinity group of a package. Rule `foo/bar` means any package inside it cannot import any other packages except itself. (ex: `foo/bar/baz/*` cannot import `foo/bar/quux/*` and can only import `foo/bar/baz/*`)
func NewAntiAffinityGroupRule ¶
func NewAntiAffinityGroupRule(self Path, group PathPrefix, allowNames []Name) (*AntiAffinityGroupRule, error)
func (*AntiAffinityGroupRule) Check ¶
func (r *AntiAffinityGroupRule) Check(path Path) *Violation
type AntiAffinityListRule ¶ added in v0.3.0
type AntiAffinityListRule struct {
// contains filtered or unexported fields
}
AntiAffinityListRule defines import path anti-affinity list of a package. any packages inside a path prefix cannot be imported. (ex: when prefix `foo/bar` and `baz` are defined, `foo/bar/*` and `baz/*` cannot be imported)
func NewAntiAffinityListRule ¶ added in v0.3.0
func NewAntiAffinityListRule(self Path, prefixes []PathPrefix, label RuleLabel) (*AntiAffinityListRule, error)
func (*AntiAffinityListRule) Check ¶ added in v0.3.0
func (r *AntiAffinityListRule) Check(path Path) *Violation
type AntiAffinityRule ¶
type AntiAffinityRuleRepository ¶
type AntiAffinityRuleRepository interface {
ListByPath(Path) ([]AntiAffinityRule, error)
}
AntiAffinityRuleRepository provides AntiAffinityRule as a query
type AntiAffinityRuleRepositoryMock ¶
type AntiAffinityRuleRepositoryMock struct { // ListByPathFunc mocks the ListByPath method. ListByPathFunc func(path Path) ([]AntiAffinityRule, error) // contains filtered or unexported fields }
AntiAffinityRuleRepositoryMock is a mock implementation of AntiAffinityRuleRepository.
func TestSomethingThatUsesAntiAffinityRuleRepository(t *testing.T) { // make and configure a mocked AntiAffinityRuleRepository mockedAntiAffinityRuleRepository := &AntiAffinityRuleRepositoryMock{ ListByPathFunc: func(path Path) ([]AntiAffinityRule, error) { panic("mock out the ListByPath method") }, } // use mockedAntiAffinityRuleRepository in code that requires AntiAffinityRuleRepository // and then make assertions. }
func (*AntiAffinityRuleRepositoryMock) ListByPath ¶
func (mock *AntiAffinityRuleRepositoryMock) ListByPath(path Path) ([]AntiAffinityRule, error)
ListByPath calls ListByPathFunc.
func (*AntiAffinityRuleRepositoryMock) ListByPathCalls ¶
func (mock *AntiAffinityRuleRepositoryMock) ListByPathCalls() []struct { Path Path }
ListByPathCalls gets all the calls that were made to ListByPath. Check the length with:
len(mockedAntiAffinityRuleRepository.ListByPathCalls())
type PathPrefix ¶
type PathPrefix string
func (PathPrefix) Contains ¶ added in v0.3.0
func (p PathPrefix) Contains(path Path) bool