Documentation
¶
Index ¶
- Constants
- Variables
- type Artist
- func (a Artist) AliasesColumns() []string
- func (a Artist) Columns() []string
- func (a Artist) MembershipsColumns() []string
- func (a *Artist) ToAliasesRecords() [][]any
- func (a *Artist) ToMembershipsRecords() [][]any
- func (a *Artist) ToRecord() []any
- func (a *Artist) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type Company
- type CopyFromDump
- type CopyFromRecordChannel
- type Dump
- type DumpFilename
- type ExtraArtist
- type Identifier
- type Label
- type Master
- type MasterArtist
- 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
- func (r *Release) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type ReleaseFormat
- type ReleaseLabel
- type Serie
- type SubLabel
- type SubTrack
- 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 {
// contains filtered or unexported fields
}
func (Artist) AliasesColumns ¶
func (Artist) MembershipsColumns ¶
func (*Artist) ToAliasesRecords ¶
func (*Artist) ToMembershipsRecords ¶
func (*Artist) UnmarshalXML ¶ added in v0.3.0
type Company ¶
type Company struct {
ID int64 `xml:"id" json:"id" parquet:"id,zstd"`
Name string `xml:"name" json:"name" parquet:"name,zstd"`
EntityType int64 `xml:"entity_type" json:"entity_type" parquet:"entity_type,zstd"`
EntityTypeName string `xml:"entity_type_name" json:"entity_type_name" parquet:"entity_type_name,zstd"`
ResourceURL string `xml:"resource_url" json:"resource_url" parquet:"resource_url,zstd"`
Catno *string `xml:"catno" json:"catno" parquet:"catno,zstd"`
}
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.
func (*Dump) DecodeNextElement ¶ added in v0.2.0
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 Label struct {
ParentLabelID *int64 `json:"parent_label_id" parquet:"parent_label_id,zstd"`
// contains filtered or unexported fields
}
func (*Label) UnmarshalXML ¶ added in v0.2.0
type Master ¶
type Master struct {
// contains filtered or unexported fields
}
func (Master) ArtistsColumns ¶
func (*Master) ToArtistsRecords ¶
func (*Master) UnmarshalXML ¶ added in v0.2.0
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 {
MasterID *int64 `parquet:"master_id"`
IsMainRelease bool `parquet:"is_main_release,zstd"`
// contains filtered or unexported fields
}
func (Release) ArtistsColumns ¶
func (Release) ExtraArtistsColumns ¶
func (Release) LabelsColumns ¶
func (*Release) ToArtistsRecords ¶
func (*Release) ToExtraArtistsRecords ¶
func (*Release) ToLabelsRecords ¶
func (*Release) UnmarshalXML ¶ added in v0.2.0
type ReleaseFormat ¶
type ReleaseFormat struct {
Name string `xml:"name,attr" json:"name" parquet:"name,zstd"`
Qty string `xml:"qty,attr" json:"qty" parquet:"qty,zstd"`
Text string `xml:"text,attr" json:"text" parquet:"text,zstd"`
Descriptions []string `xml:"descriptions>description" json:"descriptions" parquet:"descriptions,zstd"`
}
type ReleaseLabel ¶
type SubTrack ¶ added in v0.2.0
type SubTrack struct {
Position *string `xml:"position" json:"position" parquet:"position,dict"`
Title string `xml:"title" json:"title" parquet:"title,zstd"`
Duration *string `xml:"duration" json:"duration" parquet:"duration,zstd"`
Artists []*MasterArtist `xml:"artists>artist" json:"artists" parquet:"artists"`
ExtraArtists []*ExtraArtist `xml:"extraartists>artist" json:"extra_artists" parquet:"extra_artists"`
}
type Track ¶
type Track struct {
Position *string `xml:"position" json:"position" parquet:"position,dict"`
Title string `xml:"title" json:"title" parquet:"title,zstd"`
Duration *string `xml:"duration" json:"duration" parquet:"duration,zstd"`
Artists []*MasterArtist `xml:"artists>artist" json:"artists" parquet:"artists"`
ExtraArtists []*ExtraArtist `xml:"extraartists>artist" json:"extra_artists" parquet:"extra_artists"`
SubTracks []*SubTrack `xml:"sub_tracks>track" json:"sub_tracks" parquet:"sub_tracks"`
}
type Video ¶
type Video struct {
Src string `xml:"src,attr" json:"src" parquet:"src,zstd"`
Duration int32 `xml:"duration,attr" json:"duration" parquet:"duration,zstd"`
Embed string `xml:"embed,attr" json:"embed" parquet:"embed,dict"`
Title string `xml:"title" json:"title" parquet:"title,zstd"`
Description string `xml:"description" json:"description" parquet:"description,zstd"`
}