importer

package
v0.0.0-...-e1bf539 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFormat

func RegisterFormat(name, contentType string, parser Parse)

Types

type Parse

type Parse func(reader io.Reader) ([]*SpotifySong, error)

type PipelineState

type PipelineState struct {
	Id             string
	ProcessedSongs chan *SpotifySong
	Stats          PipelineStats
	StartTime      time.Time
	// contains filtered or unexported fields
}

func GetRunningPipeline

func GetRunningPipeline(id string) *PipelineState

func Process

func Process(context *echo.Context, songs []*SpotifySong) (*PipelineState, error)

func RunImportPipeline

func RunImportPipeline(context *echo.Context, contentType string, reader io.Reader) (*PipelineState, error)

func (*PipelineState) CacheAlbumId

func (p *PipelineState) CacheAlbumId(album string, artist string, albumId string)

func (*PipelineState) CreateSubscriber

func (p *PipelineState) CreateSubscriber() chan *ProgressMessage

func (*PipelineState) GetCachedAlbumId

func (p *PipelineState) GetCachedAlbumId(album string, artist string) (string, bool)

func (*PipelineState) GetSubscribers

func (p *PipelineState) GetSubscribers() []chan *ProgressMessage

func (*PipelineState) RemoveSubscriber

func (p *PipelineState) RemoveSubscriber(s chan *ProgressMessage)

type PipelineStats

type PipelineStats struct {
	ImportSize      int
	FoundAlbums     int
	FoundTracks     int
	TotalFound      int
	NotFound        int
	Errors          int
	LimitExceeded   bool
	ProgressPercent float64
}

type ProgressMessage

type ProgressMessage struct {
	Stats        PipelineStats
	NotFoundSong *SpotifySong
}

type SpotifySong

type SpotifySong struct {
	Name           string
	Artist         string
	Album          string
	SpotifyAlbumId string
	SpotifyTrackId string
	ImportError    error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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