From b553aa9b90b1233a10d451b42a3a07d601babc55 Mon Sep 17 00:00:00 2001 From: Anjani Kumar Srivastava Date: Wed, 1 May 2024 17:51:53 +0000 Subject: [PATCH 1/3] published_on struct used to get added even when it's empty on registration of providers --- .../version_manager/version_manager.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/provider/services/version_manager/version_manager.go b/internal/provider/services/version_manager/version_manager.go index f9c6610..46eea3c 100644 --- a/internal/provider/services/version_manager/version_manager.go +++ b/internal/provider/services/version_manager/version_manager.go @@ -57,16 +57,16 @@ type VersionManagerService struct { } type Provider struct { - Name string `json:"name" bson:"name" dynamodbav:"name"` - Version string `json:"version" bson:"version" dynamodbav:"version"` - Protocols []string `json:"protocols" bson:"protocols" dynamodbav:"protocols"` - Platforms []*terrarium.PlatformItem `json:"platforms" bson:"platforms" dynamodbav:"platforms"` - Description string `json:"description" bson:"description" dynamodbav:"description"` - SourceRepoUrl string `json:"source_repo_url" bson:"source_repo_url" dynamodbav:"source_repo_url"` - Maturity string `json:"maturity" bson:"maturity" dynamodbav:"maturity"` - CreatedOn string `json:"created_on" bson:"created_on" dynamodbav:"created_on"` - ModifiedOn string `json:"modified_on" bson:"modified_on" dynamodbav:"modified_on"` - PublishedOn string `json:"published_on" bson:"published_on" dynamodbav:"published_on"` + Name string `json:"name,omitempty" bson:"name,omitempty" dynamodbav:"name,omitempty"` + Version string `json:"version,omitempty" bson:"version,omitempty" dynamodbav:"version,omitempty"` + Protocols []string `json:"protocols,omitempty" bson:"protocols,omitempty" dynamodbav:"protocols,omitempty"` + Platforms []*terrarium.PlatformItem `json:"platforms,omitempty" bson:"platforms,omitempty" dynamodbav:"platforms,omitempty"` + Description string `json:"description,omitempty" bson:"description,omitempty" dynamodbav:"description,omitempty"` + SourceRepoUrl string `json:"source_repo_url,omitempty" bson:"source_repo_url,omitempty" dynamodbav:"source_repo_url,omitempty"` + Maturity string `json:"maturity,omitempty" bson:"maturity,omitempty" dynamodbav:"maturity,omitempty"` + CreatedOn string `json:"created_on,omitempty" bson:"created_on,omitempty" dynamodbav:"created_on"` + ModifiedOn string `json:"modified_on,omitempty" bson:"modified_on,omitempty" dynamodbav:"modified_on,omitempty"` + PublishedOn string `json:"published_on,omitempty" bson:"published_on,omitempty" dynamodbav:"published_on,omitempty"` } // RegisterWithServer Registers VersionManagerService with grpc server From 51fef880e09938fdb2c3da17b0f6479df00e3ab5 Mon Sep 17 00:00:00 2001 From: Anjani Kumar Srivastava Date: Wed, 1 May 2024 17:56:36 +0000 Subject: [PATCH 2/3] go fmt --- internal/provider/services/version_manager/version_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/services/version_manager/version_manager.go b/internal/provider/services/version_manager/version_manager.go index 46eea3c..8e63ff9 100644 --- a/internal/provider/services/version_manager/version_manager.go +++ b/internal/provider/services/version_manager/version_manager.go @@ -57,7 +57,7 @@ type VersionManagerService struct { } type Provider struct { - Name string `json:"name,omitempty" bson:"name,omitempty" dynamodbav:"name,omitempty"` + Name string `json:"name,omitempty" bson:"name,omitempty" dynamodbav:"name,omitempty"` Version string `json:"version,omitempty" bson:"version,omitempty" dynamodbav:"version,omitempty"` Protocols []string `json:"protocols,omitempty" bson:"protocols,omitempty" dynamodbav:"protocols,omitempty"` Platforms []*terrarium.PlatformItem `json:"platforms,omitempty" bson:"platforms,omitempty" dynamodbav:"platforms,omitempty"` From a2ce6886c8f273ff5a3b669c6be00e71a4abe675 Mon Sep 17 00:00:00 2001 From: Anjani Kumar Srivastava Date: Thu, 13 Jun 2024 15:51:16 +0000 Subject: [PATCH 3/3] removed omitempty from some of the fields where it's not helpful --- .../services/version_manager/version_manager.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/provider/services/version_manager/version_manager.go b/internal/provider/services/version_manager/version_manager.go index 8e63ff9..85d4e00 100644 --- a/internal/provider/services/version_manager/version_manager.go +++ b/internal/provider/services/version_manager/version_manager.go @@ -57,14 +57,14 @@ type VersionManagerService struct { } type Provider struct { - Name string `json:"name,omitempty" bson:"name,omitempty" dynamodbav:"name,omitempty"` - Version string `json:"version,omitempty" bson:"version,omitempty" dynamodbav:"version,omitempty"` - Protocols []string `json:"protocols,omitempty" bson:"protocols,omitempty" dynamodbav:"protocols,omitempty"` - Platforms []*terrarium.PlatformItem `json:"platforms,omitempty" bson:"platforms,omitempty" dynamodbav:"platforms,omitempty"` - Description string `json:"description,omitempty" bson:"description,omitempty" dynamodbav:"description,omitempty"` - SourceRepoUrl string `json:"source_repo_url,omitempty" bson:"source_repo_url,omitempty" dynamodbav:"source_repo_url,omitempty"` - Maturity string `json:"maturity,omitempty" bson:"maturity,omitempty" dynamodbav:"maturity,omitempty"` - CreatedOn string `json:"created_on,omitempty" bson:"created_on,omitempty" dynamodbav:"created_on"` + Name string `json:"name" bson:"name" dynamodbav:"name"` + Version string `json:"version" bson:"version" dynamodbav:"version"` + Protocols []string `json:"protocols" bson:"protocols" dynamodbav:"protocols"` + Platforms []*terrarium.PlatformItem `json:"platforms" bson:"platforms" dynamodbav:"platforms"` + Description string `json:"description" bson:"description" dynamodbav:"description"` + SourceRepoUrl string `json:"source_repo_url" bson:"source_repo_url" dynamodbav:"source_repo_url"` + Maturity string `json:"maturity" bson:"maturity" dynamodbav:"maturity"` + CreatedOn string `json:"created_on" bson:"created_on" dynamodbav:"created_on"` ModifiedOn string `json:"modified_on,omitempty" bson:"modified_on,omitempty" dynamodbav:"modified_on,omitempty"` PublishedOn string `json:"published_on,omitempty" bson:"published_on,omitempty" dynamodbav:"published_on,omitempty"` }