Documentation
¶
Index ¶
- func GetIDs(orgID int, resourceType string, count int) (ids []int, err error)
- func GetMasterGRPCConn() (*grpc.ClientConn, error)
- func NewDescIDAllocator(org *common.ORG, resourceType string, min, max int) descIDAllocator
- func ReleaseIDs(orgID int, resourceType string, ids []int) (err error)
- type AscIDAllocator
- func (a *AscIDAllocator) Allocate(count int) ([]int, error)
- func (a *AscIDAllocator) Recycle(ids []int)
- func (a *AscIDAllocator) Refresh() error
- func (a *AscIDAllocator) SetAllocationCountStrict(allocationCountStrict bool)
- func (a *AscIDAllocator) SetInUseIDsProvider(provider inUseIDsProvider)
- func (a *AscIDAllocator) SetSorter(sorter sorter)
- func (a *AscIDAllocator) SetUnusedIDFirst(unusedIDFirst bool)
- type IDManager
- type IDManagers
- type IDPool
- func (a *IDPool) Allocate(count int) ([]int, error)
- func (a *IDPool) Recycle(ids []int)
- func (a *IDPool) Refresh() error
- func (a *IDPool) SetAllocationCountStrict(allocationCountStrict bool)
- func (a *IDPool) SetInUseIDsProvider(provider inUseIDsProvider)
- func (a *IDPool) SetSorter(sorter sorter)
- func (a *IDPool) SetUnusedIDFirst(unusedIDFirst bool)
- type IDPoolUpdater
- type MySQLModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMasterGRPCConn ¶
func GetMasterGRPCConn() (*grpc.ClientConn, error)
func NewDescIDAllocator ¶
Types ¶
type AscIDAllocator ¶
type AscIDAllocator struct {
// contains filtered or unexported fields
}
func NewAscIDAllocator ¶
func NewAscIDAllocator(org *common.ORG, resourceType string, min, max int) AscIDAllocator
func (*AscIDAllocator) SetAllocationCountStrict ¶
func (a *AscIDAllocator) SetAllocationCountStrict(allocationCountStrict bool)
func (*AscIDAllocator) SetInUseIDsProvider ¶
func (a *AscIDAllocator) SetInUseIDsProvider(provider inUseIDsProvider)
func (*AscIDAllocator) SetUnusedIDFirst ¶
func (a *AscIDAllocator) SetUnusedIDFirst(unusedIDFirst bool)
type IDManager ¶
type IDManager struct {
// contains filtered or unexported fields
}
func GetIDManager ¶
func (*IDManager) AllocateIDs ¶
func (*IDManager) RecycleIDs ¶
type IDManagers ¶
type IDManagers struct {
// contains filtered or unexported fields
}
func GetIDManagers ¶
func GetIDManagers() *IDManagers
func (*IDManagers) Init ¶
func (m *IDManagers) Init(ctx context.Context, cfg config.RecorderConfig)
func (*IDManagers) NewIDManagerAndInitIfNotExists ¶
func (m *IDManagers) NewIDManagerAndInitIfNotExists(orgID int) (*IDManager, error)
func (*IDManagers) Stop ¶
func (m *IDManagers) Stop()
type IDPool ¶
type IDPool[MT MySQLModel] struct { AscIDAllocator // contains filtered or unexported fields }
缓存资源可用于分配的ID,提供ID的刷新、分配、回收接口
func (*IDPool) SetAllocationCountStrict ¶
func (a *IDPool) SetAllocationCountStrict(allocationCountStrict bool)
func (*IDPool) SetInUseIDsProvider ¶
func (a *IDPool) SetInUseIDsProvider(provider inUseIDsProvider)
func (*IDPool) SetUnusedIDFirst ¶
func (a *IDPool) SetUnusedIDFirst(unusedIDFirst bool)
type IDPoolUpdater ¶
type IDPoolUpdater interface {
// contains filtered or unexported methods
}
type MySQLModel ¶
type MySQLModel interface { mysqlmodel.Region | mysqlmodel.AZ | mysqlmodel.SubDomain | mysqlmodel.Host | mysqlmodel.VM | mysqlmodel.VPC | mysqlmodel.Network | mysqlmodel.VRouter | mysqlmodel.DHCPPort | mysqlmodel.NATGateway | mysqlmodel.LB | mysqlmodel.CEN | mysqlmodel.PeerConnection | mysqlmodel.RDSInstance | mysqlmodel.RedisInstance | mysqlmodel.PodCluster | mysqlmodel.PodNode | mysqlmodel.VMPodNodeConnection | mysqlmodel.PodNamespace | mysqlmodel.PodIngress | mysqlmodel.PodService | mysqlmodel.PodGroup | mysqlmodel.PodReplicaSet | mysqlmodel.Pod | mysqlmodel.Process | mysqlmodel.VTap | mysqlmodel.ORG GetID() int }
资源的MySQL orm对象
Click to show internal directories.
Click to hide internal directories.