app.go
changeset 138 23d3a518d0ad
parent 131 68ef6504637e
child 149 5f922977d7c7
--- a/app.go	Wed Apr 19 09:30:47 2017 +0200
+++ b/app.go	Wed Apr 19 10:43:38 2017 +0200
@@ -5,7 +5,7 @@
 Licensed under the MIT license.  Please see the LICENSE file is this directory.
 */
 
-package gondole
+package madon
 
 import (
 	"errors"
@@ -46,13 +46,13 @@
 }
 
 // NewApp registers a new application with a given instance
-func NewApp(name string, scopes []string, redirectURI, instanceName string) (g *Client, err error) {
+func NewApp(name string, scopes []string, redirectURI, instanceName string) (mc *Client, err error) {
 	instanceURL, err := buildInstanceURL(instanceName)
 	if err != nil {
 		return nil, err
 	}
 
-	g = &Client{
+	mc = &Client{
 		Name:        name,
 		InstanceURL: instanceURL,
 		APIBase:     instanceURL + currentAPIPath,
@@ -68,18 +68,18 @@
 	}
 
 	var app registerApp
-	if err := g.apiCall("apps", rest.Post, params, &app); err != nil {
+	if err := mc.apiCall("apps", rest.Post, params, &app); err != nil {
 		return nil, err
 	}
 
-	g.ID = app.ClientID
-	g.Secret = app.ClientSecret
+	mc.ID = app.ClientID
+	mc.Secret = app.ClientSecret
 
 	return
 }
 
 // RestoreApp recreates an application client with existing secrets
-func RestoreApp(name, instanceName, appID, appSecret string, userToken *UserToken) (g *Client, err error) {
+func RestoreApp(name, instanceName, appID, appSecret string, userToken *UserToken) (mc *Client, err error) {
 	instanceURL, err := buildInstanceURL(instanceName)
 	if err != nil {
 		return nil, err