locator

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) 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) 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) GetSchedulerWithAPIKey added in v0.1.11

func (l *Locator) GetSchedulerWithAPIKey(ctx context.Context, apiKey string) (string, error)

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