Documentation ¶
Index ¶
- Constants
- func ACAOHeaderOverwriteMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func Resized(ext string, read io.ReadSeeker, width, height int, mode string) (resized io.ReadSeeker, w int, h int)
- type AudioAnalysisResult
- type BlobMetric
- type BlobMetrics
- type ByteRange
- type ContactResponse
- type DailyMetrics
- type DelistEntity
- type DelistStatus
- type FFProbeResult
- type HostAttrSniff
- type HostTuple
- type HostTuples
- type JobTemplate
- type MediorumConfig
- type MediorumServer
- type Metrics
- type MonthlyMetrics
- type Peer
- type PeerHealth
- type QmAudioAnalysis
- type RendezvousHasher
- type RepairTracker
- type StorageAndDbSize
- type UpdateUploadBody
- type Upload
- type UploadCursor
- type VersionJson
Constants ¶
View Source
const ( JobStatusNew = "new" JobStatusError = "error" JobStatusBusy = "busy" JobStatusTimeout = "timeout" JobStatusRetranscode = "retranscode_preview" JobStatusBusyRetranscode = "busy_retranscode_preview" JobStatusErrorRetranscode = "error_retranscode_preview" JobStatusAudioAnalysis = "audio_analysis" JobStatusBusyAudioAnalysis = "busy_audio_analysis" JobStatusDone = "done" )
Job statuses
View Source
const ( StreamTrack string = "stream_track" ServeImage string = "serve_image" )
Metric actions
View Source
const ( DelistStatusPollingInterval = 20 * time.Second HTTPTimeout = 5 * time.Minute DelistBatchSize = 5000 TimeFormat = "2006-01-02 15:04:05.999999-07" Tracks DelistEntity = "tracks" Users DelistEntity = "users" )
View Source
const AUTO = -1
View Source
const MAX_TRIES = 3
View Source
const PercentSeededThreshold = 50
View Source
const PullLimit = 10000
Variables ¶
This section is empty.
Functions ¶
func ACAOHeaderOverwriteMiddleware ¶
func ACAOHeaderOverwriteMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Types ¶
type AudioAnalysisResult ¶
type BlobMetric ¶
type BlobMetrics ¶
type BlobMetrics struct {
Data []BlobMetric `json:"data"`
}
type ContactResponse ¶
type ContactResponse struct {
Email string `json:"email"`
}
type DailyMetrics ¶
type DelistEntity ¶
type DelistEntity string
type DelistStatus ¶
type DelistStatus struct { CreatedAt time.Time `json:"-"` Delisted bool `json:"delisted"` Reason string `json:"reason"` // fields specific to TrackDelistStatus TrackID int `json:"trackId,omitempty"` TrackCID string `json:"trackCid,omitempty"` OwnerID int `json:"ownerId,omitempty"` // field specific to UserDelistStatus UserID int `json:"userId,omitempty"` }
func (*DelistStatus) UnmarshalJSON ¶
func (ds *DelistStatus) UnmarshalJSON(data []byte) error
type FFProbeResult ¶
type HostAttrSniff ¶
type HostAttrSniff struct { Host string Attr *blob.Attributes RendezvousRank int }
type HostTuples ¶
type HostTuples []HostTuple
func (HostTuples) Len ¶
func (s HostTuples) Len() int
func (HostTuples) Less ¶
func (s HostTuples) Less(i, j int) bool
func (HostTuples) Swap ¶
func (s HostTuples) Swap(i, j int)
type JobTemplate ¶
type JobTemplate string
Upload templates
const ( JobTemplateAudio JobTemplate = "audio" JobTemplateImgSquare JobTemplate = "img_square" JobTemplateImgBackdrop JobTemplate = "img_backdrop" )
type MediorumConfig ¶
type MediorumConfig struct { Env string Self Peer Peers []Peer Signers []Peer ReplicationFactor int Dir string `default:"/tmp/mediorum"` BlobStoreDSN string `json:"-"` MoveFromBlobStoreDSN string `json:"-"` PostgresDSN string `json:"-"` PrivateKey string `json:"-"` ListenPort string TrustedNotifierID int SPID int SPOwnerWallet string GitSHA string AudiusDockerCompose string AutoUpgradeEnabled bool WalletIsRegistered bool StoreAll bool VersionJson VersionJson DiscoveryListensEndpoints []string CoreGRPCEndpoint string CoreJRPCEndpoint string // contains filtered or unexported fields }
type MediorumServer ¶
type MediorumServer struct { StartedAt time.Time Config MediorumConfig // contains filtered or unexported fields }
func New ¶
func New(config MediorumConfig) (*MediorumServer, error)
func (*MediorumServer) MustStart ¶
func (ss *MediorumServer) MustStart()
func (*MediorumServer) Stop ¶
func (ss *MediorumServer) Stop()
type MonthlyMetrics ¶
type PeerHealth ¶
type QmAudioAnalysis ¶
type QmAudioAnalysis struct { CID string `json:"cid" gorm:"primaryKey;column:cid"` Mirrors []string `json:"mirrors" gorm:"serializer:json"` Status string `json:"status"` Error string `json:"error,omitempty"` ErrorCount int `json:"error_count"` AnalyzedBy string `json:"analyzed_by"` AnalyzedAt time.Time `json:"analyzed_at"` Results *AudioAnalysisResult `json:"results" gorm:"serializer:json"` }
type RendezvousHasher ¶
type RendezvousHasher struct {
// contains filtered or unexported fields
}
func NewRendezvousHasher ¶
func NewRendezvousHasher(hosts []string) *RendezvousHasher
func (*RendezvousHasher) Rank ¶
func (rh *RendezvousHasher) Rank(key string) []string
type RepairTracker ¶
type RepairTracker struct { StartedAt time.Time `gorm:"primaryKey;not null"` UpdatedAt time.Time `gorm:"not null"` FinishedAt time.Time CleanupMode bool `gorm:"not null"` CursorI int `gorm:"not null"` CursorUploadID string `gorm:"not null"` CursorQmCID string `gorm:"not null"` Counters map[string]int `gorm:"not null;serializer:json"` ContentSize int64 `gorm:"not null"` Duration time.Duration `gorm:"not null"` AbortedReason string `gorm:"not null"` }
type StorageAndDbSize ¶
type StorageAndDbSize struct { LoggedAt time.Time `gorm:"primaryKey;not null"` Host string `gorm:"primaryKey;not null"` StorageBackend string `gorm:"not null"` DbUsed uint64 `gorm:"not null"` MediorumDiskUsed uint64 `gorm:"not null"` MediorumDiskSize uint64 `gorm:"not null"` LastRepairSize int64 `gorm:"not null"` LastCleanupSize int64 `gorm:"not null"` }
type UpdateUploadBody ¶
type UpdateUploadBody struct {
PreviewStartSeconds string `json:"previewStartSeconds"`
}
type Upload ¶
type Upload struct { ID string `json:"id"` // base32 file hash UserWallet sql.NullString `json:"user_wallet"` Template JobTemplate `json:"template"` OrigFileName string `json:"orig_filename"` OrigFileCID string `json:"orig_file_cid" gorm:"column:orig_file_cid;index:idx_uploads_orig_file_cid"` // SelectedPreview sql.NullString `json:"selected_preview"` FFProbe *FFProbeResult `json:"probe" gorm:"serializer:json"` Error string `json:"error,omitempty"` ErrorCount int `json:"error_count,omitempty"` Mirrors []string `json:"mirrors" gorm:"serializer:json"` TranscodedMirrors []string `json:"transcoded_mirrors" gorm:"serializer:json"` Status string `json:"status" gorm:"index"` PlacementHosts []string `json:"placement_hosts" gorm:"serializer:json"` CreatedBy string `json:"created_by" ` CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime:false"` UpdatedAt time.Time `json:"updated_at" gorm:"autoCreateTime:false"` TranscodedBy string `json:"transcoded_by"` TranscodeProgress float64 `json:"transcode_progress"` TranscodedAt time.Time `json:"transcoded_at"` TranscodeResults map[string]string `json:"results" gorm:"serializer:json"` AudioAnalysisStatus string `json:"audio_analysis_status"` AudioAnalysisError string `json:"audio_analysis_error,omitempty"` AudioAnalysisErrorCount int `json:"audio_analysis_error_count"` AudioAnalyzedBy string `json:"audio_analyzed_by"` AudioAnalyzedAt time.Time `json:"audio_analyzed_at"` AudioAnalysisResults *AudioAnalysisResult `json:"audio_analysis_results" gorm:"serializer:json"` }
type UploadCursor ¶
type VersionJson ¶
Source Files ¶
- audio_analysis.go
- core.go
- db.go
- delist_statuses.go
- helpers.go
- monitor.go
- peer_health.go
- peer_req.go
- placement.go
- qm_fix_truncated.go
- qm_sync.go
- repair.go
- replicate.go
- serve_blob.go
- serve_contact.go
- serve_crud.go
- serve_health.go
- serve_image.go
- serve_metrics.go
- serve_upload.go
- server.go
- server_basic_auth.go
- sniff.go
- transcode.go
- upload_client.go
- version.go
Click to show internal directories.
Click to hide internal directories.