Documentation ¶
Index ¶
- type BGMTrack
- type Client
- func (c *Client) BGMDownload(track *BGMTrack, downloadDirectory string) (string, error)
- func (c *Client) BGMDownloadTemp(track *BGMTrack) (string, error)
- func (c *Client) BGMList() ([]*BGMTrack, error)
- func (c *Client) BGMListByHour(hour int) ([]*BGMTrack, error)
- func (c *Client) BGMListByWeather(weather Weather) ([]*BGMTrack, error)
- func (c *Client) BGMTrackByID(id int) (*BGMTrack, error)
- func (c *Client) BGMTrackByQuery(hour int, weather Weather) (*BGMTrack, error)
- func (c *Client) SongByID(id int) (*Song, error)
- func (c *Client) SongByName(name string) (*Song, error)
- func (c *Client) SongDownload(song *Song, downloadDirectory string) (string, error)
- func (c *Client) SongDownloadTemp(song *Song) (string, error)
- func (c *Client) SongList() ([]*Song, error)
- type Song
- type Weather
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGMTrack ¶
type BGMTrack struct { ID int `json:"id"` FileName string `json:"file-name"` Hour int `json:"hour"` Weather Weather `json:"weather"` }
BGMTrack represents a track that is played in the background of AC:NH under specified time and weather conditions.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client facilitates interaction with the AC:NH API
func (*Client) BGMDownload ¶
BGMDownload downloads the given track as an MP3 file to a given directory. The file name of the download is that specified as the file name by the API. The given download dir must exist before calling this. Returned is the file path of the download song, provided there was no error.
func (*Client) BGMDownloadTemp ¶
BGMDownloadTemp downloads the given track as an MP3 file to a temp directory. Th file name of the download is that specified as the file name by the API. Returned is the file path of the download song, provided there was no error.
func (*Client) BGMList ¶
BGMList returns all the background music tracks that the API provides. An error is returned if the request failed or a non 200 error code was returned.
func (*Client) BGMListByHour ¶
BGMListByHour gets all the background music tracks that can be played in a given hour, regardless of the weather. An error is returned if the request failed or a non 200 error code was returned or no match was found.
func (*Client) BGMListByWeather ¶
BGMListByWeather gets all the background music tracks that can be played in a given weather condition, regardless of the time. An error is returned if the request failed or a non 200 error code was returned or no match was found.
func (*Client) BGMTrackByID ¶
BGMTrackByID gets a single background music track based on the ID provided. An error is returned if the request failed or a non 200 error code was returned.
func (*Client) BGMTrackByQuery ¶
BGMTrackByQuery gets the background music track that can be played in a given weather condition, at a specified hour. An error is returned if the request failed or a non 200 error code was returned or no match was found.
func (*Client) SongByID ¶
SongByID gets a single song based on the ID provided. An error is returned if the request failed or a non 200 error code was returned.
func (*Client) SongByName ¶
SongByName get a song based on its name. It is important to note that language of the name is set to EUen. An error is returned if the request failed or a non 200 error code was returned or no match was found.
func (*Client) SongDownload ¶
SongDownload downloads the given track as an MP3 file to a given directory. The file name of the download is that specified as the file name by the API. The given download dir must exist before calling this. Returned is the file path of the download song, provided there was no error.
func (*Client) SongDownloadTemp ¶
SongDownload downloads the given track as an MP3 file to a temp directory. Th file name of the download is that specified as the file name by the API. Returned is the file path of the download song, provided there was no error.