From f69c1b14a3a45f71c1f1cd380d9b91e63b125a22 Mon Sep 17 00:00:00 2001 From: SoXX Date: Mon, 23 Oct 2023 11:16:39 +0200 Subject: [PATCH] fix: api-key leak again... Signed-off-by: SoXX --- example/midlevel/tag.go | 4 ++-- pkg/e621/model/tag.go | 31 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/example/midlevel/tag.go b/example/midlevel/tag.go index ed45a85..0784022 100644 --- a/example/midlevel/tag.go +++ b/example/midlevel/tag.go @@ -13,8 +13,8 @@ func main() { Client: http.Client{}, Host: "https://e621.net", UserAgent: "Go-e621-SDK (@username)", - Username: "selloo", // Replace with your username - APIKey: "zt7XAaewLqP4AWvQi5WrLNwN", // Replace with your API key + Username: "", // Replace with your username + APIKey: "", // Replace with your API key } // Log: Getting a single tag. diff --git a/pkg/e621/model/tag.go b/pkg/e621/model/tag.go index f084af2..9851807 100644 --- a/pkg/e621/model/tag.go +++ b/pkg/e621/model/tag.go @@ -1,13 +1,26 @@ package model +type TagCategory int + +const ( + General TagCategory = iota + Artist + Copyright TagCategory = iota + 1 + Character + Species + Invalide + Meta + Lore +) + type Tag struct { - ID int64 `json:"id"` - Name string `json:"name"` - PostCount int64 `json:"post_count"` - RelatedTags string `json:"related_tags"` - RelatedTagsUpdatedAt string `json:"related_tags_updated_at"` - Category int64 `json:"category"` - IsLocked bool `json:"is_locked"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` + ID int64 `json:"id"` + Name string `json:"name"` + PostCount int64 `json:"post_count"` + RelatedTags string `json:"related_tags"` + RelatedTagsUpdatedAt string `json:"related_tags_updated_at"` + Category TagCategory `json:"category"` + IsLocked bool `json:"is_locked"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` }