Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterList2MapByID(list []*Cluster) map[int64]*Cluster
- func ClusterList2MapByName(list []*Cluster) map[string]*Cluster
- func NewBfeClusterConf(version string, clusters []*Cluster) *cluster_conf.BfeClusterConf
- func PoolList2Map(list []*Pool) map[int64]*Pool
- func SubClusterList2IDSlice(list []*SubCluster) []int64
- func SubClusterList2MapByID(list []*SubCluster) map[int64]*SubCluster
- func SubClusterList2MapByName(list []*SubCluster) map[string]*SubCluster
- func SubClusterList2NameSlice(list []*SubCluster) []string
- type Cluster
- type ClusterBasic
- type ClusterBasicBuffers
- type ClusterBasicBuffersParam
- type ClusterBasicConnection
- type ClusterBasicConnectionParam
- type ClusterBasicParam
- type ClusterBasicRetries
- type ClusterBasicRetriesParam
- type ClusterBasicTimeouts
- type ClusterBasicTimeoutsParam
- type ClusterFilter
- type ClusterManager
- func (cm *ClusterManager) CreateCluster(ctx context.Context, product *ibasic.Product, param *ClusterParam) (err error)
- func (cm *ClusterManager) DeleteCluster(ctx context.Context, product *ibasic.Product, cluster *Cluster) (err error)
- func (rm *ClusterManager) ExportClusterTable(ctx context.Context, lastVersion string) (*ClusterTableConf, error)
- func (rm *ClusterManager) ExportGSLB(ctx context.Context, lastVersion, bfeClusterName string) (*GSLBConf, error)
- func (cm *ClusterManager) FetchCluster(ctx context.Context, param *ClusterFilter) (*Cluster, error)
- func (rm *ClusterManager) FetchClusterList(ctx context.Context, param *ClusterFilter) (list []*Cluster, err error)
- func (cm *ClusterManager) RebindSubCluster(ctx context.Context, product *ibasic.Product, cluster *Cluster, ...) error
- func (cm *ClusterManager) UpdateCluster(ctx context.Context, product *ibasic.Product, oldData *Cluster, ...) (err error)
- type ClusterParam
- type ClusterPassiveHealthCheck
- type ClusterPassiveHealthCheckParam
- type ClusterStickySessions
- type ClusterStickySessionsParam
- type ClusterStorager
- type ClusterTableConf
- type GSLBConf
- type Instance
- type Pool
- type PoolFilter
- type PoolManager
- func (rppm *PoolManager) CanDelete(ctx context.Context, pool *Pool) error
- func (rppm *PoolManager) CreateBFEPool(ctx context.Context, pool *PoolParam) (one *Pool, err error)
- func (rppm *PoolManager) CreateProductPool(ctx context.Context, product *ibasic.Product, pool *PoolParam) (one *Pool, err error)
- func (rppm *PoolManager) DeleteBFEPool(ctx context.Context, name string) (one *Pool, err error)
- func (rppm *PoolManager) DeleteProductPool(ctx context.Context, product *ibasic.Product, name string) (one *Pool, err error)
- func (rppm *PoolManager) FetchBFEPool(ctx context.Context, name string) (one *Pool, err error)
- func (rppm *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error)
- func (rppm *PoolManager) FetchPoolByName(ctx context.Context, name string) (one *Pool, err error)
- func (rppm *PoolManager) FetchProductPool(ctx context.Context, product *ibasic.Product, name string) (one *Pool, err error)
- func (rppm *PoolManager) FetchProductPools(ctx context.Context, product *ibasic.Product) (list []*Pool, err error)
- func (rppm *PoolManager) GetPoolByName(ctx context.Context, poolName *string) (pool *Pool, err error)
- func (rppm *PoolManager) UpdateBFEPool(ctx context.Context, pool *Pool, diff *PoolParam) (err error)
- func (rppm *PoolManager) UpdateProductPool(ctx context.Context, product *ibasic.Product, pool *Pool, diff *PoolParam) (err error)
- type PoolParam
- type PoolStorager
- type SubCluster
- type SubClusterFilter
- type SubClusterManager
- func (scm *SubClusterManager) CreateSubCluster(ctx context.Context, product *ibasic.Product, param *SubClusterParam) (err error)
- func (scm *SubClusterManager) DeleteSubCluster(ctx context.Context, subCluster *SubCluster) (err error)
- func (scm *SubClusterManager) FetchSubCluster(ctx context.Context, param *SubClusterFilter) (subCluster *SubCluster, err error)
- func (scm *SubClusterManager) SubClusterList(ctx context.Context, param *SubClusterFilter) (list []*SubCluster, err error)
- func (scm *SubClusterManager) UpdateSubCluster(ctx context.Context, subCluster *SubCluster, param *SubClusterParam) (err error)
- type SubClusterParam
- type SubClusterStorager
Constants ¶
View Source
const ( ConfigTopicClusterTable = "cluster_table" ConfigTopicGSLB = "gslb" )
View Source
const BlackHole = "GSLB_BLACKHOLE"
View Source
const (
ResourceClusterRule = "cluster_rule"
)
Variables ¶
View Source
var ( ClusterHashStrategyClientIDOnlyI int32 = 0 ClusterHashStrategyClientIPOnlyI int32 = 1 ClusterHashStrategyClientIDPreferedI int32 = 2 ClusterHealthCheckHTTP = "http" ClusterHealthCheckTCP = "tcp" ClusterHealthCheckSchemaMap = map[string]bool{ ClusterHealthCheckHTTP: true, ClusterHealthCheckTCP: true, } ClusterStickTypeSubCluster = "SUB_CLUSTER" ClusterStickTypeInstance = "INSTANCE" ClusterDefaultReqFlushInterval int32 = 0 ClusterDefaultResFlushInterval int32 = -1 // -1: write response directly without using timing refresh )
View Source
var ( UnMountedClusterID int64 = -1 RouteAdvancedModeClusterName4DP = route_rule_conf.AdvancedMode RouteAdvancedModeClusterName = "GO_TO_ADVANCED_RULES" RouteAdvancedModeClusterID int64 = -1 SystemKeepRouteNames = map[string]bool{ RouteAdvancedModeClusterName: true, RouteAdvancedModeClusterName4DP: true, } )
View Source
var ( PoolTagBFE int8 = 1 PoolTagProduct int8 = 2 )
Functions ¶
func ClusterList2MapByID ¶
func ClusterList2MapByName ¶
func NewBfeClusterConf ¶
func NewBfeClusterConf(version string, clusters []*Cluster) *cluster_conf.BfeClusterConf
func PoolList2Map ¶
func SubClusterList2IDSlice ¶
func SubClusterList2IDSlice(list []*SubCluster) []int64
func SubClusterList2MapByID ¶
func SubClusterList2MapByID(list []*SubCluster) map[int64]*SubCluster
func SubClusterList2MapByName ¶
func SubClusterList2MapByName(list []*SubCluster) map[string]*SubCluster
func SubClusterList2NameSlice ¶
func SubClusterList2NameSlice(list []*SubCluster) []string
Types ¶
type Cluster ¶
type Cluster struct { ID int64 Name string Description string Ready bool ProductID int64 Basic *ClusterBasic StickySessions *ClusterStickySessions SubClusters []*SubCluster Scheduler map[string]map[string]int PassiveHealthCheck *ClusterPassiveHealthCheck }
func (*Cluster) SubClusterNames ¶
type ClusterBasic ¶
type ClusterBasic struct { Connection *ClusterBasicConnection Retries *ClusterBasicRetries Buffers *ClusterBasicBuffers Timeouts *ClusterBasicTimeouts }
type ClusterBasicBuffers ¶
type ClusterBasicConnection ¶
type ClusterBasicParam ¶
type ClusterBasicParam struct { Connection *ClusterBasicConnectionParam Retries *ClusterBasicRetriesParam Buffers *ClusterBasicBuffersParam Timeouts *ClusterBasicTimeoutsParam }
type ClusterBasicRetries ¶
type ClusterBasicTimeouts ¶
type ClusterFilter ¶
type ClusterManager ¶
type ClusterManager struct {
// contains filtered or unexported fields
}
func NewClusterManager ¶
func NewClusterManager(txn itxn.TxnStorager, storager ClusterStorager, subClusterStorager SubClusterStorager, bfeClusterStorager ibasic.BFEClusterStorager, versionControlManager *iversion_control.VersionControlManager, deleteCheckers map[string]func(context.Context, *ibasic.Product, *Cluster) error) *ClusterManager
func (*ClusterManager) CreateCluster ¶
func (cm *ClusterManager) CreateCluster(ctx context.Context, product *ibasic.Product, param *ClusterParam) (err error)
func (*ClusterManager) DeleteCluster ¶
func (*ClusterManager) ExportClusterTable ¶
func (rm *ClusterManager) ExportClusterTable(ctx context.Context, lastVersion string) (*ClusterTableConf, error)
func (*ClusterManager) ExportGSLB ¶
func (*ClusterManager) FetchCluster ¶
func (cm *ClusterManager) FetchCluster(ctx context.Context, param *ClusterFilter) (*Cluster, error)
func (*ClusterManager) FetchClusterList ¶
func (rm *ClusterManager) FetchClusterList(ctx context.Context, param *ClusterFilter) (list []*Cluster, err error)
func (*ClusterManager) RebindSubCluster ¶
func (*ClusterManager) UpdateCluster ¶
func (cm *ClusterManager) UpdateCluster(ctx context.Context, product *ibasic.Product, oldData *Cluster, param *ClusterParam) (err error)
type ClusterParam ¶
type ClusterParam struct { ID *int64 Name *string ProductID *int64 Description *string Basic *ClusterBasicParam StickySessions *ClusterStickySessionsParam SubClusters []string Scheduler map[string]map[string]int PassiveHealthCheck *ClusterPassiveHealthCheckParam }
type ClusterStickySessions ¶
type ClusterStorager ¶
type ClusterStorager interface { FetchCluster(ctx context.Context, param *ClusterFilter) (*Cluster, error) FetchClusterList(ctx context.Context, param *ClusterFilter) ([]*Cluster, error) ClusterUpdate(ctx context.Context, product *ibasic.Product, old *Cluster, param *ClusterParam) error ClusterCreate(ctx context.Context, product *ibasic.Product, param *ClusterParam, subClusters []*SubCluster) (int64, error) ClusterDelete(ctx context.Context, product *ibasic.Product, cluster *Cluster) error BindSubCluster(ctx context.Context, cluster *Cluster, appendSubClusters, unbindSubClusters []*SubCluster) error }
type ClusterTableConf ¶
type ClusterTableConf struct {
cluster_table_conf.ClusterTableConf
}
func (*ClusterTableConf) UpdateVersion ¶
func (ctc *ClusterTableConf) UpdateVersion(version string) error
type GSLBConf ¶
func (*GSLBConf) UpdateVersion ¶
type Instance ¶
type Instance struct { HostName string `json:"Name"` IP string `json:"Addr"` Port int `json:"Port"` Ports map[string]int `json:"Ports,omitempty"` Tags map[string]string `json:"tags,omitempty"` Weight int64 `json:"Weight"` Disable bool `json:"Disable"` }
func (*Instance) IPWithPort ¶
type PoolManager ¶
type PoolManager struct {
// contains filtered or unexported fields
}
func NewPoolManager ¶
func NewPoolManager(txn itxn.TxnStorager, storager PoolStorager, bfeClusterStorager ibasic.BFEClusterStorager, subClusterStorager SubClusterStorager) *PoolManager
func (*PoolManager) CanDelete ¶
func (rppm *PoolManager) CanDelete(ctx context.Context, pool *Pool) error
CanDelete check whether pool can be deleted, Check Logic: 1. Not BFE Cluster Refer To 2. Not SubCluster Refer To
func (*PoolManager) CreateBFEPool ¶
func (*PoolManager) CreateProductPool ¶
func (*PoolManager) DeleteBFEPool ¶
func (*PoolManager) DeleteProductPool ¶
func (*PoolManager) FetchBFEPool ¶
func (*PoolManager) FetchBFEPools ¶
func (rppm *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error)
func (*PoolManager) FetchPoolByName ¶
func (*PoolManager) FetchProductPool ¶
func (*PoolManager) FetchProductPools ¶
func (*PoolManager) GetPoolByName ¶
func (*PoolManager) UpdateBFEPool ¶
func (*PoolManager) UpdateProductPool ¶
type PoolStorager ¶
type PoolStorager interface { FetchPool(ctx context.Context, name string) (*Pool, error) FetchPools(ctx context.Context, param *PoolFilter) ([]*Pool, error) CreatePool(ctx context.Context, product *ibasic.Product, data *PoolParam) (*Pool, error) UpdatePool(ctx context.Context, oldData *Pool, diff *PoolParam) error DeletePool(ctx context.Context, pool *Pool) error }
type SubCluster ¶
type SubClusterFilter ¶
type SubClusterManager ¶
type SubClusterManager struct {
// contains filtered or unexported fields
}
func NewSubClusterManager ¶
func NewSubClusterManager(txn itxn.TxnStorager, storager SubClusterStorager, productStorager ibasic.ProductStorager, poolStorager PoolStorager, clusterStorager ClusterStorager) *SubClusterManager
func (*SubClusterManager) CreateSubCluster ¶
func (scm *SubClusterManager) CreateSubCluster(ctx context.Context, product *ibasic.Product, param *SubClusterParam) (err error)
func (*SubClusterManager) DeleteSubCluster ¶
func (scm *SubClusterManager) DeleteSubCluster(ctx context.Context, subCluster *SubCluster) (err error)
func (*SubClusterManager) FetchSubCluster ¶
func (scm *SubClusterManager) FetchSubCluster(ctx context.Context, param *SubClusterFilter) (subCluster *SubCluster, err error)
func (*SubClusterManager) SubClusterList ¶
func (scm *SubClusterManager) SubClusterList(ctx context.Context, param *SubClusterFilter) (list []*SubCluster, err error)
func (*SubClusterManager) UpdateSubCluster ¶
func (scm *SubClusterManager) UpdateSubCluster(ctx context.Context, subCluster *SubCluster, param *SubClusterParam) (err error)
type SubClusterParam ¶
type SubClusterStorager ¶
type SubClusterStorager interface { FetchSubClusterList(ctx context.Context, param *SubClusterFilter) ([]*SubCluster, error) CreateSubCluster(ctx context.Context, param *SubClusterParam) error DeleteSubCluster(ctx context.Context, param *SubCluster) error UpdateSubCluster(ctx context.Context, one *SubCluster, param *SubClusterParam) error }
Click to show internal directories.
Click to hide internal directories.