Documentation ¶
Index ¶
- Constants
- func AssetDatastore(db *db.SQLDB, serverID dtypes.ServerID) (dtypes.AssetMetadataDS, error)
- func CheckFdLimit() error
- func GenerateTokenWithWebPermission(ca *common.CommonAPI) (dtypes.PermissionWebToken, error)
- func LockedRepo(lr repo.LockedRepo) func(lc fx.Lifecycle) repo.LockedRepo
- func NewAssetManager(params AssetManagerParams) *assets.Manager
- func NewAssetsManager(ctx context.Context, pullerConfig *config.Puller, ipfsAPIURL string) ...
- func NewContainerManager(mctx helpers.MetricsCtx, l fx.Lifecycle, nm *node.Manager, db *db.SQLDB, ...) *container.Manager
- func NewDB(cfg *config.SchedulerCfg) (*sqlx.DB, error)
- func NewDataSync(assetMgr *asset.Manager) *datasync.DataSync
- func NewDevice(cpu *config.CPU, memory *config.Memory, storageCfg *config.Storage, ...) func(nodeID dtypes.NodeID, internalIP dtypes.InternalIP, ...) *device.Device
- func NewGetSchedulerConfigFunc(r repo.LockedRepo) func() (config.SchedulerCfg, error)
- func NewLocatorStorage(addresses dtypes.EtcdAddresses) (locator.Storage, error)
- func NewNodeStorageManager(metadataPaths dtypes.NodeMetadataPath, assetsPaths dtypes.AssetsPaths, ...) (*storage.Manager, error)
- func NewNodeValidation(assetMgr *asset.Manager, device *device.Device) *validation.Validation
- func NewPrivateKey(lr repo.LockedRepo) (*rsa.PrivateKey, error)
- func NewProjectManager(params ProjectManagerParams) *projects.Manager
- func NewPubSub() *pubsub.PubSub
- func NewRateLimiter(device *device.Device) *types.RateLimiter
- func NewRegion(dbPath dtypes.GeoDBPath) (region.Region, error)
- func NewSchedulerAPIMap() (locator.SchedulerAPIMap, error)
- func NewServerID(lr repo.LockedRepo) (dtypes.ServerID, error)
- func NewSetSchedulerConfigFunc(r repo.LockedRepo) func(config.SchedulerCfg) error
- func NewTCPServer(lc fx.Lifecycle, cfg *config.CandidateCfg, schedulerAPI api.Scheduler, ...) *candidate.TCPServer
- func NewValidation(mctx helpers.MetricsCtx, l fx.Lifecycle, nm *node.Manager, am *assets.Manager, ...) *validation.Manager
- func NewWorkerd(mctx helpers.MetricsCtx, l fx.Lifecycle, schedulerAPI api.Scheduler, ...) (*workerd.Workerd, error)
- func ProjectDatastore(db *db.SQLDB, serverID dtypes.ServerID) (dtypes.AssetMetadataDS, error)
- func RegisterToEtcd(mctx helpers.MetricsCtx, lc fx.Lifecycle, ...) (*etcdcli.Client, error)
- func WorkerdPath(lr repo.LockedRepo) dtypes.WorkerdPath
- type AssetManagerParams
- type ProjectManagerParams
Constants ¶
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
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 NewContainerManager ¶ added in v0.1.21
func NewDB ¶
func NewDB(cfg *config.SchedulerCfg) (*sqlx.DB, error)
NewDB returns an *sqlx.DB instance
func NewDataSync ¶
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 NewRateLimiter ¶
func NewRateLimiter(device *device.Device) *types.RateLimiter
NewRateLimiter creates a new rate limiter based on the given device's bandwidth limits.
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 ¶
func NewValidation(mctx helpers.MetricsCtx, l fx.Lifecycle, nm *node.Manager, am *assets.Manager, configFunc dtypes.GetSchedulerConfigFunc, p *pubsub.PubSub, lmgr *leadership.Manager) *validation.Manager
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 *tunclient.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
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