Documentation
¶
Index ¶
- Constants
- Variables
- type Artist
- type Company
- type CopyFromDump
- type CopyFromRecordChannel
- type Dump
- type DumpFilename
- type ExtraArtist
- type Identifier
- type Label
- type Master
- type MasterArtist
- type MasterID
- type MultiTableXMLParser
- type Name
- type Release
- func (r Release) ArtistsColumns() []string
- func (r Release) Columns() []string
- func (r Release) ExtraArtistsColumns() []string
- func (r Release) LabelsColumns() []string
- func (r *Release) ToArtistsRecords() [][]any
- func (r *Release) ToExtraArtistsRecords() [][]any
- func (r *Release) ToLabelsRecords() [][]any
- func (r *Release) ToRecord() []any
- type ReleaseFormat
- type ReleaseLabel
- type Serie
- type SubLabel
- type Track
- type Video
Constants ¶
const ( ModeArtists = iota ModeArtistsAliases ModeArtistsMemberships ModeLabels ModeMasters ModeMastersArtists ModeReleases ModeReleasesArtists ModeReleasesExtraArtists ModeReleasesLabels )
Variables ¶
var Modes = []int{ ModeArtists, ModeArtistsAliases, ModeArtistsMemberships, ModeLabels, ModeMasters, ModeMastersArtists, ModeReleases, ModeReleasesArtists, ModeReleasesExtraArtists, ModeReleasesLabels, }
var Tables = map[int]pgx.Identifier{ ModeArtists: pgx.Identifier{"discogs_artists"}, ModeArtistsAliases: pgx.Identifier{"discogs_artists_aliases"}, ModeArtistsMemberships: pgx.Identifier{"discogs_artists_members"}, ModeLabels: pgx.Identifier{"discogs_labels"}, ModeMasters: pgx.Identifier{"discogs_masters"}, ModeMastersArtists: pgx.Identifier{"discogs_master_artists"}, ModeReleases: pgx.Identifier{"discogs_releases"}, ModeReleasesArtists: pgx.Identifier{"discogs_release_artists"}, ModeReleasesExtraArtists: pgx.Identifier{"discogs_release_extra_artists"}, ModeReleasesLabels: pgx.Identifier{"discogs_release_labels"}, }
Functions ¶
This section is empty.
Types ¶
type Artist ¶
type Artist struct {
ID int64 `xml:"id"`
Name string `xml:"name"`
RealName string `xml:"realname"`
Profile string `xml:"profile"`
DataQuality string `xml:"data_quality"`
URLs []string `xml:"urls>url"`
Aliases []Name `xml:"aliases>name"`
NameVariations []string `xml:"namevariations>name"`
Members []Name `xml:"members>name"`
Groups []Name `xml:"groups>name"`
}
func (Artist) AliasesColumns ¶
func (Artist) MembershipsColumns ¶
func (*Artist) ToAliasesRecords ¶
func (*Artist) ToMembershipsRecords ¶
type CopyFromDump ¶
type CopyFromDump struct {
// contains filtered or unexported fields
}
func NewCopyFromDump ¶
func NewCopyFromDump(filename string, mode int) (ds *CopyFromDump, err error)
NewCopyFromDump opens a Discogs dump file and returns a CopyFromDump.
func (*CopyFromDump) Close ¶
func (ds *CopyFromDump) Close() error
func (*CopyFromDump) Columns ¶
func (ds *CopyFromDump) Columns() []string
func (*CopyFromDump) Err ¶
func (ds *CopyFromDump) Err() error
See pgx.CopyFromSource interface for more details.
func (*CopyFromDump) Next ¶
func (ds *CopyFromDump) Next() bool
Next returns true if there is another row and makes the next row data available to Values(). When there are no more rows available or an error has occurred it returns false. See pgx.CopyFromSource interface for more details.
func (*CopyFromDump) Table ¶
func (ds *CopyFromDump) Table() pgx.Identifier
Table returns the name of the table the data should be copied to.
func (*CopyFromDump) Values ¶
func (ds *CopyFromDump) Values() (value []any, err error)
Values returns the values for the current row. See pgx.CopyFromSource interface for more details.
type CopyFromRecordChannel ¶
type CopyFromRecordChannel struct {
// contains filtered or unexported fields
}
CopyFromRecordChannel implements pgx.CopyFromSource for channel-based data
func NewCopyFromRecordChannel ¶
func NewCopyFromRecordChannel(recordChan <-chan []any) *CopyFromRecordChannel
func (*CopyFromRecordChannel) Err ¶
func (c *CopyFromRecordChannel) Err() error
func (*CopyFromRecordChannel) Next ¶
func (c *CopyFromRecordChannel) Next() bool
func (*CopyFromRecordChannel) Values ¶
func (c *CopyFromRecordChannel) Values() ([]any, error)
type Dump ¶
Dump is a wrapper around a discogs dump file. Dump implements the io.ReadCloser interface.
func OpenDumpFile ¶
OpenDiscogsDump creates a new DiscogsDump.
type DumpFilename ¶
type DumpFilename string
func (DumpFilename) Gzipped ¶
func (fn DumpFilename) Gzipped() bool
func (DumpFilename) Month ¶
func (fn DumpFilename) Month() string
func (DumpFilename) String ¶
func (fn DumpFilename) String() string
func (DumpFilename) Type ¶
func (fn DumpFilename) Type() string
func (DumpFilename) Year ¶
func (fn DumpFilename) Year() string
type ExtraArtist ¶
type Identifier ¶
type Label ¶
type Master ¶
type Master struct {
ID int64 `xml:"id,attr"`
Artists []MasterArtist `xml:"artists>artist"`
MainRelease int64 `xml:"mainrelease"`
DataQuality string `xml:"data_quality"`
Videos []Video `xml:"videos>video"`
Title string `xml:"title"`
Year int32 `xml:"year"`
Genres []string `xml:"genres>genre"`
Styles []string `xml:"styles>style"`
}
func (Master) ArtistsColumns ¶
func (*Master) ToArtistsRecords ¶
type MasterArtist ¶
type MultiTableXMLParser ¶
type MultiTableXMLParser struct {
// contains filtered or unexported fields
}
MultiTableXMLParser parses XML once and distributes records to multiple channels
func NewMultiTableXMLParser ¶
func (*MultiTableXMLParser) Close ¶
func (p *MultiTableXMLParser) Close() error
func (*MultiTableXMLParser) ParseAndDistribute ¶
func (p *MultiTableXMLParser) ParseAndDistribute() error
type Release ¶
type Release struct {
ID int64 `xml:"id,attr"`
MasterID MasterID `xml:"master_id"`
Status string `xml:"status,attr"`
Artists []MasterArtist `xml:"artists"`
ExtraArtists []ExtraArtist `xml:"extraartists>artist"`
Title string `xml:"title"`
Labels []ReleaseLabel `xml:"labels>label"`
Country string `xml:"country"`
Released string `xml:"released"`
Notes string `xml:"notes"`
DataQuality string `xml:"data_quality"`
Genres []string `xml:"genres>genre"`
Styles []string `xml:"styles>style"`
Identifiers []Identifier `xml:"identifiers>identifier"`
Videos []Video `xml:"videos>video"`
Formats []ReleaseFormat `xml:"formats>format"`
Tracklist []Track `xml:"tracklist>track"`
Companies []Company `xml:"companies>company"`
Series []Serie `xml:"series>serie"`
}