Documentation ¶
Overview ¶
Package core is a generated GoMock package.
Index ¶
- func IdFromHash(res any) (string, error)
- func NewDefaultStack(stackID StackID) *defaultStack
- type BackendRef
- type EventType
- type FakeResource
- type FakeResourceSpec
- type FakeResourceStatus
- type GRPCBackendRef
- func (r *GRPCBackendRef) Equals(backendRef BackendRef) bool
- func (r *GRPCBackendRef) Group() *gwv1beta1.Group
- func (r *GRPCBackendRef) Kind() *gwv1beta1.Kind
- func (r *GRPCBackendRef) Name() gwv1beta1.ObjectName
- func (r *GRPCBackendRef) Namespace() *gwv1beta1.Namespace
- func (r *GRPCBackendRef) Port() *gwv1beta1.PortNumber
- func (r *GRPCBackendRef) Weight() *int32
- type GRPCHeaderMatch
- type GRPCRoute
- func (r *GRPCRoute) DeepCopy() Route
- func (r *GRPCRoute) DeletionTimestamp() *metav1.Time
- func (r *GRPCRoute) Inner() *gwv1alpha2.GRPCRoute
- func (r *GRPCRoute) K8sObject() client.Object
- func (r *GRPCRoute) Name() string
- func (r *GRPCRoute) Namespace() string
- func (r *GRPCRoute) Spec() RouteSpec
- func (r *GRPCRoute) Status() RouteStatus
- type GRPCRouteMatch
- type GRPCRouteRule
- type GRPCRouteSpec
- type GRPCRouteStatus
- func (s *GRPCRouteStatus) Parents() []gwv1beta1.RouteParentStatus
- func (s *GRPCRouteStatus) SetParents(parents []gwv1beta1.RouteParentStatus)
- func (s *GRPCRouteStatus) UpdateParentRefs(parent gwv1beta1.ParentReference, controllerName gwv1beta1.GatewayController)
- func (s *GRPCRouteStatus) UpdateRouteCondition(condition metav1.Condition)
- type HTTPBackendRef
- func (r *HTTPBackendRef) Equals(backendRef BackendRef) bool
- func (r *HTTPBackendRef) Group() *gwv1beta1.Group
- func (r *HTTPBackendRef) Kind() *gwv1beta1.Kind
- func (r *HTTPBackendRef) Name() gwv1beta1.ObjectName
- func (r *HTTPBackendRef) Namespace() *gwv1beta1.Namespace
- func (r *HTTPBackendRef) Port() *gwv1beta1.PortNumber
- func (r *HTTPBackendRef) Weight() *int32
- type HTTPHeaderMatch
- type HTTPRoute
- func (r *HTTPRoute) DeepCopy() Route
- func (r *HTTPRoute) DeletionTimestamp() *metav1.Time
- func (r *HTTPRoute) Inner() *gwv1beta1.HTTPRoute
- func (r *HTTPRoute) K8sObject() client.Object
- func (r *HTTPRoute) Name() string
- func (r *HTTPRoute) Namespace() string
- func (r *HTTPRoute) Spec() RouteSpec
- func (r *HTTPRoute) Status() RouteStatus
- type HTTPRouteMatch
- type HTTPRouteRule
- type HTTPRouteSpec
- type HTTPRouteStatus
- func (s *HTTPRouteStatus) Parents() []gwv1beta1.RouteParentStatus
- func (s *HTTPRouteStatus) SetParents(parents []gwv1beta1.RouteParentStatus)
- func (s *HTTPRouteStatus) UpdateParentRefs(parent gwv1beta1.ParentReference, controllerName gwv1beta1.GatewayController)
- func (s *HTTPRouteStatus) UpdateRouteCondition(condition metav1.Condition)
- type HeaderMatch
- 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) GetResource(id string, res Resource) error
- 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) GetResource(id, 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 Policy
- type PolicyList
- type Resource
- type ResourceFieldStringToken
- type ResourceMeta
- type ResourceVisitor
- type Route
- func GetGRPCRoute(ctx context.Context, client client.Client, ...) (Route, error)
- func GetHTTPRoute(ctx context.Context, client client.Client, ...) (Route, error)
- func ListAllRoutes(context context.Context, client client.Client) ([]Route, error)
- func ListGRPCRoutes(context context.Context, client client.Client) ([]Route, error)
- func ListHTTPRoutes(context context.Context, client client.Client) ([]Route, error)
- func NewRoute(object client.Object) (Route, error)
- type RouteMatch
- type RouteRule
- type RouteSpec
- type RouteStatus
- type RouteType
- type Stack
- type StackID
- type StringToken
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdFromHash ¶ added in v0.0.18
func NewDefaultStack ¶
func NewDefaultStack(stackID StackID) *defaultStack
NewDefaultStack constructs new stack.
Types ¶
type BackendRef ¶ added in v0.0.16
type BackendRef interface { Weight() *int32 Group() *gwv1beta1.Group Kind() *gwv1beta1.Kind Name() gwv1beta1.ObjectName Namespace() *gwv1beta1.Namespace Port() *gwv1beta1.PortNumber Equals(backendRef BackendRef) bool }
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 GRPCBackendRef ¶ added in v0.0.16
type GRPCBackendRef struct {
// contains filtered or unexported fields
}
func (*GRPCBackendRef) Equals ¶ added in v0.0.16
func (r *GRPCBackendRef) Equals(backendRef BackendRef) bool
func (*GRPCBackendRef) Group ¶ added in v0.0.16
func (r *GRPCBackendRef) Group() *gwv1beta1.Group
func (*GRPCBackendRef) Kind ¶ added in v0.0.16
func (r *GRPCBackendRef) Kind() *gwv1beta1.Kind
func (*GRPCBackendRef) Name ¶ added in v0.0.16
func (r *GRPCBackendRef) Name() gwv1beta1.ObjectName
func (*GRPCBackendRef) Namespace ¶ added in v0.0.16
func (r *GRPCBackendRef) Namespace() *gwv1beta1.Namespace
func (*GRPCBackendRef) Port ¶ added in v0.0.16
func (r *GRPCBackendRef) Port() *gwv1beta1.PortNumber
func (*GRPCBackendRef) Weight ¶ added in v0.0.16
func (r *GRPCBackendRef) Weight() *int32
type GRPCHeaderMatch ¶ added in v0.0.16
type GRPCHeaderMatch struct {
// contains filtered or unexported fields
}
func (*GRPCHeaderMatch) Equals ¶ added in v0.0.16
func (m *GRPCHeaderMatch) Equals(headerMatch HeaderMatch) bool
func (*GRPCHeaderMatch) Name ¶ added in v0.0.16
func (m *GRPCHeaderMatch) Name() string
func (*GRPCHeaderMatch) Type ¶ added in v0.0.16
func (m *GRPCHeaderMatch) Type() *gwv1beta1.HeaderMatchType
func (*GRPCHeaderMatch) Value ¶ added in v0.0.16
func (m *GRPCHeaderMatch) Value() string
type GRPCRoute ¶ added in v0.0.16
type GRPCRoute struct {
// contains filtered or unexported fields
}
func NewGRPCRoute ¶ added in v0.0.16
func NewGRPCRoute(route gwv1alpha2.GRPCRoute) *GRPCRoute
func (*GRPCRoute) DeletionTimestamp ¶ added in v0.0.16
func (*GRPCRoute) Inner ¶ added in v0.0.16
func (r *GRPCRoute) Inner() *gwv1alpha2.GRPCRoute
func (*GRPCRoute) Status ¶ added in v0.0.16
func (r *GRPCRoute) Status() RouteStatus
type GRPCRouteMatch ¶ added in v0.0.16
type GRPCRouteMatch struct {
// contains filtered or unexported fields
}
func (*GRPCRouteMatch) Equals ¶ added in v0.0.16
func (m *GRPCRouteMatch) Equals(routeMatch RouteMatch) bool
func (*GRPCRouteMatch) Headers ¶ added in v0.0.16
func (m *GRPCRouteMatch) Headers() []HeaderMatch
func (*GRPCRouteMatch) Method ¶ added in v0.0.16
func (m *GRPCRouteMatch) Method() *gwv1alpha2.GRPCMethodMatch
type GRPCRouteRule ¶ added in v0.0.16
type GRPCRouteRule struct {
// contains filtered or unexported fields
}
func (*GRPCRouteRule) BackendRefs ¶ added in v0.0.16
func (r *GRPCRouteRule) BackendRefs() []BackendRef
func (*GRPCRouteRule) Equals ¶ added in v0.0.16
func (r *GRPCRouteRule) Equals(routeRule RouteRule) bool
func (*GRPCRouteRule) Matches ¶ added in v0.0.16
func (r *GRPCRouteRule) Matches() []RouteMatch
type GRPCRouteSpec ¶ added in v0.0.16
type GRPCRouteSpec struct {
// contains filtered or unexported fields
}
func (*GRPCRouteSpec) Equals ¶ added in v0.0.16
func (s *GRPCRouteSpec) Equals(routeSpec RouteSpec) bool
func (*GRPCRouteSpec) Hostnames ¶ added in v0.0.16
func (s *GRPCRouteSpec) Hostnames() []gwv1beta1.Hostname
func (*GRPCRouteSpec) ParentRefs ¶ added in v0.0.16
func (s *GRPCRouteSpec) ParentRefs() []gwv1beta1.ParentReference
func (*GRPCRouteSpec) Rules ¶ added in v0.0.16
func (s *GRPCRouteSpec) Rules() []RouteRule
type GRPCRouteStatus ¶ added in v0.0.16
type GRPCRouteStatus struct {
// contains filtered or unexported fields
}
func (*GRPCRouteStatus) Parents ¶ added in v0.0.16
func (s *GRPCRouteStatus) Parents() []gwv1beta1.RouteParentStatus
func (*GRPCRouteStatus) SetParents ¶ added in v0.0.16
func (s *GRPCRouteStatus) SetParents(parents []gwv1beta1.RouteParentStatus)
func (*GRPCRouteStatus) UpdateParentRefs ¶ added in v0.0.16
func (s *GRPCRouteStatus) UpdateParentRefs(parent gwv1beta1.ParentReference, controllerName gwv1beta1.GatewayController)
func (*GRPCRouteStatus) UpdateRouteCondition ¶ added in v0.0.16
func (s *GRPCRouteStatus) UpdateRouteCondition(condition metav1.Condition)
type HTTPBackendRef ¶ added in v0.0.16
type HTTPBackendRef struct {
// contains filtered or unexported fields
}
func NewHTTPBackendRef ¶ added in v0.0.18
func NewHTTPBackendRef(r gwv1beta1.HTTPBackendRef) HTTPBackendRef
func (*HTTPBackendRef) Equals ¶ added in v0.0.16
func (r *HTTPBackendRef) Equals(backendRef BackendRef) bool
func (*HTTPBackendRef) Group ¶ added in v0.0.16
func (r *HTTPBackendRef) Group() *gwv1beta1.Group
func (*HTTPBackendRef) Kind ¶ added in v0.0.16
func (r *HTTPBackendRef) Kind() *gwv1beta1.Kind
func (*HTTPBackendRef) Name ¶ added in v0.0.16
func (r *HTTPBackendRef) Name() gwv1beta1.ObjectName
func (*HTTPBackendRef) Namespace ¶ added in v0.0.16
func (r *HTTPBackendRef) Namespace() *gwv1beta1.Namespace
func (*HTTPBackendRef) Port ¶ added in v0.0.16
func (r *HTTPBackendRef) Port() *gwv1beta1.PortNumber
func (*HTTPBackendRef) Weight ¶ added in v0.0.16
func (r *HTTPBackendRef) Weight() *int32
type HTTPHeaderMatch ¶ added in v0.0.16
type HTTPHeaderMatch struct {
// contains filtered or unexported fields
}
func (*HTTPHeaderMatch) Equals ¶ added in v0.0.16
func (m *HTTPHeaderMatch) Equals(headerMatch HeaderMatch) bool
func (*HTTPHeaderMatch) Name ¶ added in v0.0.16
func (m *HTTPHeaderMatch) Name() string
func (*HTTPHeaderMatch) Type ¶ added in v0.0.16
func (m *HTTPHeaderMatch) Type() *gwv1beta1.HeaderMatchType
func (*HTTPHeaderMatch) Value ¶ added in v0.0.16
func (m *HTTPHeaderMatch) Value() string
type HTTPRoute ¶ added in v0.0.16
type HTTPRoute struct {
// contains filtered or unexported fields
}
func NewHTTPRoute ¶ added in v0.0.16
func (*HTTPRoute) DeletionTimestamp ¶ added in v0.0.16
func (*HTTPRoute) Status ¶ added in v0.0.16
func (r *HTTPRoute) Status() RouteStatus
type HTTPRouteMatch ¶ added in v0.0.16
type HTTPRouteMatch struct {
// contains filtered or unexported fields
}
func (*HTTPRouteMatch) Equals ¶ added in v0.0.16
func (m *HTTPRouteMatch) Equals(routeMatch RouteMatch) bool
func (*HTTPRouteMatch) Headers ¶ added in v0.0.16
func (m *HTTPRouteMatch) Headers() []HeaderMatch
func (*HTTPRouteMatch) Method ¶ added in v0.0.16
func (m *HTTPRouteMatch) Method() *gwv1beta1.HTTPMethod
func (*HTTPRouteMatch) Path ¶ added in v0.0.16
func (m *HTTPRouteMatch) Path() *gwv1beta1.HTTPPathMatch
func (*HTTPRouteMatch) QueryParams ¶ added in v0.0.16
func (m *HTTPRouteMatch) QueryParams() []gwv1beta1.HTTPQueryParamMatch
type HTTPRouteRule ¶ added in v0.0.16
type HTTPRouteRule struct {
// contains filtered or unexported fields
}
func (*HTTPRouteRule) BackendRefs ¶ added in v0.0.16
func (r *HTTPRouteRule) BackendRefs() []BackendRef
func (*HTTPRouteRule) Equals ¶ added in v0.0.16
func (r *HTTPRouteRule) Equals(routeRule RouteRule) bool
func (*HTTPRouteRule) Matches ¶ added in v0.0.16
func (r *HTTPRouteRule) Matches() []RouteMatch
type HTTPRouteSpec ¶ added in v0.0.16
type HTTPRouteSpec struct {
// contains filtered or unexported fields
}
func (*HTTPRouteSpec) Equals ¶ added in v0.0.16
func (s *HTTPRouteSpec) Equals(routeSpec RouteSpec) bool
func (*HTTPRouteSpec) Hostnames ¶ added in v0.0.16
func (s *HTTPRouteSpec) Hostnames() []gwv1beta1.Hostname
func (*HTTPRouteSpec) ParentRefs ¶ added in v0.0.16
func (s *HTTPRouteSpec) ParentRefs() []gwv1beta1.ParentReference
func (*HTTPRouteSpec) Rules ¶ added in v0.0.16
func (s *HTTPRouteSpec) Rules() []RouteRule
type HTTPRouteStatus ¶ added in v0.0.16
type HTTPRouteStatus struct {
// contains filtered or unexported fields
}
func (*HTTPRouteStatus) Parents ¶ added in v0.0.16
func (s *HTTPRouteStatus) Parents() []gwv1beta1.RouteParentStatus
func (*HTTPRouteStatus) SetParents ¶ added in v0.0.16
func (s *HTTPRouteStatus) SetParents(parents []gwv1beta1.RouteParentStatus)
func (*HTTPRouteStatus) UpdateParentRefs ¶ added in v0.0.16
func (s *HTTPRouteStatus) UpdateParentRefs(parent gwv1beta1.ParentReference, controllerName gwv1beta1.GatewayController)
func (*HTTPRouteStatus) UpdateRouteCondition ¶ added in v0.0.16
func (s *HTTPRouteStatus) UpdateRouteCondition(condition metav1.Condition)
type HeaderMatch ¶ added in v0.0.16
type HeaderMatch interface { Type() *gwv1beta1.HeaderMatchType Name() string Value() string Equals(headerMatch HeaderMatch) bool }
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) GetResource ¶ added in v0.0.18
GetResource mocks base method.
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) GetResource ¶ added in v0.0.18
func (mr *MockStackMockRecorder) GetResource(id, res interface{}) *gomock.Call
GetResource indicates an expected call of GetResource.
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 Policy ¶ added in v0.0.17
type Policy interface { GetNamespacedName() types.NamespacedName GetTargetRef() *gwv1alpha2.PolicyTargetReference GetStatusConditions() []apimachineryv1.Condition SetStatusConditions(conditions []apimachineryv1.Condition) }
type PolicyList ¶ added in v0.0.17
type PolicyList interface {
GetItems() []Policy
}
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 Route ¶ added in v0.0.16
type Route interface { Spec() RouteSpec Status() RouteStatus Name() string Namespace() string DeletionTimestamp() *metav1.Time DeepCopy() Route K8sObject() client.Object }
func GetGRPCRoute ¶ added in v0.0.16
func GetHTTPRoute ¶ added in v0.0.16
func ListAllRoutes ¶ added in v0.0.16
func ListGRPCRoutes ¶ added in v0.0.16
func ListHTTPRoutes ¶ added in v0.0.16
type RouteMatch ¶ added in v0.0.16
type RouteMatch interface { Headers() []HeaderMatch Equals(routeMatch RouteMatch) bool }
type RouteRule ¶ added in v0.0.16
type RouteRule interface { BackendRefs() []BackendRef Matches() []RouteMatch Equals(routeRule RouteRule) bool }
type RouteStatus ¶ added in v0.0.16
type RouteStatus interface { Parents() []gwv1beta1.RouteParentStatus SetParents(parents []gwv1beta1.RouteParentStatus) UpdateParentRefs(parent gwv1beta1.ParentReference, controllerName gwv1beta1.GatewayController) UpdateRouteCondition(condition metav1.Condition) }
type RouteType ¶ added in v0.0.16
type RouteType string
const (
GrpcRouteType RouteType = "grpc"
)
const (
HttpRouteType RouteType = "http"
)
type Stack ¶
type Stack interface { // stackID returns a unique ID for stack. StackID() StackID // Add a resource into stack. AddResource(res Resource) error // Get a resource by its id and type, pointer will be populated after call GetResource(id string, 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.