// New create a new playlyfe client
New create a new playlyfe client
// New create a new playlyfe client
func New(clientID string, clientSecret string, clientType string, version string, redirectURI string, load Load, store Store) *Playlyfe {
	pl := &Playlyfe{
		clientID:     clientID,
		clientSecret: clientSecret,
		clientType:   clientType,
		version:      version,
		redirectURI:  redirectURI,
		client:       gorequest.New(),
		apiEndpoint:  apiBaseURL + version,
	}
	if load == nil {
		load = func() (token string, expiresAt int64) {
			return pl.accessToken, pl.expiresAt
		}
	}
	if store == nil {
		store = func(token string, expiresAt int64) {
			pl.accessToken = token
			pl.expiresAt = expiresAt
		}
	}
	pl.load = load
	pl.store = store
	return pl
}
func New ( clientID string , clientSecret string , clientType string , version string , redirectURI string , load Load , store Store ) * Playlyfe { pl := & Playlyfe { clientID : clientID , clientSecret : clientSecret , clientType : clientType , version : version , redirectURI : redirectURI , client : gorequest . New ( ) , apiEndpoint : apiBaseURL + version , } if load == nil { load = func ( ) ( token string , expiresAt int64 ) { return pl . accessToken , pl . expiresAt } } if store == nil { store = func ( token string , expiresAt int64 ) { pl . accessToken = token pl . expiresAt = expiresAt } } pl . load = load pl . store = store return pl }
New create a new playlyfe client
New create a new playlyfe client