Documentation ¶
Index ¶
- Constants
- func New(ctx context.Context, cfg *Config) (wirer.Wirer, error)
- type CallbackCtx
- type Config
- type DesiredAction
- type Dispatcher
- type EpResp
- type EvaluateName
- type NodeEndpoint
- func (r *NodeEndpoint) GetAdditionalState(eventCtx *state.EventCtx) []state.StateCtx
- func (r *NodeEndpoint) GetResponse() *endpointpb.EndpointResponse
- func (r *NodeEndpoint) HandleEvent(ctx context.Context, event state.Event, eventCtx *state.EventCtx)
- func (r *NodeEndpoint) Transition(ctx context.Context, newState state.State, eventCtx *state.EventCtx, ...)
- type NodeEpCache
- type NodeEpReq
- type Wire
- func (r *Wire) GetAdditionalState(eventCtx *state.EventCtx) []state.StateCtx
- func (r *Wire) GetWireResponse() *wirepb.WireResponse
- func (r *Wire) HandleEvent(ctx context.Context, event state.Event, eventCtx *state.EventCtx)
- func (r *Wire) SetDesiredAction(a DesiredAction)
- func (r *Wire) Transition(ctx context.Context, newState state.State, eventCtx *state.EventCtx, ...)
- type WireCache
- type WireReq
- func (r *WireReq) Act(epIdx int) bool
- func (r *WireReq) AddVPN(vpnID uint32)
- func (r *WireReq) CompareName(epIdx int, evaluate EvaluateName, name string) bool
- func (r *WireReq) GetClusterName(epIdx int) string
- func (r *WireReq) GetEndpoint(epIdx int) *wirepb.Endpoint
- func (r *WireReq) GetEndpointNodeNSN(epIdx int) types.NamespacedName
- func (r *WireReq) GetHostNodeName(epIdx int) string
- func (r *WireReq) GetNSN() types.NamespacedName
- func (r *WireReq) IsResolved(epIdx int) bool
- func (r *WireReq) Resolve(resolvedData []*resolve.Data)
- func (r *WireReq) Unresolve(epIdx int)
- type WireResp
- type Worker
Constants ¶
View Source
const (
// errors
NotFound = "not found"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackCtx ¶
type CallbackCtx struct { Message string Hold bool Evaluate EvaluateName }
type Config ¶
type Config struct { //Client client.Client VXLANClient vxlanclient.Client // used only for intercluster controller but dont do any harm ClusterCache wirer.Cache[wirecluster.Cluster] ServiceCache wirer.Cache[wireservice.Service] // used for both intercluster and incluster controller TopologyCache wirer.Cache[wiretopology.Topology] DaemonCache wirer.Cache[wiredaemon.Daemon] PodCache wirer.Cache[wirepod.Pod] NodeCache wirer.Cache[wirenode.Node] }
type DesiredAction ¶
type DesiredAction string
const ( DesiredActionCreate DesiredAction = "create" DesiredActionDelete DesiredAction = "delete" )
type Dispatcher ¶
type Dispatcher interface {
Write(workerNsn types.NamespacedName, e state.WorkerEvent) error
}
func NewDispatcher ¶
func NewDispatcher(wc wirer.Cache[Worker]) Dispatcher
type EpResp ¶
type EpResp struct {
*endpointpb.EndpointResponse
}
type EvaluateName ¶
type EvaluateName string
const ( EvaluateClusterName EvaluateName = "clusterName" EvaluateHostNodeName EvaluateName = "hostNodeName" EvaluateNodeName EvaluateName = "nodeName" )
type NodeEndpoint ¶
type NodeEndpoint struct { wirer.Object NodeEpReq *NodeEpReq NodeEpResp *EpResp State state.State // contains filtered or unexported fields }
Endoint provides the
func NewNodeEndpoint ¶
func NewNodeEndpoint(ctx context.Context, d Dispatcher, req *NodeEpReq) *NodeEndpoint
func (*NodeEndpoint) GetAdditionalState ¶
func (r *NodeEndpoint) GetAdditionalState(eventCtx *state.EventCtx) []state.StateCtx
GetAdditionalState returns no additional state, since there is only 1 endpoint
func (*NodeEndpoint) GetResponse ¶
func (r *NodeEndpoint) GetResponse() *endpointpb.EndpointResponse
func (*NodeEndpoint) HandleEvent ¶
func (*NodeEndpoint) Transition ¶
func (r *NodeEndpoint) Transition(ctx context.Context, newState state.State, eventCtx *state.EventCtx, generatedEvents ...state.WorkerAction)
type NodeEpCache ¶
type NodeEpCache interface { Get(types.NamespacedName) (*NodeEndpoint, error) Upsert(context.Context, types.NamespacedName, *NodeEndpoint) Delete(context.Context, types.NamespacedName) List() map[types.NamespacedName]*NodeEndpoint Resolve(nsn types.NamespacedName, resolvedData *resolve.Data) UnResolve(nsn types.NamespacedName) HandleEvent(context.Context, types.NamespacedName, state.Event, *state.EventCtx) error }
func NewEpCache ¶
func NewEpCache(ctx context.Context, c wirer.Cache[*NodeEndpoint]) NodeEpCache
type NodeEpReq ¶
type NodeEpReq struct {
*endpointpb.EndpointRequest
}
func (*NodeEpReq) CompareName ¶
func (r *NodeEpReq) CompareName(evaluate EvaluateName, name string) bool
func (*NodeEpReq) GetHostNodeName ¶
func (*NodeEpReq) GetNSN ¶
func (r *NodeEpReq) GetNSN() types.NamespacedName
func (*NodeEpReq) IsResolved ¶
type Wire ¶
type Wire struct { DesiredAction DesiredAction WireReq *WireReq WireResp *WireResp EndpointsState []state.State // contains filtered or unexported fields }
func (*Wire) GetAdditionalState ¶
GetAdditionalState returns the other endpoint state on the wire + its associated event context to handle further events on the adjacent endpoint
func (*Wire) GetWireResponse ¶
func (r *Wire) GetWireResponse() *wirepb.WireResponse
func (*Wire) HandleEvent ¶
func (*Wire) SetDesiredAction ¶
func (r *Wire) SetDesiredAction(a DesiredAction)
type WireCache ¶
type WireCache interface { Get(types.NamespacedName) (*Wire, error) Upsert(context.Context, types.NamespacedName, *Wire) Delete(context.Context, types.NamespacedName) List() map[types.NamespacedName]*Wire SetDesiredAction(types.NamespacedName, DesiredAction) Resolve(ctx context.Context, nsn types.NamespacedName, resolvedData []*resolve.Data) UnResolve(ctx context.Context, nsn types.NamespacedName, epIdx int) HandleEvent(context.Context, types.NamespacedName, state.Event, *state.EventCtx) error }
func NewWireCache ¶
type WireReq ¶
type WireReq struct {
*wirepb.WireRequest
}
func (*WireReq) CompareName ¶
func (r *WireReq) CompareName(epIdx int, evaluate EvaluateName, name string) bool
TODO add the fn for the service lookup
func (*WireReq) GetClusterName ¶
func (*WireReq) GetEndpointNodeNSN ¶
func (r *WireReq) GetEndpointNodeNSN(epIdx int) types.NamespacedName
func (*WireReq) GetHostNodeName ¶
func (*WireReq) GetNSN ¶
func (r *WireReq) GetNSN() types.NamespacedName
func (*WireReq) IsResolved ¶
type WireResp ¶
type WireResp struct {
*wirepb.WireResponse
}
Click to show internal directories.
Click to hide internal directories.