From 6bde70cef85d4091f307b223a0c2c974c60397bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Mon, 8 Apr 2019 23:59:58 +0200 Subject: [PATCH] renamed PiwigoCategory to Category as the package name is duplicated --- internal/pkg/piwigo/category.go | 14 +++++++------- internal/pkg/piwigo/piwigoContext.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/pkg/piwigo/category.go b/internal/pkg/piwigo/category.go index 572b97a..6c1d3c0 100644 --- a/internal/pkg/piwigo/category.go +++ b/internal/pkg/piwigo/category.go @@ -11,15 +11,15 @@ import ( "os" ) -type PiwigoCategory struct { +type Category struct { Id int ParentId int Name string Key string } -func buildLookupMap(categories map[int]*PiwigoCategory) map[string]*PiwigoCategory { - categoryLookups := map[string]*PiwigoCategory{} +func buildLookupMap(categories map[int]*Category) map[string]*Category { + categoryLookups := map[string]*Category{} for _, category := range categories { logrus.Debugf("Loaded existing category %s", category.Key) categoryLookups[category.Key] = category @@ -27,15 +27,15 @@ func buildLookupMap(categories map[int]*PiwigoCategory) map[string]*PiwigoCatego return categoryLookups } -func buildCategoryMap(statusResponse *getCategoryListResponse) map[int]*PiwigoCategory { - categories := map[int]*PiwigoCategory{} +func buildCategoryMap(statusResponse *getCategoryListResponse) map[int]*Category { + categories := map[int]*Category{} for _, category := range statusResponse.Result.Categories { - categories[category.ID] = &PiwigoCategory{Id: category.ID, ParentId: category.IDUppercat, Name: category.Name, Key: category.Name} + categories[category.ID] = &Category{Id: category.ID, ParentId: category.IDUppercat, Name: category.Name, Key: category.Name} } return categories } -func buildCategoryKeys(categories map[int]*PiwigoCategory) { +func buildCategoryKeys(categories map[int]*Category) { for _, category := range categories { if category.ParentId == 0 { category.Key = category.Name diff --git a/internal/pkg/piwigo/piwigoContext.go b/internal/pkg/piwigo/piwigoContext.go index 4982b80..bd77bd4 100644 --- a/internal/pkg/piwigo/piwigoContext.go +++ b/internal/pkg/piwigo/piwigoContext.go @@ -19,7 +19,7 @@ import ( ) type PiwigoCategoryApi interface { - GetAllCategories() (map[string]*PiwigoCategory, error) + GetAllCategories() (map[string]*Category, error) CreateCategory(parentId int, name string) (int, error) } @@ -118,7 +118,7 @@ func (context *PiwigoContext) getStatus() (*getStatusResponse, error) { return &response, nil } -func (context *PiwigoContext) GetAllCategories() (map[string]*PiwigoCategory, error) { +func (context *PiwigoContext) GetAllCategories() (map[string]*Category, error) { formData := url.Values{} formData.Set("method", "pwg.categories.getList") formData.Set("recursive", "true")