Documentation ¶
Overview ¶
Package lastfm is a generated GoMock package.
Index ¶
- type API
- type Lastfm
- func (l *Lastfm) Authenticate(oauthCode string, redirectURL string) error
- func (l *Lastfm) Authenticated() bool
- func (l *Lastfm) Close() error
- func (l *Lastfm) CodeParam() string
- func (l *Lastfm) CreateAuthURL(redirectURL string) string
- func (l *Lastfm) GetLovedTracks(limit int) (tracks []domain.Track, err error)
- func (l *Lastfm) GetUsername() (string, error)
- func (l *Lastfm) LoveTrack(track domain.Track) error
- func (l *Lastfm) Name() string
- type MockAPI
- type MockAPIMockRecorder
- type MockTrackAPI
- type MockTrackAPIMockRecorder
- type MockUserAPI
- type MockUserAPIMockRecorder
- type TrackAPI
- type UserAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetAuthRequestUrl(callback string) (uri string) LoginWithToken(token string) (err error) GetSessionKey() (sk string) }
API is our interface for a Last.fm API.
type Lastfm ¶
type Lastfm struct {
// contains filtered or unexported fields
}
Lastfm is the external Lastfm service implementation.
func (*Lastfm) Authenticate ¶
Authenticate takes an authorization code and authenticates the user.
func (*Lastfm) Authenticated ¶
Authenticated returns whether the service is logged in.
func (*Lastfm) CodeParam ¶
CodeParam is the query parameter name used in the authentication callback.
func (*Lastfm) CreateAuthURL ¶
CreateAuthURL returns an authorization URL to authorize the integration.
func (*Lastfm) GetLovedTracks ¶
GetLovedTracks returns loved tracks from the external service.
func (*Lastfm) GetUsername ¶
GetUsername requests and returns the username of the logged in user.
type MockAPI ¶
type MockAPI struct {
// contains filtered or unexported fields
}
MockAPI is a mock of API interface.
func NewMockAPI ¶
func NewMockAPI(ctrl *gomock.Controller) *MockAPI
NewMockAPI creates a new mock instance.
func (*MockAPI) EXPECT ¶
func (m *MockAPI) EXPECT() *MockAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAPI) GetAuthRequestUrl ¶
GetAuthRequestUrl mocks base method.
func (*MockAPI) GetSessionKey ¶
GetSessionKey mocks base method.
func (*MockAPI) LoginWithToken ¶
LoginWithToken mocks base method.
type MockAPIMockRecorder ¶
type MockAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockAPIMockRecorder is the mock recorder for MockAPI.
func (*MockAPIMockRecorder) GetAuthRequestUrl ¶
func (mr *MockAPIMockRecorder) GetAuthRequestUrl(callback interface{}) *gomock.Call
GetAuthRequestUrl indicates an expected call of GetAuthRequestUrl.
func (*MockAPIMockRecorder) GetSessionKey ¶
func (mr *MockAPIMockRecorder) GetSessionKey() *gomock.Call
GetSessionKey indicates an expected call of GetSessionKey.
func (*MockAPIMockRecorder) LoginWithToken ¶
func (mr *MockAPIMockRecorder) LoginWithToken(token interface{}) *gomock.Call
LoginWithToken indicates an expected call of LoginWithToken.
type MockTrackAPI ¶
type MockTrackAPI struct {
// contains filtered or unexported fields
}
MockTrackAPI is a mock of TrackAPI interface.
func NewMockTrackAPI ¶
func NewMockTrackAPI(ctrl *gomock.Controller) *MockTrackAPI
NewMockTrackAPI creates a new mock instance.
func (*MockTrackAPI) EXPECT ¶
func (m *MockTrackAPI) EXPECT() *MockTrackAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTrackAPI) Love ¶
func (m *MockTrackAPI) Love(args map[string]interface{}) error
Love mocks base method.
type MockTrackAPIMockRecorder ¶
type MockTrackAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockTrackAPIMockRecorder is the mock recorder for MockTrackAPI.
func (*MockTrackAPIMockRecorder) Love ¶
func (mr *MockTrackAPIMockRecorder) Love(args interface{}) *gomock.Call
Love indicates an expected call of Love.
type MockUserAPI ¶
type MockUserAPI struct {
// contains filtered or unexported fields
}
MockUserAPI is a mock of UserAPI interface.
func NewMockUserAPI ¶
func NewMockUserAPI(ctrl *gomock.Controller) *MockUserAPI
NewMockUserAPI creates a new mock instance.
func (*MockUserAPI) EXPECT ¶
func (m *MockUserAPI) EXPECT() *MockUserAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUserAPI) GetInfo ¶
func (m *MockUserAPI) GetInfo(args map[string]interface{}) (lastfm.UserGetInfo, error)
GetInfo mocks base method.
func (*MockUserAPI) GetLovedTracks ¶
func (m *MockUserAPI) GetLovedTracks(args map[string]interface{}) (lastfm.UserGetLovedTracks, error)
GetLovedTracks mocks base method.
type MockUserAPIMockRecorder ¶
type MockUserAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockUserAPIMockRecorder is the mock recorder for MockUserAPI.
func (*MockUserAPIMockRecorder) GetInfo ¶
func (mr *MockUserAPIMockRecorder) GetInfo(args interface{}) *gomock.Call
GetInfo indicates an expected call of GetInfo.
func (*MockUserAPIMockRecorder) GetLovedTracks ¶
func (mr *MockUserAPIMockRecorder) GetLovedTracks(args interface{}) *gomock.Call
GetLovedTracks indicates an expected call of GetLovedTracks.
type UserAPI ¶
type UserAPI interface { GetInfo(args map[string]interface{}) (result lastfm.UserGetInfo, err error) GetLovedTracks(args map[string]interface{}) (result lastfm.UserGetLovedTracks, err error) }
UserAPI is our interface for a Last.fm user API.