trafficcontroller

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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 HTTPPipelineStatus

type HTTPPipelineStatus struct {
	Spec   map[string]interface{} `yaml:"spec"`
	Status *httppipeline.Status   `yaml:"status"`
}

HTTPPipelineStatus is the HTTP pipeline status

type HTTPServerStatus

type HTTPServerStatus struct {
	Spec   map[string]interface{} `yaml:"spec"`
	Status *httpserver.Status     `yaml:"status"`
}

HTTPServerStatus is the HTTP server status

type Namespace

type Namespace struct {
	// contains filtered or unexported fields
}

Namespace is the namespace

func (*Namespace) GetHandler

func (ns *Namespace) GetHandler(name string) (protocol.HTTPHandler, bool)

GetHandler gets handler within the namespace

type Spec

type Spec struct{}

Spec describes TrafficController.

type Status

type Status struct {
	Specs []*StatusInSameNamespace `yaml:"specs"`
}

Status is the status of namespaces

type StatusInSameNamespace

type StatusInSameNamespace struct {
	Namespace     string                         `yaml:"namespace"`
	HTTPServers   map[string]*HTTPServerStatus   `yaml:"httpServers"`
	HTTPPipelines map[string]*HTTPPipelineStatus `yaml:"httpPipelines"`
}

StatusInSameNamespace is the universal status in one space. TrafficController won't use it.

func (*StatusInSameNamespace) ToSyncStatus added in v1.5.1

func (sisn *StatusInSameNamespace) ToSyncStatus() map[string]*supervisor.Status

ToSyncStatus returns http servers and pipelines in a map

type TrafficController

type TrafficController struct {
	// contains filtered or unexported fields
}

TrafficController is a system controller to manage TrafficGate, Pipeline and their relationship.

func (*TrafficController) ApplyHTTPPipeline

func (tc *TrafficController) ApplyHTTPPipeline(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

ApplyHTTPPipeline applies the HTTP pipeline

func (*TrafficController) ApplyHTTPPipelineForSpec

func (tc *TrafficController) ApplyHTTPPipelineForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

ApplyHTTPPipelineForSpec applies the HTTP pipeline with a Spec

func (*TrafficController) ApplyHTTPServer

func (tc *TrafficController) ApplyHTTPServer(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

ApplyHTTPServer applies HTTP Server

func (*TrafficController) ApplyHTTPServerForSpec

func (tc *TrafficController) ApplyHTTPServerForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

ApplyHTTPServerForSpec applies HTTP servers with a Spec

func (*TrafficController) Category

Category returns the category of TrafficController.

func (*TrafficController) Clean

func (tc *TrafficController) Clean(namespace string) error

Clean all http servers and http pipelines of one namespace.

func (*TrafficController) Close

func (tc *TrafficController) Close()

Close closes TrafficController.

func (*TrafficController) CreateHTTPPipeline

func (tc *TrafficController) CreateHTTPPipeline(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

CreateHTTPPipeline creates a HTTP pipeline

func (*TrafficController) CreateHTTPPipelineForSpec

func (tc *TrafficController) CreateHTTPPipelineForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

CreateHTTPPipelineForSpec creates a HTTP pipeline by a spec

func (*TrafficController) CreateHTTPServer

func (tc *TrafficController) CreateHTTPServer(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

CreateHTTPServer creates HTTP server

func (*TrafficController) CreateHTTPServerForSpec

func (tc *TrafficController) CreateHTTPServerForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

CreateHTTPServerForSpec creates HTTP server with a spec

func (*TrafficController) DefaultSpec

func (tc *TrafficController) DefaultSpec() interface{}

DefaultSpec returns the default spec of TrafficController.

func (*TrafficController) DeleteHTTPPipeline

func (tc *TrafficController) DeleteHTTPPipeline(namespace, name string) error

DeleteHTTPPipeline deletes the HTTP pipeline by its namespace and name

func (*TrafficController) DeleteHTTPServer

func (tc *TrafficController) DeleteHTTPServer(namespace, name string) error

DeleteHTTPServer deletes a HTTP server

func (*TrafficController) GetHTTPPipeline

func (tc *TrafficController) GetHTTPPipeline(namespace, name string) (*supervisor.ObjectEntity, bool)

GetHTTPPipeline returns the pipeline by its namespace and name.

func (*TrafficController) GetHTTPServer

func (tc *TrafficController) GetHTTPServer(namespace, name string) (*supervisor.ObjectEntity, bool)

GetHTTPServer gets HTTP servers 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) ListHTTPPipelines

func (tc *TrafficController) ListHTTPPipelines(namespace string) []*supervisor.ObjectEntity

ListHTTPPipelines lists the HTTP pipelines

func (*TrafficController) ListHTTPServers

func (tc *TrafficController) ListHTTPServers(namespace string) []*supervisor.ObjectEntity

ListHTTPServers lists the HTTP servers

func (*TrafficController) Status

func (tc *TrafficController) Status() *supervisor.Status

Status returns the status of TrafficController.

func (*TrafficController) UpdateHTTPPipeline

func (tc *TrafficController) UpdateHTTPPipeline(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

UpdateHTTPPipeline updates the HTTP pipeline

func (*TrafficController) UpdateHTTPPipelineForSpec

func (tc *TrafficController) UpdateHTTPPipelineForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

UpdateHTTPPipelineForSpec updates the HTTP pipeline with a Spec

func (*TrafficController) UpdateHTTPServer

func (tc *TrafficController) UpdateHTTPServer(namespace string, entity *supervisor.ObjectEntity) (
	*supervisor.ObjectEntity, error,
)

UpdateHTTPServer updates HTTP server

func (*TrafficController) UpdateHTTPServerForSpec

func (tc *TrafficController) UpdateHTTPServerForSpec(namespace string, superSpec *supervisor.Spec) (
	*supervisor.ObjectEntity, error,
)

UpdateHTTPServerForSpec updates HTTP server with a Spec

func (*TrafficController) WalkHTTPPipelines

func (tc *TrafficController) WalkHTTPPipelines(namespace string, walkFn WalkFunc)

WalkHTTPPipelines walks the HTTP pipelines

func (*TrafficController) WalkHTTPServers

func (tc *TrafficController) WalkHTTPServers(namespace string, walkFn WalkFunc)

WalkHTTPServers walks HTTP servers

type WalkFunc

type WalkFunc = supervisor.WalkFunc

WalkFunc is the type of the function called for walking http server and http pipeline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL