social

package module
v1.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppleMusicRequestError

type AppleMusicRequestError struct {
	Errors []appleMusicError `json:"errors"`
}

AppleMusicRequestError represents the Apple Music Error Object

type AuthorizeWithSpotifyResponse

type AuthorizeWithSpotifyResponse struct {
	Email                   string                             `json:"email"`
	ID                      string                             `json:"id"`
	Playlists               []firebase.FirestorePlaylist       `json:"playlists"`
	PreferredSocialPlatform firebase.FirestoreSocialPlatform   `json:"preferredSocialPlatform"`
	SocialPlatforms         []firebase.FirestoreSocialPlatform `json:"socialPlatforms"`
	Username                string                             `json:"username"`
	JWT                     string                             `json:"jwt,omitempty"`
}

AuthorizeWithSpotifyResponse represents the data to send back to the client for a user

type CreateUserReq

type CreateUserReq struct {
	Email              string                 `json:"email"`
	ID                 string                 `json:"id"`
	SocialPlatformPath string                 `json:"socialPlatformPath"`
	ProfileImage       *firebase.SpotifyImage `json:"profileImage"`
	DisplayName        string                 `json:"displayName"`
	Username           string                 `json:"username"`
}

CreateUserReq is the payload that includes the minimal amount of data to create a user

type GenerateTokenRequest

type GenerateTokenRequest struct {
	UID string
}

GenerateTokenRequest represents the UID for the user that we want to create a custom token for

type GenerateTokenResponse

type GenerateTokenResponse struct {
	Token string `json:"token"`
}

GenerateTokenResponse represents what we will send back to the client

type GetMediaReq

type GetMediaReq struct {
	Provider  string `json:"provider"`
	MediaID   string `json:"mediaId"`
	MediaType string `json:"mediaType"`
	// This is only an Apple Music property so remove if not passed through
	Storefront string `json:"storefront,omitempty"`
}

GetMediaReq is the payload that inclues the provider, mediaId, and mediaType for finding media service

type RefreshToken

type RefreshToken struct {
	PlatformName string `json:"platformName"`
	APIToken     string `json:"access_token"`
	TokenType    string `json:"token_type"`
	Scope        string `json:"scope"`
	ExpiresIn    int    `json:"expires_in"`
}

RefreshToken contains the generic information for a refresh token for social platform

type RefreshTokensResponse

type RefreshTokensResponse struct {
	RefreshTokens map[string]firebase.APIToken `json:"refreshTokens"`
}

RefreshTokensResponse contains a list of refreshed tokens for multiple social platforms

type SpotifyAuthRequest

type SpotifyAuthRequest struct {
	APIToken     string `json:"token"`
	ExpiresIn    int    `json:"expiresIn"`
	RefreshToken string `json:"refreshToken"`
}

SpotifyAuthRequest includes APIToken needed for Spotify API

type SpotifyClientCredsAuthResp

type SpotifyClientCredsAuthResp struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
}

SpotifyClientCredsAuthResp includes the response for a client credentials flow from Spotify

type SpotifyMeResponse

type SpotifyMeResponse struct {
	DisplayName string                  `json:"display_name"`
	Email       string                  `json:"email"`
	ID          string                  `json:"id"`
	Images      []firebase.SpotifyImage `json:"images"`
	Product     string                  `json:"product"`
}

SpotifyMeResponse represents the response coming back from the /me endpoint

type SpotifyRequestError

type SpotifyRequestError struct {
	Error spotifyRequestErrorDetails `json:"error"`
}

SpotifyRequestError represents the Spotify Error Object

type TokenRefreshRequest

type TokenRefreshRequest struct {
	UID string `json:"uid"`
}

TokenRefreshRequest includes uid to grab all social platforms for user

Jump to

Keyboard shortcuts

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