diff --git a/api/dataservices/endpointgroup/endpointgroup.go b/api/dataservices/endpointgroup/endpointgroup.go index d509ffeb9..c041b8dfb 100644 --- a/api/dataservices/endpointgroup/endpointgroup.go +++ b/api/dataservices/endpointgroup/endpointgroup.go @@ -5,10 +5,7 @@ import ( "github.com/portainer/portainer/api/dataservices" ) -const ( - // BucketName represents the name of the bucket where this service stores data. - BucketName = "endpoint_groups" -) +const BucketName = "endpoint_groups" // Service represents a service for managing environment(endpoint) data. type Service struct { diff --git a/api/dataservices/snapshot/snapshot.go b/api/dataservices/snapshot/snapshot.go index 4dad6a6ed..1f9cd5f9f 100644 --- a/api/dataservices/snapshot/snapshot.go +++ b/api/dataservices/snapshot/snapshot.go @@ -5,9 +5,7 @@ import ( "github.com/portainer/portainer/api/dataservices" ) -const ( - BucketName = "snapshots" -) +const BucketName = "snapshots" type Service struct { dataservices.BaseDataService[portainer.Snapshot, portainer.EndpointID] diff --git a/api/dataservices/stack/stack.go b/api/dataservices/stack/stack.go index 4114fdc8b..d6a2453c1 100644 --- a/api/dataservices/stack/stack.go +++ b/api/dataservices/stack/stack.go @@ -106,7 +106,6 @@ func (service *Service) StackByWebhookID(id string) (*portainer.Stack, error) { } return nil, err - } // RefreshableStacks returns stacks that are configured for a periodic update diff --git a/api/dataservices/tag/tag.go b/api/dataservices/tag/tag.go index 0b43ccabb..811ed75a4 100644 --- a/api/dataservices/tag/tag.go +++ b/api/dataservices/tag/tag.go @@ -5,10 +5,8 @@ import ( "github.com/portainer/portainer/api/dataservices" ) -const ( - // BucketName represents the name of the bucket where this service stores data. - BucketName = "tags" -) +// BucketName represents the name of the bucket where this service stores data. +const BucketName = "tags" // Service represents a service for managing environment(endpoint) data. type Service struct { diff --git a/api/dataservices/tag/tx.go b/api/dataservices/tag/tx.go index c7497613a..ba7cb2b02 100644 --- a/api/dataservices/tag/tx.go +++ b/api/dataservices/tag/tx.go @@ -22,7 +22,7 @@ func (service ServiceTx) Create(tag *portainer.Tag) error { ) } -// UpdateTagFunc is a no-op inside a transaction +// UpdateTagFunc is a no-op inside a transaction. func (service ServiceTx) UpdateTagFunc(ID portainer.TagID, updateFunc func(tag *portainer.Tag)) error { return errors.New("cannot be called inside a transaction") } diff --git a/api/portainer.go b/api/portainer.go index 0983a3643..1e2950e5d 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -477,7 +477,9 @@ type ( // EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints) EndpointAuthorizations map[EndpointID]Authorizations - // EndpointGroup represents a group of environments(endpoints) + // EndpointGroup represents a group of environments(endpoints). + // + // An environment(endpoint) may belong to only 1 environment(endpoint) group. EndpointGroup struct { // Environment(Endpoint) group Identifier ID EndpointGroupID `json:"Id" example:"1"` @@ -1123,7 +1125,9 @@ type ( // TeamID represents a team identifier TeamID int - // TeamMembership represents a membership association between a user and a team + // TeamMembership represents a membership association between a user and a team. + // + // A user may belong to multiple teams. TeamMembership struct { // Membership Identifier ID TeamMembershipID `json:"Id" example:"1"`