Documentation ¶
Overview ¶
Package core is a generated GoMock package.
Index ¶
- func NewDefaultStack(stackID StackID) *defaultStack
- type FakeResource
- type FakeResourceSpec
- type FakeResourceStatus
- type LiteralStringToken
- type MockStack
- func (m *MockStack) AddDependency(dependee, depender Resource) error
- func (m *MockStack) AddResource(res Resource) error
- func (m *MockStack) EXPECT() *MockStackMockRecorder
- func (m *MockStack) ListResources(pResourceSlice interface{}) error
- func (m *MockStack) StackID() StackID
- func (m *MockStack) TopologicalTraversal(visitor ResourceVisitor) error
- type MockStackMockRecorder
- func (mr *MockStackMockRecorder) AddDependency(dependee, depender interface{}) *gomock.Call
- func (mr *MockStackMockRecorder) AddResource(res interface{}) *gomock.Call
- func (mr *MockStackMockRecorder) ListResources(pResourceSlice interface{}) *gomock.Call
- func (mr *MockStackMockRecorder) StackID() *gomock.Call
- func (mr *MockStackMockRecorder) TopologicalTraversal(visitor interface{}) *gomock.Call
- type Resource
- type ResourceFieldStringToken
- type ResourceMeta
- type ResourceVisitor
- type Stack
- type StackID
- type StringToken
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultStack ¶
func NewDefaultStack(stackID StackID) *defaultStack
NewDefaultStack constructs new stack.
Types ¶
type FakeResource ¶
type FakeResource struct { ResourceMeta `json:"-"` Spec FakeResourceSpec `json:"spec"` Status *FakeResourceStatus `json:"status,omitempty"` }
func NewFakeResource ¶
func NewFakeResource(stack Stack, resType string, id string, spec FakeResourceSpec, status *FakeResourceStatus) *FakeResource
func (*FakeResource) FieldB ¶
func (r *FakeResource) FieldB() StringToken
type FakeResourceSpec ¶
type FakeResourceSpec struct {
FieldA []StringToken `json:"fieldA"`
}
type FakeResourceStatus ¶
type FakeResourceStatus struct {
FieldB string `json:"fieldB"`
}
type LiteralStringToken ¶
type LiteralStringToken string
LiteralStringToken represents a literal string value.
func (LiteralStringToken) Dependencies ¶
func (t LiteralStringToken) Dependencies() []Resource
type MockStack ¶
type MockStack struct {
// contains filtered or unexported fields
}
MockStack is a mock of Stack interface.
func NewMockStack ¶
func NewMockStack(ctrl *gomock.Controller) *MockStack
NewMockStack creates a new mock instance.
func (*MockStack) AddDependency ¶
AddDependency mocks base method.
func (*MockStack) AddResource ¶
AddResource mocks base method.
func (*MockStack) EXPECT ¶
func (m *MockStack) EXPECT() *MockStackMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStack) ListResources ¶
ListResources mocks base method.
func (*MockStack) TopologicalTraversal ¶
func (m *MockStack) TopologicalTraversal(visitor ResourceVisitor) error
TopologicalTraversal mocks base method.
type MockStackMockRecorder ¶
type MockStackMockRecorder struct {
// contains filtered or unexported fields
}
MockStackMockRecorder is the mock recorder for MockStack.
func (*MockStackMockRecorder) AddDependency ¶
func (mr *MockStackMockRecorder) AddDependency(dependee, depender interface{}) *gomock.Call
AddDependency indicates an expected call of AddDependency.
func (*MockStackMockRecorder) AddResource ¶
func (mr *MockStackMockRecorder) AddResource(res interface{}) *gomock.Call
AddResource indicates an expected call of AddResource.
func (*MockStackMockRecorder) ListResources ¶
func (mr *MockStackMockRecorder) ListResources(pResourceSlice interface{}) *gomock.Call
ListResources indicates an expected call of ListResources.
func (*MockStackMockRecorder) StackID ¶
func (mr *MockStackMockRecorder) StackID() *gomock.Call
StackID indicates an expected call of StackID.
func (*MockStackMockRecorder) TopologicalTraversal ¶
func (mr *MockStackMockRecorder) TopologicalTraversal(visitor interface{}) *gomock.Call
TopologicalTraversal indicates an expected call of TopologicalTraversal.
type Resource ¶
type Resource interface { // resource's stack. Stack() Stack // resource's Type. Type() string // resource's ID within stack. ID() string }
Resource represents a deployment unit.
type ResourceFieldStringToken ¶
type ResourceFieldStringToken struct {
// contains filtered or unexported fields
}
func NewResourceFieldStringToken ¶
func NewResourceFieldStringToken(res Resource, fieldPath string, resolverFunc func(ctx context.Context, res Resource, fieldPath string) (string, error)) *ResourceFieldStringToken
NewResourceFieldStringToken constructs new ResourceFieldStringToken. @TODO: ideally the resolverFunc can be a shared implementation which dump Resource as json and obtain the fieldPath.
func (*ResourceFieldStringToken) Dependencies ¶
func (t *ResourceFieldStringToken) Dependencies() []Resource
func (*ResourceFieldStringToken) MarshalJSON ¶
func (t *ResourceFieldStringToken) MarshalJSON() ([]byte, error)
type ResourceMeta ¶
type ResourceMeta struct {
// contains filtered or unexported fields
}
Metadata for all resources.
func NewResourceMeta ¶
func NewResourceMeta(stack Stack, resType string, id string) ResourceMeta
NewResourceMeta constructs new resource metadata.
func (*ResourceMeta) ID ¶
func (m *ResourceMeta) ID() string
func (*ResourceMeta) Stack ¶
func (m *ResourceMeta) Stack() Stack
func (*ResourceMeta) Type ¶
func (m *ResourceMeta) Type() string
type ResourceVisitor ¶
ResourceVisitor represents a functor that can operate on a resource.
type Stack ¶
type Stack interface { // stackID returns a unique ID for stack. StackID() StackID // Add a resource into stack. AddResource(res Resource) error // Add a dependency relationship between resources. AddDependency(dependee Resource, depender Resource) error // ListResources list all resources for specific type. // pResourceSlice must be a pointer to a slice of resources, which will be filled. ListResources(pResourceSlice interface{}) error // TopologicalTraversal visits resources in stack in topological order. TopologicalTraversal(visitor ResourceVisitor) error }
Stack presents a resource graph, where resources can depend on each other.
type StackID ¶
type StackID types.NamespacedName
stackID is the identifier of a stack, it must be compatible with Kubernetes namespaced name.
type StringToken ¶
StringToken represent a string value that can be resolved at resolution time.