Documentation
¶
Index ¶
- Variables
- type AccountService
- type Album
- type Annotation
- type AnnotationsService
- type ApiResponse
- type Artist
- type ArtistSongsSort
- type ArtistsService
- type Author
- type Client
- type Hit
- type Lyrics
- type LyricsService
- type Media
- type SearchService
- type Song
- type SongRelationship
- type SongsService
- type User
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
type Album ¶
type Album struct {
Id int `json:"id,omitempty"`
ApiPath string `json:"api_path,omitempty"`
CoverArtURL string `json:"cover_art_url,omitempty"`
FullTitle string `json:"full_title,omitempty"`
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Artist *Artist `json:"artist,omitempty"`
}
type Annotation ¶
type Annotation struct {
ApiPath string `json:"api_path,omitempty"`
Body any `json:"body,omitempty"`
CommentCount int `json:"comment_count,omitempty"`
Community bool `json:"community,omitempty"`
CustomPreview bool `json:"custom_preview,omitempty"`
HasVoters bool `json:"has_voters,omitempty"`
Id int `json:"id,omitempty"`
Pinned bool `json:"pinned,omitempty"`
Source string `json:"source,omitempty"`
State string `json:"state,omitempty"`
URL string `json:"url,omitempty"`
Verified bool `json:"verified,omitempty"`
VotesTotal int `json:"votes_total,omitempty"`
CurrentUserMetadata *struct {
Permissions []string `json:"permissions,omitempty"`
ExcludedPermissions []string `json:"excluded_permissions,omitempty"`
Interactions *struct {
Following bool `json:"following,omitempty"`
} `json:"interactions,omitempty"`
} `json:"current_user_metadata,omitempty"`
Authors []Author `json:"authors,omitempty"`
CosignedBy []any `json:"cosigned_by,omitempty"`
RejectionComment string `json:"rejection_comment,omitempty"`
VerifiedBy *User `json:"verified_by,omitempty"`
}
type AnnotationsService ¶
type AnnotationsService struct {
// contains filtered or unexported fields
}
func (*AnnotationsService) Get ¶
func (s *AnnotationsService) Get(id string) (Annotation, error)
type ApiResponse ¶
type ApiResponse struct {
Meta *struct {
Status int `json:"status,omitempty"`
} `json:"meta,omitempty"`
Response *struct {
Annotation *Annotation `json:"annotation,omitempty"`
Song *Song `json:"song,omitempty"`
Songs []Song `json:"songs,omitempty"`
Artist *Artist `json:"artist,omitempty"`
Hits []Hit `json:"hits,omitempty"`
} `json:"response,omitempty"`
}
ApiResponse is the general response structure that is received from different api calls from api.genius.com
type Artist ¶
type Artist struct {
IsMemeVerified bool `json:"is_meme_verified,omitempty"`
IsVerified bool `json:"is_verified,omitempty"`
TranslationArtist bool `json:"translation_artist,omitempty"`
FollowersCount int `json:"followers_count,omitempty"`
Id int `json:"id,omitempty"`
IQ int `json:"iq,omitempty"`
ApiPath string `json:"api_path,omitempty"`
HeaderImageURL string `json:"header_image_url,omitempty"`
ImageURL string `json:"image_url,omitempty"`
InstagramName string `json:"instagram_name,omitempty"`
Name string `json:"name,omitempty"`
TwitterName string `json:"twitter_name,omitempty"`
URL string `json:"url,omitempty"`
AlternateNames []string `json:"alternate_names,omitempty"`
User *User `json:"user,omitempty"`
}
type ArtistSongsSort ¶
type ArtistSongsSort string
const ( ArtistSongsSortTitle ArtistSongsSort = "title" ArtistSongsSortPopularity ArtistSongsSort = "popularity" )
type ArtistsService ¶
type ArtistsService struct {
// contains filtered or unexported fields
}
func (*ArtistsService) GetSongs ¶
func (s *ArtistsService) GetSongs(artistId string, sort ArtistSongsSort) ([]Song, error)
type Client ¶
type Client struct {
Account *AccountService
Annotations *AnnotationsService
Artists *ArtistsService
Lyrics *LyricsService
Search *SearchService
Songs *SongsService
}
Client is the Genius client that handles all the different API calls to api.genius.com
func NewClient ¶
NewClient initializes the genius Client with the given access token to interact with different api.genius.com calls.
func (*Client) SetPageSize ¶
func (c *Client) SetPageSize()
type Hit ¶
type Hit struct {
HighLights any `json:"highlights,omitempty"`
Index string `json:"string,omitempty"`
Type string `json:"type,omitempty"`
Result *struct {
AnnotationCount int `json:"annotation_count,omitempty"`
ApiPath string `json:"api_path,omitempty"`
FullTitle string `json:"full_title,omitempty"`
HeaderImageThumbnailURL string `json:"header_image_thumbnail_url,omitempty"`
Id int `json:"id,omitempty"`
LyricsOwnerId int `json:"lyrics_owner_id,omitempty"`
LyricsState string `json:"lyrics_state,omitempty"`
Path string `json:"path,omitempty"`
PyongsCount int `json:"pyongs_count,omitempty"`
SongArtImageThumbnailURL string `json:"song_art_image_thumbnail_url,omitempty"`
SongArtImageURL string `json:"song_art_image_url,omitempty"`
Stats *struct {
UnreviewedAnnotations int `json:"unreviewed_annotations,omitempty"`
Concurrents int `json:"concurrents,omitempty"`
Hot bool `json:"hot,omitempty"`
PageViews int `json:"page_views,omitempty"`
} `json:"stats,omitempty"`
Title string `json:"title,omitempty"`
TitleWithFeatured string `json:"title_with_featured,omitempty"`
URL string `json:"url,omitempty"`
PrimaryArtist *Artist `json:"primary_artist,omitempty"`
} `json:"result,omitempty"`
}
type Lyrics ¶
type Lyrics struct {
// contains filtered or unexported fields
}
Lyrics holds the actual plain text value of the lyrics.
type LyricsService ¶
type LyricsService struct {
// contains filtered or unexported fields
}
LyricsService fetches lyrics of a song.
func (*LyricsService) FindForSong ¶
func (l *LyricsService) FindForSong(songUrl string) (Lyrics, error)
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
type Song ¶
type Song struct {
FeaturedVideo bool `json:"featured_video,omitempty"`
AnnotationCount int `json:"annotation_count,omitempty"`
Id int `json:"id,omitempty"`
LyricsOwnerId int `json:"lyrics_owner_id,omitempty"`
PyongsCount int `json:"pyongs_count,omitempty"`
ApiPath string `json:"api_path,omitempty"`
AppleMusicId string `json:"apple_music_id,omitempty"`
AppleMusicPlayerURL string `json:"apple_music_player_url,omitempty"`
EmbedContent string `json:"embed_content,omitempty"`
FullTitle string `json:"full_title,omitempty"`
HeaderImageThumbnailURL string `json:"header_image_thumbnail_url,omitempty"`
HeaderImageURL string `json:"header_image_url,omitempty"`
LyricsState string `json:"lyrics_state,omitempty"`
Path string `json:"path,omitempty"`
SongArtImageThumbnailURL string `json:"song_art_image_thumbnail_url,omitempty"`
SongArtImageURL string `json:"song_art_image_url,omitempty"`
Title string `json:"title,omitempty"`
TitleFeatured string `json:"title_features,omitempty"`
URL string `json:"url,omitempty"`
Album *Album `json:"album,omitempty"`
FeaturedArtists []Artist `json:"featured_artists,omitempty"`
Media []Media `json:"media,omitempty"`
PrimaryArtist *Artist `json:"primary_artist,omitempty"`
ProducerArtists []Artist `json:"producer_artists,omitempty"`
SongRelationships []SongRelationship `json:"song_relationships,omitempty"`
WriterArtists []Artist `json:"writer_artists,omitempty"`
Description struct {
Plain string `json:"plain,omitempty"`
} `json:"description,omitempty"`
}
type SongRelationship ¶
type SongsService ¶
type SongsService struct {
// contains filtered or unexported fields
}
func (*SongsService) FetchLyrics ¶
func (s *SongsService) FetchLyrics(song Song) (Lyrics, error)
type User ¶
type User struct {
ApiPath string `json:"api_path,omitempty"`
Avatar *struct {
Tiny *struct {
URL string `json:"url,omitempty"`
BoundingBox *struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
} `json:"bounding_box,omitempty"`
} `json:"tiny,omitempty"`
Thumb *struct {
URL string `json:"url,omitempty"`
BoundingBox *struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
} `json:"bounding_box,omitempty"`
} `json:"thumb,omitempty"`
Small *struct {
URL string `json:"url,omitempty"`
BoundingBox *struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
} `json:"bounding_box,omitempty"`
} `json:"small,omitempty"`
Medium *struct {
URL string `json:"url,omitempty"`
BoundingBox *struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
} `json:"bounding_box,omitempty"`
} `json:"medium,omitempty"`
} `json:"avatar,omitempty"`
HeaderImageURL string `json:"header_image_url,omitempty"`
HumanReadableRoleForDisplay string `json:"human_readable_role_for_display,omitempty"`
Id int `json:"id,omitempty"`
IQ int `json:"iq,omitempty"`
Login string `json:"login,omitempty"`
Name string `json:"string,omitempty"`
RoleForDisplay string `json:"role_for_display,omitempty"`
URL string `json:"url,omitempty"`
CurrentUserMetadata *struct {
Permissions []string `json:"permissions,omitempty"`
ExcludedPermissions []string `json:"excluded_permissions,omitempty"`
Interactions *struct {
Following bool `json:"following,omitempty"`
} `json:"interactions,omitempty"`
} `json:"current_user_metadata,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.
