server

package
v0.5.0-rc01 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHttpConnectionManager

func DefaultHttpConnectionManager() *model.HttpConnectionManagerConfig

DefaultHttpConnectionManager

func Start

func Start(bs *model.Bootstrap)

Types

type AdapterManager

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

func CreateDefaultAdapterManager

func CreateDefaultAdapterManager(server *Server, bs *model.Bootstrap) *AdapterManager

func (*AdapterManager) Start

func (am *AdapterManager) Start()

func (*AdapterManager) Stop

func (am *AdapterManager) Stop()

type ApiConfigListener

type ApiConfigListener interface {
	OnAddAPI(r router.API) error
	OnRemoveAPI(r router.API) error
	OnDeleteRouter(r config.Resource) error
}

type ApiConfigManager

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

ApiConfigManager similar to RouterManager

func CreateDefaultApiConfigManager

func CreateDefaultApiConfigManager(server *Server, bs *model.Bootstrap) *ApiConfigManager

func GetApiConfigManager

func GetApiConfigManager() *ApiConfigManager

func (*ApiConfigManager) AddAPI

func (acm *ApiConfigManager) AddAPI(adapterID string, r router.API) error

func (*ApiConfigManager) AddApiConfigListener

func (acm *ApiConfigManager) AddApiConfigListener(adapterID string, l ApiConfigListener)

func (*ApiConfigManager) DeleteRouter

func (acm *ApiConfigManager) DeleteRouter(adapterID string, r config.Resource) error

func (*ApiConfigManager) RemoveAPI

func (acm *ApiConfigManager) RemoveAPI(adapterID string, r router.API) error

type ClusterManager

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

func CreateDefaultClusterManager

func CreateDefaultClusterManager(bs *model.Bootstrap) *ClusterManager

func GetClusterManager

func GetClusterManager() *ClusterManager

func (*ClusterManager) AddCluster

func (cm *ClusterManager) AddCluster(c *model.Cluster)

func (*ClusterManager) CloneStore

func (cm *ClusterManager) CloneStore() (*ClusterStore, error)

func (*ClusterManager) CompareAndSetStore

func (cm *ClusterManager) CompareAndSetStore(store *ClusterStore) bool

func (*ClusterManager) DeleteEndpoint

func (cm *ClusterManager) DeleteEndpoint(clusterName string, endpointID string)

func (*ClusterManager) NewStore

func (cm *ClusterManager) NewStore(version int32) *ClusterStore

func (*ClusterManager) PickEndpoint

func (cm *ClusterManager) PickEndpoint(clusterName string) *model.Endpoint

func (*ClusterManager) SetEndpoint

func (cm *ClusterManager) SetEndpoint(clusterName string, endpoint *model.Endpoint)

func (*ClusterManager) UpdateCluster

func (cm *ClusterManager) UpdateCluster(new *model.Cluster)

type ClusterStore

type ClusterStore struct {
	Config  []*model.Cluster `yaml:"config" json:"config"`
	Version int32            `yaml:"version" json:"version"`
}

ClusterStore store for cluster array

func (*ClusterStore) AddCluster

func (s *ClusterStore) AddCluster(c *model.Cluster)

func (*ClusterStore) DeleteEndpoint

func (s *ClusterStore) DeleteEndpoint(clusterName string, endpointID string)

func (*ClusterStore) HasCluster

func (s *ClusterStore) HasCluster(clusterName string) bool

func (*ClusterStore) IncreaseVersion

func (s *ClusterStore) IncreaseVersion()

func (*ClusterStore) SetEndpoint

func (s *ClusterStore) SetEndpoint(clusterName string, endpoint *model.Endpoint)

func (*ClusterStore) UpdateCluster

func (s *ClusterStore) UpdateCluster(new *model.Cluster)

type ListenerManager

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

ListenerManager the listener manager

func CreateDefaultListenerManager

func CreateDefaultListenerManager(bs *model.Bootstrap) *ListenerManager

CreateDefaultListenerManager create listener manager from config

func (*ListenerManager) StartListen

func (lm *ListenerManager) StartListen()

StartListen make active listener to start listening

type RouterListener

type RouterListener interface {
	OnAddRouter(r *model.Router)
	OnDeleteRouter(r *model.Router)
}

type RouterManager

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

func CreateDefaultRouterManager

func CreateDefaultRouterManager(server *Server, bs *model.Bootstrap) *RouterManager

func GetRouterManager

func GetRouterManager() *RouterManager

func (*RouterManager) AddRouter

func (rm *RouterManager) AddRouter(r *model.Router)

func (*RouterManager) AddRouterListener

func (rm *RouterManager) AddRouterListener(l RouterListener)

func (*RouterManager) DeleteRouter

func (rm *RouterManager) DeleteRouter(r *model.Router)

type Server

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

PX is Pixiu start struct

func GetServer

func GetServer() *Server

func NewServer

func NewServer() *Server

NewServer create server

func (*Server) GetApiConfigManager

func (s *Server) GetApiConfigManager() *ApiConfigManager

func (*Server) GetClusterManager

func (s *Server) GetClusterManager() *ClusterManager

func (*Server) GetListenerManager

func (s *Server) GetListenerManager() *ListenerManager

func (*Server) GetRouterManager

func (s *Server) GetRouterManager() *RouterManager

func (*Server) Start

func (s *Server) Start()

Start server start

Jump to

Keyboard shortcuts

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