manager

package
v1.0.4-0...-ef62242 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending        = "pending"        // waiting for permission to sync
	StatusPendingEmail   = "pendingemail"   // permission granted but missing email
	StatusQueued         = "queued"         // in sync queue. will be synced soon
	StatusPendingUpgrade = "pendingupgrade" // in sync queue. will be synced soon
	StatusSyncing        = "syncing"        // syncing now
	StatusSynced         = "synced"         // done
	StatusFailed         = "failed"
	StatusFinalized      = "finalized" // no more changes allowed
	StatusAbandoned      = "abandoned" // deleted on youtube or banned
)
View Source
const (
	VideoStatusPublished     = "published"
	VideoStatusFailed        = "failed"
	VideoStatusUpgradeFailed = "upgradefailed"
	VideoStatusUnpublished   = "unpublished"
	VideoStatusTranferFailed = "transferfailed"
)
View Source
const (
	TransferStateNotTouched = iota
	TransferStatePending
	TransferStateComplete
	TransferStateManual
)
View Source
const LatestMetadataVersion = 2

Variables

Functions

func GetUsedSpace

func GetUsedSpace(path string) (float32, error)

GetUsedSpace returns a value between 0 and 1, with 0 being completely empty and 1 being full, for the disk that holds the provided path

Types

type Sync

type Sync struct {
	APIConfig        *sdk.APIConfig
	YoutubeChannelID string
	LbryChannelName  string
	MaxTries         int
	ConcurrentVideos int
	Refill           int
	Manager          *SyncManager
	LbrycrdString    string
	AwsS3ID          string
	AwsS3Secret      string
	AwsS3Region      string
	AwsS3Bucket      string
	Fee              *sdk.Fee
	// contains filtered or unexported fields
}

Sync stores the options that control how syncing happens

func (*Sync) AppendSyncedVideo

func (s *Sync) AppendSyncedVideo(videoID string, published bool, failureReason string, claimName string, claimID string, metadataVersion int8, size int64)

func (*Sync) CountVideos

func (s *Sync) CountVideos() (uint64, error)

func (*Sync) FullCycle

func (s *Sync) FullCycle() (e error)

func (*Sync) GenerateRegtestBlock

func (s *Sync) GenerateRegtestBlock() error

func (*Sync) IsInterrupted

func (s *Sync) IsInterrupted() bool

IsInterrupted can be queried to discover if the sync process was interrupted manually

type SyncManager

type SyncManager struct {
	SyncFlags sdk.SyncFlags
	// contains filtered or unexported fields
}

func NewSyncManager

func NewSyncManager(syncFlags sdk.SyncFlags, maxTries int, refill int, limit int, concurrentJobs int, concurrentVideos int, blobsDir string, videosLimit int,
	maxVideoSize int, lbrycrdString string, awsS3ID string, awsS3Secret string, awsS3Region string, awsS3Bucket string,
	syncStatus string, syncProperties *sdk.SyncProperties, apiConfig *sdk.APIConfig, maxVideoLength float64) *SyncManager

func (*SyncManager) GetS3AWSConfig

func (s *SyncManager) GetS3AWSConfig() aws.Config

func (*SyncManager) Start

func (s *SyncManager) Start() error

Jump to

Keyboard shortcuts

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