aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-17 21:52:25 +0530
committerVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-17 21:52:25 +0530
commit7a910534c8d1e82420ef763b514f2763bda63e65 (patch)
tree4021d547862af5d5a78944ec6f251186b3647d4f
parent69a454a9a8430164c2ce798ecafee221404c50ec (diff)
updated the client in user and user/anime packages
-rw-r--r--user/anime/animelist.go4
-rw-r--r--user/anime/animelist.structs.go2
-rw-r--r--user/anime/client.go8
-rw-r--r--user/anime/update_animelist.go2
-rw-r--r--user/client.go8
-rw-r--r--util/default_client.go27
-rw-r--r--util/structs.go2
-rw-r--r--util/url_generator.go2
8 files changed, 37 insertions, 18 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go
index bbc7d7a..01e0a0e 100644
--- a/user/anime/animelist.go
+++ b/user/anime/animelist.go
@@ -21,8 +21,8 @@ import (
"strconv"
"fmt"
"errors"
- a "github.com/MikunoNaka/mal2go/anime"
- e "github.com/MikunoNaka/mal2go/errhandlers"
+ a "github.com/MikunoNaka/MAL2Go/anime"
+ e "github.com/MikunoNaka/MAL2Go/errhandlers"
)
const BASE_URL string = "https://api.myanimelist.net/v2"
diff --git a/user/anime/animelist.structs.go b/user/anime/animelist.structs.go
index cee47d2..80eb01a 100644
--- a/user/anime/animelist.structs.go
+++ b/user/anime/animelist.structs.go
@@ -17,7 +17,7 @@
package anime
import (
- "github.com/MikunoNaka/mal2go/anime"
+ "github.com/MikunoNaka/MAL2Go/anime"
)
type AnimeListRaw struct {
diff --git a/user/anime/client.go b/user/anime/client.go
index eeba194..e857df2 100644
--- a/user/anime/client.go
+++ b/user/anime/client.go
@@ -17,11 +17,7 @@
package anime
import (
- "net/http"
+ "github.com/MikunoNaka/MAL2Go/util"
)
-// MyAnimeList Client for mal2go/user/anime package
-type Client struct {
- AuthToken, RefreshToken string
- HttpClient http.Client
-}
+type Client util.DefaultClient
diff --git a/user/anime/update_animelist.go b/user/anime/update_animelist.go
index 5a6883c..5f6025a 100644
--- a/user/anime/update_animelist.go
+++ b/user/anime/update_animelist.go
@@ -16,7 +16,7 @@
package anime
import (
- e "github.com/MikunoNaka/mal2go/errhandlers"
+ e "github.com/MikunoNaka/MAL2Go/errhandlers"
"errors"
"fmt"
"net/url"
diff --git a/user/client.go b/user/client.go
index 7d5b800..2cdc79c 100644
--- a/user/client.go
+++ b/user/client.go
@@ -17,11 +17,7 @@
package user
import (
- "net/http"
+ "github.com/MikunoNaka/MAL2Go/util"
)
-// MyAnimeList Client for mal2go/anime package
-type MALUserClient struct {
- AuthToken, RefreshToken string
- HttpClient http.Client
-}
+type MALUserClient util.DefaultClient
diff --git a/util/default_client.go b/util/default_client.go
new file mode 100644
index 0000000..da2114f
--- /dev/null
+++ b/util/default_client.go
@@ -0,0 +1,27 @@
+/* MAL2Go - MyAnimeList V2 API wrapper for Go
+ * Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@protonmail.ch>
+
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+package util
+
+import (
+ "net/http"
+)
+
+// MyAnimeList Client for mal2go/anime package
+type DefaultClient struct {
+ AuthToken, RefreshToken string
+ HttpClient http.Client
+}
diff --git a/util/structs.go b/util/structs.go
index d242e7f..b17f1f7 100644
--- a/util/structs.go
+++ b/util/structs.go
@@ -1,4 +1,4 @@
-/* mal2go - MyAnimeList V2 API wrapper for Go
+/* MAL2Go - MyAnimeList V2 API wrapper for Go
* Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@protonmail.ch>
* This program is free software: you can redistribute it and/or modify
diff --git a/util/url_generator.go b/util/url_generator.go
index 3d21a98..e6799b5 100644
--- a/util/url_generator.go
+++ b/util/url_generator.go
@@ -1,4 +1,4 @@
-/* mal2go - MyAnimeList V2 API wrapper for Go
+/* MAL2Go - MyAnimeList V2 API wrapper for Go
* Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@protonmail.ch>
* This program is free software: you can redistribute it and/or modify