idmng

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDs

func GetIDs(resourceType string, count int) (ids []int, err error)

func GetMasterGRPCConn

func GetMasterGRPCConn() (*grpc.ClientConn, error)

func ReleaseIDs

func ReleaseIDs(resourceType string, ids []int) (err error)

Types

type IDManager

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

func GetSingleton

func GetSingleton() *IDManager

func (*IDManager) AllocateIDs

func (m *IDManager) AllocateIDs(resourceType string, count int) []int

func (*IDManager) Init

func (m *IDManager) Init(cfg *RecorderConfig) *IDManager

func (*IDManager) RecycleIDs

func (m *IDManager) RecycleIDs(resourceType string, ids []int)

func (*IDManager) Start

func (m *IDManager) Start() error

func (*IDManager) Stop

func (m *IDManager) Stop()

type IDPool

type IDPool[MT MySQLModel] struct {
	// contains filtered or unexported fields
}

缓存资源可用于分配的ID,提供ID的刷新、分配、回收接口

type IDPoolUpdater

type IDPoolUpdater interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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