Documentation ¶
Index ¶
- type Album
- type Annotatable
- type Annotation
- type Artist
- type Author
- type Avatar
- type Client
- func (c *Client) GetAccount() (*GeniusResponse, error)
- func (c *Client) GetAnnotation(id string, textFormat string) (*GeniusResponse, error)
- func (c *Client) GetArtist(id int) (*GeniusResponse, error)
- func (c *Client) GetArtistDom(id int) (*GeniusResponse, error)
- func (c *Client) GetArtistHTML(id int) (*GeniusResponse, error)
- func (c *Client) GetArtistPlain(id int) (*GeniusResponse, error)
- func (c *Client) GetArtistSongs(id int, sort string, perPage int, page int) (*GeniusResponse, error)
- func (c *Client) GetLyrics(uri string) (string, error)
- func (c *Client) GetSong(id int) (*Song, error)
- func (c *Client) GetSongDom(id int) (*Song, error)
- func (c *Client) GetSongHTML(id int) (*Song, error)
- func (c *Client) GetSongPlain(id int) (*Song, error)
- func (c *Client) GetSongWithLyrics(id int) (*Song, error)
- func (c *Client) Search(q string) (*GeniusResponse, error)
- type Contributor
- type CustomPerformance
- type Description
- type DescriptionAnnotation
- type Dom
- type Extractor
- type FactTrack
- type GeniusResponse
- type Hit
- type IQByAction
- type Image
- type Media
- type Meta
- type Primary
- type ReleaseDateComponents
- type Response
- type Sections
- type Song
- type SongRelationship
- type Stats
- type User
- type UserMetadata
- type WebPage
- type WithBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotatable ¶
type Annotatable struct { APIPath string `json:"api_path"` Context string `json:"context"` ID int `json:"id"` ImageURL string `json:"image_url"` LinkTitle string `json:"link_title"` Title string `json:"title"` Type string `json:"type"` URL string `json:"url"` ClientTimestamps struct { UpdatedByHumanAt int `json:"updated_by_human_at"` LyricsUpdatedAt int `json:"lyrics_updated_at"` } `json:"client_timestamps"` }
type Annotation ¶
type Annotation struct { WithBody APIPath string `json:"api_path"` CommentCount int `json:"comment_count"` Community bool `json:"community"` CustomPreview string `json:"custom_preview"` HasVoters bool `json:"has_voters"` ID int `json:"id"` Pinned bool `json:"pinned"` Source string `json:"source"` State string `json:"state"` URL string `json:"url"` Verified bool `json:"verified"` VotesTotal int `json:"voters_total"` CurrentUserMetadata *UserMetadata `json:"current_user_metadata"` Authors []*Author `json:"authors"` CosignedBy []string `json:"cosigned_by"` VerifiedBy *User `json:"verified_by"` }
Annotation is annotation on Genius API.
type Artist ¶
type Artist struct { AlternateNames []string `json:"alternate_names"` APIPath string `json:"api_path"` Description *interface{} `json:"description"` FacebookName string `json:"facebook_name"` FollowersCount int `json:"followers_count"` HeaderImageURL string `json:"header_image_url"` ID int `json:"id"` ImageURL string `json:"image_url"` InstagramName string `json:"instagram_name"` IsMemeVerified bool `json:"is_meme_verified"` IsVerified bool `json:"is_verified"` Name string `json:"name"` TwitterName string `json:"twitter_name"` URL string `json:"url"` CurrentUserMetadata *UserMetadata `json:"current_user_metadata"` IQ int `json:"iq"` DescriptionAnnotation *DescriptionAnnotation `json:"description_annotation"` User *User `json:"user"` }
Artist is artist on Genius API.
type Client ¶
type Client struct { AccessToken string // contains filtered or unexported fields }
Client is a client for Genius API.
func NewClient ¶
NewClient creates Client to work with Genius API You can pass http.Client or it will use http.DefaultClient by default
It requires a token for accessing Genius API.
func (*Client) GetAccount ¶
func (c *Client) GetAccount() (*GeniusResponse, error)
GetAccount returns current user account data.
func (*Client) GetAnnotation ¶
func (c *Client) GetAnnotation(id string, textFormat string) (*GeniusResponse, error)
GetAnnotation gets annotation object in response.
func (*Client) GetArtist ¶
func (c *Client) GetArtist(id int) (*GeniusResponse, error)
GetArtist returns Artist object in response Uses "dom" as textFormat by default.
func (*Client) GetArtistDom ¶
func (c *Client) GetArtistDom(id int) (*GeniusResponse, error)
GetArtistDom returns Artist object in response With "dom" as textFormat.
func (*Client) GetArtistHTML ¶
func (c *Client) GetArtistHTML(id int) (*GeniusResponse, error)
GetArtistHTML returns Artist object in response With "html" as textFormat.
func (*Client) GetArtistPlain ¶
func (c *Client) GetArtistPlain(id int) (*GeniusResponse, error)
GetArtistPlain returns Artist object in response With "plain" as textFormat.
func (*Client) GetArtistSongs ¶
func (c *Client) GetArtistSongs(id int, sort string, perPage int, page int) (*GeniusResponse, error)
GetArtistSongs returns array of songs objects in response.
func (*Client) GetSong ¶
GetSong returns Song object in response
Uses "dom" as textFormat by default.
func (*Client) GetSongDom ¶
GetSongDom returns Song object in response With "dom" as textFormat.
func (*Client) GetSongHTML ¶
GetSongHTML returns Song object in response With "html" as textFormat.
func (*Client) GetSongPlain ¶
GetSongPlain returns Song object in response With "plain" as textFormat.
func (*Client) GetSongWithLyrics ¶ added in v0.1.2
type Contributor ¶
type CustomPerformance ¶ added in v0.1.1
type Description ¶ added in v0.1.1
type DescriptionAnnotation ¶
type DescriptionAnnotation struct { Type string `json:"_type"` AnnotatorID int `json:"annotator_id"` AnnotatorLogin string `json:"annotator_login"` APIPath string `json:"api_path"` Classification string `json:"classification"` Fragment string `json:"fragment"` ID int `json:"id"` IsDescription bool `json:"is_description"` Path string `json:"path"` SongID int `json:"song_id"` URL string `json:"url"` VerifiedAnnotatorIDs []int `json:"verified_annotator_ids"` Annotatable *Annotatable `json:"annotatable"` Annotations []*Annotation `json:"annotations"` Range struct { Content string `json:"content"` } `json:"range"` }
type Dom ¶ added in v0.1.1
type Dom struct { Tag string `json:"tag"` Children []interface{} `json:"children"` }
type Extractor ¶ added in v0.1.2
type Extractor struct {
// contains filtered or unexported fields
}
func NewExtractor ¶ added in v0.1.2
type GeniusResponse ¶ added in v0.1.1
GeniusResponse is an actual response object from Genius API Consist links to possible retrievable objects: Artist, Song, etc.
type Hit ¶
type Hit struct { Highlights []interface{} `json:"highlights"` Index string `json:"index"` Type string `json:"type"` Result *Song `json:"result"` }
Hit is a hit on Genius API Used in /search handler Includes song results only.
type IQByAction ¶
type IQByAction struct { Accept struct { Primary *Primary `json:"primary"` } `json:"accept"` Reject struct { Primary *Primary `json:"primary"` } `json:"reject"` Delete struct { Primary *Primary `json:"primary"` } `json:"delete"` EditMetadata struct { Primary *Primary `json:"primary"` } `json:"edit_metadata"` }
type ReleaseDateComponents ¶ added in v0.1.1
type Response ¶
type Response struct { Artist *Artist `json:"artist"` Song *Song `json:"song"` Annotation *Annotation `json:"annotation"` User *User `json:"user"` Songs []*Song `json:"songs"` NextPage int `json:"next_page"` Hits []*Hit `json:"hits"` WebPage *WebPage `json:"web_page"` Sections []Sections `json:"sections"` }
type Song ¶
type Song struct { Type string `json:"_type"` AnnotationCount int `json:"annotation_count"` APIPath string `json:"api_path"` ArtistNames string `json:"artist_names"` Description *interface{} `json:"description"` EmbedContent string `json:"embed_content"` FactTrack *FactTrack `json:"fact_track"` FeaturedVideo bool `json:"features_video"` FullTitle string `json:"full_title"` HeaderImageThumbnailURL string `json:"header_image_thumbnail_url"` HeaderImageURL string `json:"header_image_url"` ID int `json:"id"` Instrumental bool `json:"instrumental"` Language string `json:"language"` Lyrics string `json:"lyrics"` LyricsOwnerID int `json:"lyrics_owner_id"` LyricsState string `json:"lyrics_state"` LyricsUpdatedAt int `json:"lyrics_updated_at"` Name string `json:"name"` Path string `json:"path"` PyongsCount int `json:"pyong_count"` RecordingLocation string `json:"recording_location"` ReleaseDate string `json:"release_date"` RelationshipsIndexURL string `json:"relationships_index_url"` ReleaseDateComponents *ReleaseDateComponents `json:"release_date_components"` ReleaseDateForDisplay string `json:"release_date_for_display"` ReleaseDateWithAbbreviatedMonthForDisplay string `json:"release_date_with_abbreviated_month_for_display"` SongArtImageThumbnailURL string `json:"song_art_image_thumbnail_url"` SongArtImageURL string `json:"song_art_image_url"` Stats *Stats `json:"stats"` Title string `json:"title"` TitleWithFeatured string `json:"title_with_featured"` URL string `json:"url"` CurrentUserMetadata *UserMetadata `json:"current_user_metadata"` Album *Album `json:"album"` CustomPerformances []*CustomPerformance `json:"custom_performances"` DescriptionAnnotation *DescriptionAnnotation `json:"description_annotation"` FeaturedArtists []*Artist `json:"featured_artist"` Media []*Media `json:"media"` PrimaryArtist *Artist `json:"primary_artist"` ProducerArtists []*Artist `json:"producer_artists"` SongRelationships []*SongRelationship `json:"song_relationships"` VerifiedAnnotationsBy []*User `json:"verified_annotations_by"` VerifiedContributors []*Contributor `json:"verified_contributors"` VerifiedLyricsBy []*User `json:"verified_lyrics_by"` WriterArtists []*Artist `json:"writer_artists"` }
Song is song on Genius API.
func GetArtistFromSearchResponse ¶ added in v0.1.1
func GetArtistFromSearchResponse(response *GeniusResponse, searchTerm string) (*Song, error)
func GetSongFromSearchResponse ¶ added in v0.1.1
func GetSongFromSearchResponse(response *GeniusResponse, searchTerm string) (*Song, error)
type SongRelationship ¶
type Stats ¶
type Stats struct { AcceptedAnnotations int `json:"accepted_annotations"` Contributors int `json:"contributors"` Hot bool `json:"hot"` IQEarners int `json:"iq_earners"` Transcribers int `json:"transcribers"` UnreviewedAnnotations int `json:"unreviewed_annotations"` VerifiedAnnotations int `json:"verified_annotations"` Concurrents int `json:"concurrents"` Pageviews int `json:"pageviews"` }
type User ¶
type User struct { APIPath string `json:"api_path"` Avatar *Avatar `json:"avatar"` HeaderImageURL string `json:"header_image_url"` HumanReadableRoleForDisplay string `json:"human_readable_role_for_display"` ID int `json:"id"` IQ int `json:"iq"` Login string `json:"login"` Name string `json:"name"` RoleForDisplay string `json:"role_for_display"` URL string `json:"url"` CurrentUserMetadata *UserMetadata `json:"current_user_metadata"` }
User is user on Genius API.
type UserMetadata ¶
type UserMetadata struct { Permissions []string `json:"permissions"` ExcludedPersmissions []string `json:"excluded_permissions"` Features []string `json:"features"` IQByAction *IQByAction `json:"iq_by_action"` Interactions struct { Following bool `json:"following"` Cosign bool `json:"cosign"` Pyong bool `json:"pyong"` Vote bool `json:"vote"` } `json:"interactions"` Relationships struct { PinnedRole string `json:"pinned_role"` } `json:"relationships"` }
type WebPage ¶
type WebPage struct { APIPath string `json:"api_path"` Domain string `json:"domain"` ID int `json:"id"` NormalizedURL string `json:"normalized_url"` Title string `json:"title"` URL string `json:"url"` AnnotationCount int `json:"annotation_count"` }
WebPage is web_page on Genius API.