gospotti

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: GPL-3.0 Imports: 13 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

 ____                    __    __           
/\  _`\                 /\ \__/\ \__  __    
\ \,\L\_\  _____     ___\ \ ,_\ \ ,_\/\_\   
 \/_\__ \ /\ '__`\  / __`\ \ \/\ \ \/\/\ \  
   /\ \L\ \ \ \L\ \/\ \L\ \ \ \_\ \ \_\ \ \ 
   \ `\____\ \ ,__/\ \____/\ \__\\ \__\\ \_\
    \/_____/\ \ \/  \/___/  \/__/ \/__/ \/_/
             \ \_\                          
              \/_/                          

A shitty Spotify API Wrapper + Client written in Go
GitHub License CodeFactor GitHub code size in bytes GitHub Tag

Installation

Install with go

go get github.com/ItzAfroBoy/go-spotti@latest

Build from source

git clone https://github.com/ItzAfroBoy/go-spotti
cd go-spotti
go install

Usage

See client for a basic example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Playback     Playback
	Auth         ClientAuth
	ClientID     string
	Token        string
	RefreshToken string
	// contains filtered or unexported fields
}

func Init added in v0.1.0

func Init() *Client

func (*Client) Authorize

func (c *Client) Authorize(reauth bool)

func (*Client) Reauthorize

func (c *Client) Reauthorize()

type ClientAuth

type ClientAuth struct {
	RedirectURI string
	// contains filtered or unexported fields
}

type Playback

type Playback struct {
	// contains filtered or unexported fields
}

func (Playback) GetPlaybackInfo

func (p Playback) GetPlaybackInfo() (data PlaybackState)

func (Playback) NextTrack

func (p Playback) NextTrack()

func (Playback) Pause

func (p Playback) Pause()

func (Playback) Play

func (p Playback) Play()

func (Playback) PreviousTrack

func (p Playback) PreviousTrack()

type PlaybackState

type PlaybackState struct {
	Progress int `json:"progress_ms"`
	Track    struct {
		Artists []struct {
			Name string
		} `json:"artists"`
		Name     string `json:"name"`
		Duration int    `json:"duration_ms"`
	} `json:"item"`
}

Directories

Path Synopsis
client module

Jump to

Keyboard shortcuts

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