api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package api is a generated GoMock package.

Package api is a generated GoMock package.

Package api provides a client for using the Spotify API.

Index

Constants

This section is empty.

Variables

View Source
var (

	// GetClientManagerFunc is a function to get the client manager.
	GetClientManagerFunc = getClientManager
)

Functions

func ResetClientManager

func ResetClientManager() error

ResetClientManager resets the client manager.

Types

type Client

type Client interface {
	Auth(chan<- string, string) (proxy.Client, string, error)
	Close() error
	Open() proxy.Client
	UpdateConfig(*ClientConfig)
}

Client is an interface that contains the client.

type ClientConfig

type ClientConfig struct {
	// SpotifyID is the Spotify client ID.
	SpotifyID string
	// SpotifySecret is the Spotify client secret.
	SpotifySecret string
	// SpotifyRedirectUri is the Spotify redirect URI.
	SpotifyRedirectUri string
	// SpotifyRefreshToken is the Spotify refresh token.
	SpotifyRefreshToken string
}

ClientConfig is a struct that contains the configuration of the client.

type ClientManager

type ClientManager interface {
	CloseClient() error
	GetClient() (Client, error)
	InitializeClient(ctx context.Context, config *ClientConfig) error
	IsClientInitialized() bool
}

ClientManager is an interface that manages api clients.

func GetClientManager

func GetClientManager() ClientManager

GetClientManager gets the client manager.

func NewClientManager

func NewClientManager(spotify proxy.Spotify, http proxy.Http, randstr proxy.Randstr, url proxy.Url) ClientManager

NewClientManager initializes the client manager.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Auth

func (m *MockClient) Auth(arg0 chan<- string, arg1 string) (proxy.Client, string, error)

Auth mocks base method.

func (*MockClient) Close

func (m *MockClient) Close() error

Close mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) Open

func (m *MockClient) Open() proxy.Client

Open mocks base method.

func (*MockClient) UpdateConfig

func (m *MockClient) UpdateConfig(arg0 *ClientConfig)

UpdateConfig mocks base method.

type MockClientManager

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

MockClientManager is a mock of ClientManager interface.

func NewMockClientManager

func NewMockClientManager(ctrl *gomock.Controller) *MockClientManager

NewMockClientManager creates a new mock instance.

func (*MockClientManager) CloseClient

func (m *MockClientManager) CloseClient() error

CloseClient mocks base method.

func (*MockClientManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClientManager) GetClient

func (m *MockClientManager) GetClient() (Client, error)

GetClient mocks base method.

func (*MockClientManager) InitializeClient

func (m *MockClientManager) InitializeClient(ctx context.Context, config *ClientConfig) error

InitializeClient mocks base method.

func (*MockClientManager) IsClientInitialized

func (m *MockClientManager) IsClientInitialized() bool

IsClientInitialized mocks base method.

type MockClientManagerMockRecorder

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

MockClientManagerMockRecorder is the mock recorder for MockClientManager.

func (*MockClientManagerMockRecorder) CloseClient

func (mr *MockClientManagerMockRecorder) CloseClient() *gomock.Call

CloseClient indicates an expected call of CloseClient.

func (*MockClientManagerMockRecorder) GetClient

func (mr *MockClientManagerMockRecorder) GetClient() *gomock.Call

GetClient indicates an expected call of GetClient.

func (*MockClientManagerMockRecorder) InitializeClient

func (mr *MockClientManagerMockRecorder) InitializeClient(ctx, config any) *gomock.Call

InitializeClient indicates an expected call of InitializeClient.

func (*MockClientManagerMockRecorder) IsClientInitialized

func (mr *MockClientManagerMockRecorder) IsClientInitialized() *gomock.Call

IsClientInitialized indicates an expected call of IsClientInitialized.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Auth

func (mr *MockClientMockRecorder) Auth(arg0, arg1 any) *gomock.Call

Auth indicates an expected call of Auth.

func (*MockClientMockRecorder) Close

func (mr *MockClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockClientMockRecorder) Open

func (mr *MockClientMockRecorder) Open() *gomock.Call

Open indicates an expected call of Open.

func (*MockClientMockRecorder) UpdateConfig

func (mr *MockClientMockRecorder) UpdateConfig(arg0 any) *gomock.Call

UpdateConfig indicates an expected call of UpdateConfig.

Jump to

Keyboard shortcuts

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