Documentation ¶
Overview ¶
Package nodestree is a generated GoMock package.
Index ¶
- Constants
- func CheckEffectiveResourceLayout(options CompareOptions, in *nodesTree) error
- func CheckGitHooks(gitType string, events []string) error
- func CheckNumberOfResources(options CompareOptions, in *nodesTree) error
- func CheckResouceReference(options CompareOptions, in *nodesTree) error
- func CheckResourceRepeatName(options CompareOptions, in *nodesTree) error
- func CheckResourceSubdirectory(nodes, node *Node) error
- func GetResourceValue(c interface{}, field, key string) string
- func InContainsDir(str string, fields []string) (isIn bool)
- func IsEmptyParentNode(options CompareOptions, configs []configInfo) (bool, error)
- func IsInSlice(slice []string, s string) (isIn bool)
- func IsResourceExist(options CompareOptions, targetResourceName, resourceKind string) bool
- func NodesToMapping(nodes *Node, mapping map[string]*Node)
- type CompareOptions
- type Config
- type FileOptions
- type MockNodesOperator
- func (m *MockNodesOperator) CheckReference(options CompareOptions, node *Node, k8sClient client.Client) (bool, error)
- func (m *MockNodesOperator) CreateNode(path string, data interface{}) (*Node, error)
- func (m *MockNodesOperator) CreateResource(kind string) interface{}
- func (m *MockNodesOperator) EXPECT() *MockNodesOperatorMockRecorder
- func (m *MockNodesOperator) UpdateNode(node *Node, data interface{}) (*Node, error)
- type MockNodesOperatorMockRecorder
- func (mr *MockNodesOperatorMockRecorder) CheckReference(options, node, k8sClient interface{}) *gomock.Call
- func (mr *MockNodesOperatorMockRecorder) CreateNode(path, data interface{}) *gomock.Call
- func (mr *MockNodesOperatorMockRecorder) CreateResource(kind interface{}) *gomock.Call
- func (mr *MockNodesOperatorMockRecorder) UpdateNode(node, data interface{}) *gomock.Call
- type MockNodesTree
- func (m *MockNodesTree) AppendOperators(operator NodesOperator)
- func (m *MockNodesTree) Compare(options CompareOptions) error
- func (m *MockNodesTree) EXPECT() *MockNodesTreeMockRecorder
- func (m *MockNodesTree) FilterIgnoreByLayout(path string) error
- func (m *MockNodesTree) GetNode(nodes *Node, kind, name string) *Node
- func (m *MockNodesTree) GetNodes() (*Node, error)
- func (m *MockNodesTree) InsertNodes(nodes, resource *Node) (*Node, error)
- func (m *MockNodesTree) Load(path string) (Node, error)
- func (m *MockNodesTree) RemoveNode(nodes, node *Node) (*Node, error)
- type MockNodesTreeMockRecorder
- func (mr *MockNodesTreeMockRecorder) AppendOperators(operator interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) Compare(options interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) FilterIgnoreByLayout(path interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) GetNode(nodes, kind, name interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) GetNodes() *gomock.Call
- func (mr *MockNodesTreeMockRecorder) InsertNodes(nodes, resource interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) Load(path interface{}) *gomock.Call
- func (mr *MockNodesTreeMockRecorder) RemoveNode(nodes, node interface{}) *gomock.Call
- type Node
- type NodeFilterOptions
- type NodeInfo
- type NodesOperator
- type NodesTree
- type Resource
Constants ¶
const ( CRDContentType = iota StringContentType )
const ( Product = "Product" Project = "Project" CodeRepo = "CodeRepo" CodeRepoBinding = "CodeRepoBinding" Cluster = "Cluster" Environment = "Environment" DeploymentRuntime = "DeploymentRuntime" ProjectPipelineRuntime = "ProjectPipelineRuntime" ArtifactRepo = "ArtifactRepo" )
const (
ResourceNameCluster = "clusters"
)
Variables ¶
This section is empty.
Functions ¶
func CheckEffectiveResourceLayout ¶
func CheckEffectiveResourceLayout(options CompareOptions, in *nodesTree) error
IsValidResourceLayout testing the valid of resources
func CheckGitHooks ¶
func CheckNumberOfResources ¶
func CheckNumberOfResources(options CompareOptions, in *nodesTree) error
func CheckResouceReference ¶
func CheckResouceReference(options CompareOptions, in *nodesTree) error
CheckResouceReference Detect resource references
func CheckResourceRepeatName ¶
func CheckResourceRepeatName(options CompareOptions, in *nodesTree) error
IsResourceRepeatName Check whether the resource name is duplicate
func GetResourceValue ¶
func InContainsDir ¶ added in v0.3.0
func IsEmptyParentNode ¶
func IsEmptyParentNode(options CompareOptions, configs []configInfo) (bool, error)
checkReqiredResource check whether the node parent is empty
func IsResourceExist ¶
func IsResourceExist(options CompareOptions, targetResourceName, resourceKind string) bool
func NodesToMapping ¶
Types ¶
type CompareOptions ¶
type Config ¶
type FileOptions ¶
type MockNodesOperator ¶
type MockNodesOperator struct {
// contains filtered or unexported fields
}
MockNodesOperator is a mock of NodesOperator interface.
func NewMockNodesOperator ¶
func NewMockNodesOperator(ctrl *gomock.Controller) *MockNodesOperator
NewMockNodesOperator creates a new mock instance.
func (*MockNodesOperator) CheckReference ¶
func (m *MockNodesOperator) CheckReference(options CompareOptions, node *Node, k8sClient client.Client) (bool, error)
CheckReference mocks base method.
func (*MockNodesOperator) CreateNode ¶
func (m *MockNodesOperator) CreateNode(path string, data interface{}) (*Node, error)
CreateNode mocks base method.
func (*MockNodesOperator) CreateResource ¶
func (m *MockNodesOperator) CreateResource(kind string) interface{}
CreateResource mocks base method.
func (*MockNodesOperator) EXPECT ¶
func (m *MockNodesOperator) EXPECT() *MockNodesOperatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNodesOperator) UpdateNode ¶
func (m *MockNodesOperator) UpdateNode(node *Node, data interface{}) (*Node, error)
UpdateNode mocks base method.
type MockNodesOperatorMockRecorder ¶
type MockNodesOperatorMockRecorder struct {
// contains filtered or unexported fields
}
MockNodesOperatorMockRecorder is the mock recorder for MockNodesOperator.
func (*MockNodesOperatorMockRecorder) CheckReference ¶
func (mr *MockNodesOperatorMockRecorder) CheckReference(options, node, k8sClient interface{}) *gomock.Call
CheckReference indicates an expected call of CheckReference.
func (*MockNodesOperatorMockRecorder) CreateNode ¶
func (mr *MockNodesOperatorMockRecorder) CreateNode(path, data interface{}) *gomock.Call
CreateNode indicates an expected call of CreateNode.
func (*MockNodesOperatorMockRecorder) CreateResource ¶
func (mr *MockNodesOperatorMockRecorder) CreateResource(kind interface{}) *gomock.Call
CreateResource indicates an expected call of CreateResource.
func (*MockNodesOperatorMockRecorder) UpdateNode ¶
func (mr *MockNodesOperatorMockRecorder) UpdateNode(node, data interface{}) *gomock.Call
UpdateNode indicates an expected call of UpdateNode.
type MockNodesTree ¶
type MockNodesTree struct {
// contains filtered or unexported fields
}
MockNodesTree is a mock of NodesTree interface.
func NewMockNodesTree ¶
func NewMockNodesTree(ctrl *gomock.Controller) *MockNodesTree
NewMockNodesTree creates a new mock instance.
func (*MockNodesTree) AppendOperators ¶
func (m *MockNodesTree) AppendOperators(operator NodesOperator)
AppendOperators mocks base method.
func (*MockNodesTree) Compare ¶
func (m *MockNodesTree) Compare(options CompareOptions) error
Compare mocks base method.
func (*MockNodesTree) EXPECT ¶
func (m *MockNodesTree) EXPECT() *MockNodesTreeMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNodesTree) FilterIgnoreByLayout ¶ added in v0.3.0
func (m *MockNodesTree) FilterIgnoreByLayout(path string) error
FilterIgnoreByLayout mocks base method.
func (*MockNodesTree) GetNode ¶
func (m *MockNodesTree) GetNode(nodes *Node, kind, name string) *Node
GetNode mocks base method.
func (*MockNodesTree) GetNodes ¶ added in v0.3.0
func (m *MockNodesTree) GetNodes() (*Node, error)
GetNodes mocks base method.
func (*MockNodesTree) InsertNodes ¶
func (m *MockNodesTree) InsertNodes(nodes, resource *Node) (*Node, error)
InsertNodes mocks base method.
func (*MockNodesTree) Load ¶
func (m *MockNodesTree) Load(path string) (Node, error)
Load mocks base method.
func (*MockNodesTree) RemoveNode ¶
func (m *MockNodesTree) RemoveNode(nodes, node *Node) (*Node, error)
RemoveNode mocks base method.
type MockNodesTreeMockRecorder ¶
type MockNodesTreeMockRecorder struct {
// contains filtered or unexported fields
}
MockNodesTreeMockRecorder is the mock recorder for MockNodesTree.
func (*MockNodesTreeMockRecorder) AppendOperators ¶
func (mr *MockNodesTreeMockRecorder) AppendOperators(operator interface{}) *gomock.Call
AppendOperators indicates an expected call of AppendOperators.
func (*MockNodesTreeMockRecorder) Compare ¶
func (mr *MockNodesTreeMockRecorder) Compare(options interface{}) *gomock.Call
Compare indicates an expected call of Compare.
func (*MockNodesTreeMockRecorder) FilterIgnoreByLayout ¶ added in v0.3.0
func (mr *MockNodesTreeMockRecorder) FilterIgnoreByLayout(path interface{}) *gomock.Call
FilterIgnoreByLayout indicates an expected call of FilterIgnoreByLayout.
func (*MockNodesTreeMockRecorder) GetNode ¶
func (mr *MockNodesTreeMockRecorder) GetNode(nodes, kind, name interface{}) *gomock.Call
GetNode indicates an expected call of GetNode.
func (*MockNodesTreeMockRecorder) GetNodes ¶ added in v0.3.0
func (mr *MockNodesTreeMockRecorder) GetNodes() *gomock.Call
GetNodes indicates an expected call of GetNodes.
func (*MockNodesTreeMockRecorder) InsertNodes ¶
func (mr *MockNodesTreeMockRecorder) InsertNodes(nodes, resource interface{}) *gomock.Call
InsertNodes indicates an expected call of InsertNodes.
func (*MockNodesTreeMockRecorder) Load ¶
func (mr *MockNodesTreeMockRecorder) Load(path interface{}) *gomock.Call
Load indicates an expected call of Load.
func (*MockNodesTreeMockRecorder) RemoveNode ¶
func (mr *MockNodesTreeMockRecorder) RemoveNode(nodes, node interface{}) *gomock.Call
RemoveNode indicates an expected call of RemoveNode.
type Node ¶
type Node struct { Name string Path string Children []*Node IsDir bool Content interface{} Level int Kind string }
func ListsResourceNodes ¶
func ListsResourceNodes(nodes Node, kind string, options ...NodeFilterOptions) (list []*Node)
type NodeFilterOptions ¶ added in v0.3.0
type NodesOperator ¶
type NodesTree ¶
type NodesTree interface { Load(path string) (root Node, err error) AppendOperators(operator NodesOperator) Compare(options CompareOptions) error InsertNodes(nodes, resource *Node) (*Node, error) GetNode(nodes *Node, kind, name string) (node *Node) GetNodes() (*Node, error) RemoveNode(nodes *Node, node *Node) (*Node, error) FilterIgnoreByLayout(path string) error }
func NewNodestree ¶
func NewNodestree(fileOptions *FileOptions, config *Config, client client.Client) NodesTree