fetch

package
v0.0.0-...-9bc110c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Playlists     []*soundcloud.Playlist
	PlaylistsMap  sync.Map
	RichPlaylists []*RichPlaylist
	Tracks        []*soundcloud.Track
	// contains filtered or unexported fields
}

Client is the struct holding our data and client to fetch data on Soundcloud

func NewClient

func NewClient(clientID string, ids []int) *Client

NewClient returns a new Client

func (*Client) Fetch

func (c *Client) Fetch() error

Fetch will fetch and store the playlists and tracks into the client

func (*Client) Find

func (c *Client) Find(id int) ([]*RichPlaylist, error)

Find will fetch and find the matching playlists of a given user id

func (*Client) Stream

func (c *Client) Stream(id string) ([]byte, error)

Stream will retrieve a streamable content respecting SoundCloud's workflow

type RichPlaylist

type RichPlaylist struct {
	*soundcloud.Playlist
	Number int
}

RichPlaylist is just a playlist with its number parsed

func NewRichPlaylist

func NewRichPlaylist(p *soundcloud.Playlist) *RichPlaylist

NewRichPlaylist will parse the playlist's title to fill the number

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL