arbitrage

package
v0.0.0-...-c5679b9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilesToList

func FilesToList(files []File) string

func HashDefault

func HashDefault(r *Release)

func HashFileList

func HashFileList(files []File) string

func HashReducedList

func HashReducedList(files []File) string

func Pad

func Pad(id int) string

func RoundBytes

func RoundBytes(b int64) int64

Types

type ByName

type ByName []File

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type File

type File struct {
	Name string
	Size int64
}

func ParseFileList

func ParseFileList(filestr string) []File

type Info

type Info struct {
	Version     int                    `yaml:"version"`
	FileHash    string                 `yaml:"file_hash"`
	LastUpdated time.Time              `yaml:"last_updated"`
	Releases    map[string]InfoRelease `yaml:"releases,omitempty"`
}

type InfoRelease

type InfoRelease struct {
	TorrentId int    `yaml:"torrent_id"`
	Format    string `yaml:"format"`
	FilePath  string `yaml:"file_path"`

	Name            string `yaml:"name"`
	Year            int    `yaml:"year"`
	RecordLabel     string `yaml:"record_label"`
	CatalogueNumber string `yaml:"catalogue_number"`
	Edition         string `yaml:"edition"`

	Composers []string `yaml:"composers,omitempty,flow"`
	Artists   []string `yaml:"artists"`
	With      []string `yaml:"with,omitempty,flow"`
	DJ        []string `yaml:"dj,omitempty,flow"`
	RemixedBy []string `yaml:"remixed_by,omitempty,flow"`
	Producer  []string `yaml:"producer,omitempty,flow"`

	Tags        []string `yaml:"tags,flow"`
	Description string   `yaml:"description,omitempty"`
	Image       string   `yaml:"image,omitempty"`
}

func (InfoRelease) String

func (i InfoRelease) String() string

type Release

type Release struct {
	Id       int64  `json:"-"`
	Source   string `json:"source"`
	SourceId int64  `json:"source_id" gorm:"index"`

	HashType string `json:"hash_type"`
	Hash     string `json:"hash" gorm:"index"`

	FileList []File `json:"fileList,omitempty" sql:"-"`
	FilePath string `json:"filePath" gorm:"type:text"`
	Time     string `json:"time"`
}

func FromFile

func FromFile(root string) (*Release, error)

type Response

type Response struct {
	Id         int64     `json:"-"`
	Source     string    `json:"source"`
	Type       string    `json:"type"`
	Identifier string    `json:"string"`
	TypeId     int       `json:"type_id"`
	Response   string    `gorm:"type:text"`
	Time       time.Time `json:"time"`
}

func (Response) String

func (resp Response) String() string

func (*Response) UID

func (resp *Response) UID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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