locator

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegion added in v0.1.21

func NewRegion(config *config.LocatorCfg) region.Region

Types

type DNSServer added in v0.1.10

type DNSServer struct {
	*config.LocatorCfg
	api.Locator
	// contains filtered or unexported fields
}

func NewDNSServer added in v0.1.10

func NewDNSServer(config *config.LocatorCfg, locator api.Locator, reg region.Region) *DNSServer

func (*DNSServer) DeleteTXTRecord added in v0.1.11

func (ds *DNSServer) DeleteTXTRecord(domain string) error

func (*DNSServer) SetTXTRecord added in v0.1.11

func (ds *DNSServer) SetTXTRecord(domain string, value string) error

type EtcdClient

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

func NewEtcdClient

func NewEtcdClient(addresses []string) (*EtcdClient, error)

func (*EtcdClient) GetAllSchedulerConfigs added in v0.1.11

func (ec *EtcdClient) GetAllSchedulerConfigs() []*types.SchedulerCfg

func (*EtcdClient) GetSchedulerConfigs

func (ec *EtcdClient) GetSchedulerConfigs(areaID string) ([]*types.SchedulerCfg, error)

type Locator

type Locator struct {
	fx.In

	*common.CommonAPI
	region.Region
	Storage
	*config.LocatorCfg
	*DNSServer
	Rand          *rand.Rand
	ScheduelrAPIs SchedulerAPIMap
}

func (*Locator) AllocateSchedulerForNode added in v0.1.19

func (l *Locator) AllocateSchedulerForNode(ctx context.Context, nodeType types.NodeType, code string) (string, error)

func (*Locator) CandidateDownloadInfos added in v0.1.10

func (l *Locator) CandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error)

func (*Locator) EdgeDownloadInfos

func (l *Locator) EdgeDownloadInfos(ctx context.Context, cid string) ([]*types.EdgeDownloadInfoList, error)

func (*Locator) GetAccessPoints

func (l *Locator) GetAccessPoints(ctx context.Context, nodeID, areaID string) ([]string, error)

GetAccessPoints get schedulers urls with special areaID, and those schedulers have the node

func (*Locator) GetAccessPointsV2 added in v0.1.21

func (l *Locator) GetAccessPointsV2(ctx context.Context, nodeID, areaID string) (*types.AccessPointRsp, error)

GetAccessPointsV2 get schedulers urls with special areaID, and those schedulers have the node

func (*Locator) GetAssetSourceDownloadInfos added in v0.1.18

func (l *Locator) GetAssetSourceDownloadInfos(ctx context.Context, cid string) ([]*types.AssetSourceDownloadInfoRsp, error)

GetAssetSourceDownloadInfo

func (*Locator) GetCandidateIP added in v0.1.11

func (l *Locator) GetCandidateIP(ctx context.Context, nodeID string) (string, error)

GetCandidateIP retrieves ip of candidate

func (*Locator) GetDeploymentCandidateIP added in v0.1.21

func (l *Locator) GetDeploymentCandidateIP(ctx context.Context, deploymentID string) (string, error)

GetDeploymentCandidateIP retrieves candidate ip of deployment

func (*Locator) GetSchedulerWithNode added in v0.1.11

func (l *Locator) GetSchedulerWithNode(ctx context.Context, nodeID string) (string, error)

GetSchedulerWithNode get the scheduler that the node is already connected to

func (*Locator) GetUserAccessPoint

func (l *Locator) GetUserAccessPoint(ctx context.Context, userIP string) (*api.AccessPoint, error)

GetUserAccessPoint get user access point for special user ip

type SafeMap added in v0.1.11

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

It differs from sync.map by the addition of the len() function sync.map can not delete item on range

func NewSafeMap added in v0.1.11

func NewSafeMap() *SafeMap

func (*SafeMap) Delete added in v0.1.11

func (sm *SafeMap) Delete(key interface{})

func (*SafeMap) Get added in v0.1.11

func (sm *SafeMap) Get(key interface{}) (interface{}, bool)

func (*SafeMap) Len added in v0.1.11

func (sm *SafeMap) Len() int

func (*SafeMap) Range added in v0.1.11

func (sm *SafeMap) Range(callback func(key interface{}, value interface{}))

can not call any SafeMap func in callback, it will block anything

func (*SafeMap) Set added in v0.1.11

func (sm *SafeMap) Set(key interface{}, value interface{})

type SchedulerAPI added in v0.1.14

type SchedulerAPI struct {
	api.Scheduler
	// contains filtered or unexported fields
}

type SchedulerAPIMap added in v0.1.14

type SchedulerAPIMap map[string]*SchedulerAPI

type Storage

type Storage interface {
	GetSchedulerConfigs(areaID string) ([]*types.SchedulerCfg, error)
	GetAllSchedulerConfigs() []*types.SchedulerCfg
}

type TXTRecord added in v0.1.11

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

Jump to

Keyboard shortcuts

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