Documentation ¶
Overview ¶
Package trafficcontroller implements the TrafficController.
Index ¶
- Constants
- type Namespace
- type NamespacesStatus
- type Spec
- type Status
- type TrafficController
- func (tc *TrafficController) ApplyPipeline(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) ApplyPipelineForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) ApplyTrafficGate(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) ApplyTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) Category() supervisor.ObjectCategory
- func (tc *TrafficController) Clean(namespace string) error
- func (tc *TrafficController) Close()
- func (tc *TrafficController) CreatePipeline(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) CreatePipelineForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) CreateTrafficGate(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) CreateTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) DefaultSpec() interface{}
- func (tc *TrafficController) DeletePipeline(namespace, name string) error
- func (tc *TrafficController) DeleteTrafficGate(namespace, name string) error
- func (tc *TrafficController) GetPipeline(namespace, name string) (*supervisor.ObjectEntity, bool)
- func (tc *TrafficController) GetTrafficGate(namespace, name string) (*supervisor.ObjectEntity, bool)
- func (tc *TrafficController) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
- func (tc *TrafficController) Init(superSpec *supervisor.Spec)
- func (tc *TrafficController) Kind() string
- func (tc *TrafficController) ListAllNamespace() map[string][]*supervisor.ObjectEntity
- func (tc *TrafficController) ListPipelines(namespace string) []*supervisor.ObjectEntity
- func (tc *TrafficController) ListTrafficGates(namespace string) []*supervisor.ObjectEntity
- func (tc *TrafficController) Status() *supervisor.Status
- func (tc *TrafficController) UpdatePipeline(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) UpdatePipelineForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) UpdateTrafficGate(namespace string, entity *supervisor.ObjectEntity) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) UpdateTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) (*supervisor.ObjectEntity, error)
- func (tc *TrafficController) WalkPipelines(namespace string, walkFn WalkFunc)
- func (tc *TrafficController) WalkTrafficGates(namespace string, walkFn WalkFunc)
- type TrafficObject
- type TrafficObjectStatus
- type WalkFunc
Constants ¶
const ( // Category is the category of TrafficController. Category = supervisor.CategorySystemController // Kind is the kind of TrafficController. Kind = "TrafficController" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace is the namespace
type NamespacesStatus ¶
type NamespacesStatus struct { Namespace string `json:"namespace"` TrafficObjects []*TrafficObject `json:"trafficObjects"` }
NamespacesStatus is the universal status in one namespace.
func (*NamespacesStatus) TrafficNamespace ¶
func (ns *NamespacesStatus) TrafficNamespace() string
TrafficNamespace returns the exported system namespace of the internal namespace of TrafficController.
type Status ¶
type Status struct {
Namespaces []*NamespacesStatus `json:"namespaces"`
}
Status is the status of namespaces
type TrafficController ¶
type TrafficController struct {
// contains filtered or unexported fields
}
TrafficController is a system controller to manage TrafficGate, Pipeline and their relationship.
func (*TrafficController) ApplyPipeline ¶
func (tc *TrafficController) ApplyPipeline(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
ApplyPipeline applies the pipeline
func (*TrafficController) ApplyPipelineForSpec ¶
func (tc *TrafficController) ApplyPipelineForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
ApplyPipelineForSpec applies the pipeline with a Spec
func (*TrafficController) ApplyTrafficGate ¶
func (tc *TrafficController) ApplyTrafficGate(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
ApplyTrafficGate applies traffic gate
func (*TrafficController) ApplyTrafficGateForSpec ¶
func (tc *TrafficController) ApplyTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
ApplyTrafficGateForSpec applies traffic gate with a Spec
func (*TrafficController) Category ¶
func (tc *TrafficController) Category() supervisor.ObjectCategory
Category returns the category of TrafficController.
func (*TrafficController) Clean ¶
func (tc *TrafficController) Clean(namespace string) error
Clean all traffic gates and pipelines of one namespace.
func (*TrafficController) Close ¶
func (tc *TrafficController) Close()
Close closes TrafficController.
func (*TrafficController) CreatePipeline ¶
func (tc *TrafficController) CreatePipeline(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
CreatePipeline creates a pipeline
func (*TrafficController) CreatePipelineForSpec ¶
func (tc *TrafficController) CreatePipelineForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
CreatePipelineForSpec creates a pipeline by a spec
func (*TrafficController) CreateTrafficGate ¶
func (tc *TrafficController) CreateTrafficGate(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
CreateTrafficGate creates traffic gate
func (*TrafficController) CreateTrafficGateForSpec ¶
func (tc *TrafficController) CreateTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
CreateTrafficGateForSpec creates traffic gate with a spec
func (*TrafficController) DefaultSpec ¶
func (tc *TrafficController) DefaultSpec() interface{}
DefaultSpec returns the default spec of TrafficController.
func (*TrafficController) DeletePipeline ¶
func (tc *TrafficController) DeletePipeline(namespace, name string) error
DeletePipeline deletes the pipeline by its namespace and name
func (*TrafficController) DeleteTrafficGate ¶
func (tc *TrafficController) DeleteTrafficGate(namespace, name string) error
DeleteTrafficGate deletes a traffic gate
func (*TrafficController) GetPipeline ¶
func (tc *TrafficController) GetPipeline(namespace, name string) (*supervisor.ObjectEntity, bool)
GetPipeline returns the pipeline by its namespace and name.
func (*TrafficController) GetTrafficGate ¶
func (tc *TrafficController) GetTrafficGate(namespace, name string) (*supervisor.ObjectEntity, bool)
GetTrafficGate gets a traffic gate by its namespace and name
func (*TrafficController) Inherit ¶
func (tc *TrafficController) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
Inherit inherits previous generation of TrafficController.
func (*TrafficController) Init ¶
func (tc *TrafficController) Init(superSpec *supervisor.Spec)
Init initializes TrafficController.
func (*TrafficController) Kind ¶
func (tc *TrafficController) Kind() string
Kind return the kind of TrafficController.
func (*TrafficController) ListAllNamespace ¶ added in v2.7.1
func (tc *TrafficController) ListAllNamespace() map[string][]*supervisor.ObjectEntity
ListAllNamespace lists pipelines and traffic gates in all namespaces.
func (*TrafficController) ListPipelines ¶
func (tc *TrafficController) ListPipelines(namespace string) []*supervisor.ObjectEntity
ListPipelines lists the pipelines
func (*TrafficController) ListTrafficGates ¶
func (tc *TrafficController) ListTrafficGates(namespace string) []*supervisor.ObjectEntity
ListTrafficGates lists the traffic gates
func (*TrafficController) Status ¶
func (tc *TrafficController) Status() *supervisor.Status
Status returns the status of TrafficController. It reports all traffic object spec and status.
func (*TrafficController) UpdatePipeline ¶
func (tc *TrafficController) UpdatePipeline(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
UpdatePipeline updates the pipeline
func (*TrafficController) UpdatePipelineForSpec ¶
func (tc *TrafficController) UpdatePipelineForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
UpdatePipelineForSpec updates the pipeline with a Spec
func (*TrafficController) UpdateTrafficGate ¶
func (tc *TrafficController) UpdateTrafficGate(namespace string, entity *supervisor.ObjectEntity) ( *supervisor.ObjectEntity, error, )
UpdateTrafficGate updates traffic gate
func (*TrafficController) UpdateTrafficGateForSpec ¶
func (tc *TrafficController) UpdateTrafficGateForSpec(namespace string, superSpec *supervisor.Spec) ( *supervisor.ObjectEntity, error, )
UpdateTrafficGateForSpec updates traffic gate with a Spec
func (*TrafficController) WalkPipelines ¶
func (tc *TrafficController) WalkPipelines(namespace string, walkFn WalkFunc)
WalkPipelines walks the pipelines
func (*TrafficController) WalkTrafficGates ¶
func (tc *TrafficController) WalkTrafficGates(namespace string, walkFn WalkFunc)
WalkTrafficGates walks traffic gates
type TrafficObject ¶
type TrafficObject struct { Name string `json:"name"` TrafficObjectStatus `json:",inline"` }
TrafficObject is the traffic object.
type TrafficObjectStatus ¶
type TrafficObjectStatus struct { Spec interface{} `json:"spec"` Status interface{} `json:"status"` }
TrafficObjectStatus is the status of traffic object.
func (*TrafficObjectStatus) ToMetrics ¶
func (s *TrafficObjectStatus) ToMetrics(service string) []*easemonitor.Metrics
ToMetrics implements easemonitor.Metricer.
type WalkFunc ¶
type WalkFunc = supervisor.WalkFunc
WalkFunc is the type of the function called for walking traffic gate and pipeline.