Documentation ¶
Index ¶
- Constants
- func CheckFdLimit() error
- func Datastore(db *db.SQLDB, serverID dtypes.ServerID) (dtypes.MetadataDS, error)
- func GenerateTokenWithWebPermission(ca *common.CommonAPI) (dtypes.PermissionWebToken, error)
- func LockedRepo(lr repo.LockedRepo) func(lc fx.Lifecycle) repo.LockedRepo
- func NewAssetsManager(pullParallel int, pullTimeout int, pullRetry int, ipfsAPIURL string) ...
- func NewDB(cfg *config.SchedulerCfg) (*sqlx.DB, error)
- func NewDataSync(assetMgr *asset.Manager) *datasync.DataSync
- func NewDevice(bandwidthUP, bandwidthDown int64) 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 NewPubSub() *pubsub.PubSub
- func NewRateLimiter(device *device.Device) *rate.Limiter
- func NewRegion(dbPath dtypes.GeoDBPath) (region.Region, error)
- func NewServerID(lr repo.LockedRepo) (dtypes.ServerID, error)
- func NewSetSchedulerConfigFunc(r repo.LockedRepo) func(config.SchedulerCfg) error
- func NewStorageManager(params StorageManagerParams) *assets.Manager
- 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 RegisterToEtcd(mctx helpers.MetricsCtx, lc fx.Lifecycle, ...) (*etcdcli.Client, error)
- type StorageManagerParams
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 )
Variables ¶
This section is empty.
Functions ¶
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 NewAssetsManager ¶
func NewAssetsManager(pullParallel int, pullTimeout int, pullRetry int, ipfsAPIURL string) func(storageMgr *storage.Manager, schedulerAPI api.Scheduler) (*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 ¶
NewDataSync creates a new instance of datasync.DataSync with the given asset.Manager.
func NewDevice ¶
func NewDevice(bandwidthUP, bandwidthDown int64) 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 NewRateLimiter ¶
NewRateLimiter creates a new rate limiter based on the given device's bandwidth limits.
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 NewStorageManager ¶
func NewStorageManager(params StorageManagerParams) *assets.Manager
NewStorageManager creates a new storage manager instance
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 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
Types ¶
type StorageManagerParams ¶
type StorageManagerParams struct { fx.In Lifecycle fx.Lifecycle MetricsCtx helpers.MetricsCtx MetadataDS dtypes.MetadataDS NodeManger *node.Manager dtypes.GetSchedulerConfigFunc *db.SQLDB }
StorageManagerParams Manager Params