mixcloud

package module
v0.0.0-...-804ebc7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: AGPL-3.0 Imports: 9 Imported by: 1

README

go-mixcloud

Build Status Go ReportCard GoDoc

Go library wrapper for the Mixcloud API. Currently only supports retrieving Cloudcasts information.

Used in Beehive for the Mixcloud bee.

Installation

Make sure you have a working Go environment (Go 1.11 or higher is required). See the install instructions.

To install go-mixcloud, simply run:

go get github.com/horrendus/go-mixcloud

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) GetCloudcasts

func (c *Client) GetCloudcasts(name string, options *ListOptions) (Cloudcasts, error)

func (*Client) GetPage

func (c *Client) GetPage(fullURL string, out interface{}) error

Function can be used to get next/previous page on paginated APIs

type CloudcastData

type CloudcastData struct {
	Name string `json:"name"`
	URL  string `json:"url"`

	CreatedTime time.Time `json:"created_time,string"`
	UpdatedTime time.Time `json:"updated_time,string"`

	Slug string `json:"slug"`
	Key  string `json:"key"`

	AudioLength int `json:"audio_length"`

	PlayCount     int `json:"play_count"`
	ListenerCount int `json:"listener_count"`
	FavoriteCount int `json:"favorite_count"`
	CommentCount  int `json:"comment_count"`
	RepostCount   int `json:"repost_count"`
}

type Cloudcasts

type Cloudcasts struct {
	Paging Link `json:"paging,Link"`
	Data   []CloudcastData
}
type Link struct {
	PreviousURL string `json:"previous,omitempty"`
	NextURL     string `json:"next,omitempty"`
}

type ListOptions

type ListOptions struct {
	Limit  int       `url:"limit"`
	Offset int       `url:"offset,omitempty"`
	Since  time.Time `url:"since,omitempty,unix"`
	Until  time.Time `url:"until,omitempty,unix"`
}

Jump to

Keyboard shortcuts

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