modules

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServerIDName Server ID key name in the keystore
	ServerIDName = "server-id" //nolint:gosec
	// KTServerIDSecret Key type for server ID secret
	KTServerIDSecret = "server-id-secret" //nolint:gosec
	// PrivateKeyName privateKey key name in the keystore
	PrivateKeyName = "private-key" //nolint:gosec
	// WorkerdPath is the directory path for Workerd's workspace
	WorkerdDirPath = "workerd"
)

Variables

This section is empty.

Functions

func AssetDatastore added in v0.1.19

func AssetDatastore(db *db.SQLDB, serverID dtypes.ServerID) (dtypes.AssetMetadataDS, error)

AssetDatastore returns a new metadata datastore

func CheckFdLimit

func CheckFdLimit() error

CheckFdLimit checks the file descriptor limit and returns an error if the limit is too low

func GenerateTokenWithWebPermission added in v0.1.10

func GenerateTokenWithWebPermission(ca *common.CommonAPI) (dtypes.PermissionWebToken, error)

GenerateTokenWithWebPermission create a new token based on the given permissions

func LockedRepo

func LockedRepo(lr repo.LockedRepo) func(lc fx.Lifecycle) repo.LockedRepo

LockedRepo returns a function that returns the locked repository with an added lifecycle hook to close the repository

func NewAssetManager added in v0.1.19

func NewAssetManager(params AssetManagerParams) *assets.Manager

NewAssetManager creates a new storage manager instance

func NewAssetsManager

func NewAssetsManager(ctx context.Context, pullerConfig *config.Puller, ipfsAPIURL string) func(storageMgr *storage.Manager, schedulerAPI api.Scheduler, rateLimiter *types.RateLimiter) (*asset.Manager, error)

NewAssetsManager creates a function that generates new instances of asset.Manager.

func NewDB

func NewDB(cfg *config.SchedulerCfg) (*sqlx.DB, error)

NewDB returns an *sqlx.DB instance

func NewDataSync

func NewDataSync(assetMgr *asset.Manager) *datasync.DataSync

NewDataSync creates a new instance of datasync.DataSync with the given asset.Manager.

func NewDevice

func NewDevice(cpu *config.CPU, memory *config.Memory, storageCfg *config.Storage, bandwidth *config.Bandwidth, netflow *config.Netflow) func(nodeID dtypes.NodeID, internalIP dtypes.InternalIP, storageMgr *storage.Manager) *device.Device

NewDevice creates a function that generates new instances of device.Device.

func NewGetSchedulerConfigFunc

func NewGetSchedulerConfigFunc(r repo.LockedRepo) func() (config.SchedulerCfg, error)

NewGetSchedulerConfigFunc creates a function to get the scheduler config

func NewLocatorStorage

func NewLocatorStorage(addresses dtypes.EtcdAddresses) (locator.Storage, error)

NewLocatorStorage creates a locator storage using the give addresses

func NewNodeStorageManager

func NewNodeStorageManager(metadataPaths dtypes.NodeMetadataPath, assetsPaths dtypes.AssetsPaths, minioConfig *config.MinioConfig, schedulerAPI api.Scheduler) (*storage.Manager, error)

NewNodeStorageManager creates a new instance of storage.Manager with the given carfile store path.

func NewNodeValidation

func NewNodeValidation(assetMgr *asset.Manager, device *device.Device) *validation.Validation

NewNodeValidation creates a new instance of validation.Validation with the given asset.Manager and device.Device.

func NewPrivateKey added in v0.1.11

func NewPrivateKey(lr repo.LockedRepo) (*rsa.PrivateKey, error)

NewPrivateKey generates and returns the private key

func NewProjectManager added in v0.1.19

func NewProjectManager(params ProjectManagerParams) *projects.Manager

NewProjectManager creates a new project manager instance

func NewPubSub

func NewPubSub() *pubsub.PubSub

NewPubSub returns a new pubsub instance with a buffer of 50

func NewRateLimiter

func NewRateLimiter(device *device.Device) *types.RateLimiter

NewRateLimiter creates a new rate limiter based on the given device's bandwidth limits.

func NewRegion

func NewRegion(dbPath dtypes.GeoDBPath) (region.Region, error)

NewRegion creates a new region instance using the given database path.

func NewSchedulerAPIMap added in v0.1.14

func NewSchedulerAPIMap() (locator.SchedulerAPIMap, error)

func NewServerID

func NewServerID(lr repo.LockedRepo) (dtypes.ServerID, error)

NewServerID generates and returns the server ID

func NewSetSchedulerConfigFunc

func NewSetSchedulerConfigFunc(r repo.LockedRepo) func(config.SchedulerCfg) error

NewSetSchedulerConfigFunc creates a function to set the scheduler config

func NewTCPServer

func NewTCPServer(lc fx.Lifecycle, cfg *config.CandidateCfg, schedulerAPI api.Scheduler, key *rsa.PrivateKey) *candidate.TCPServer

NewTCPServer returns a new TCP server instance.

func NewValidation

NewValidation creates a new validation manager instance

func NewWorkerd added in v0.1.19

func NewWorkerd(mctx helpers.MetricsCtx, l fx.Lifecycle, schedulerAPI api.Scheduler, ts *tunnel.Services, nodeId dtypes.NodeID, path dtypes.WorkerdPath) (*workerd.Workerd, error)

NewWorkerd creates a new workerd object at the given path.

func ProjectDatastore added in v0.1.19

func ProjectDatastore(db *db.SQLDB, serverID dtypes.ServerID) (dtypes.AssetMetadataDS, error)

ProjectDatastore returns a new metadata datastore

func RegisterToEtcd

func RegisterToEtcd(mctx helpers.MetricsCtx, lc fx.Lifecycle, configFunc dtypes.GetSchedulerConfigFunc, serverID dtypes.ServerID, token dtypes.PermissionWebToken) (*etcdcli.Client, error)

RegisterToEtcd registers the server to etcd

func WorkerdPath added in v0.1.19

func WorkerdPath(lr repo.LockedRepo) dtypes.WorkerdPath

WorkerdPath returns the path for Workerd's workspace based on the provided LockedRepo.

Types

type AssetManagerParams added in v0.1.19

type AssetManagerParams struct {
	fx.In

	Lifecycle      fx.Lifecycle
	MetricsCtx     helpers.MetricsCtx
	MetadataDS     dtypes.AssetMetadataDS
	NodeManger     *node.Manager
	WorkloadManger *workload.Manager
	dtypes.GetSchedulerConfigFunc
	*db.SQLDB
}

AssetManagerParams Manager Params

type ProjectManagerParams added in v0.1.19

type ProjectManagerParams struct {
	fx.In

	Lifecycle      fx.Lifecycle
	MetricsCtx     helpers.MetricsCtx
	MetadataDS     dtypes.ProjectMetadataDS
	NodeManger     *node.Manager
	WorkloadManger *workload.Manager
	dtypes.GetSchedulerConfigFunc
	*db.SQLDB
}

ProjectManagerParams Manager Params

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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