1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 14:59:41 +02:00

feat(code): equalize the code with EE EE-6218 (#10518)

This commit is contained in:
andres-portainer 2023-10-23 15:52:37 -03:00 committed by GitHub
parent e110856003
commit 6c55cac52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 15 deletions

View file

@ -5,10 +5,7 @@ import (
"github.com/portainer/portainer/api/dataservices" "github.com/portainer/portainer/api/dataservices"
) )
const ( const BucketName = "endpoint_groups"
// BucketName represents the name of the bucket where this service stores data.
BucketName = "endpoint_groups"
)
// Service represents a service for managing environment(endpoint) data. // Service represents a service for managing environment(endpoint) data.
type Service struct { type Service struct {

View file

@ -5,9 +5,7 @@ import (
"github.com/portainer/portainer/api/dataservices" "github.com/portainer/portainer/api/dataservices"
) )
const ( const BucketName = "snapshots"
BucketName = "snapshots"
)
type Service struct { type Service struct {
dataservices.BaseDataService[portainer.Snapshot, portainer.EndpointID] dataservices.BaseDataService[portainer.Snapshot, portainer.EndpointID]

View file

@ -106,7 +106,6 @@ func (service *Service) StackByWebhookID(id string) (*portainer.Stack, error) {
} }
return nil, err return nil, err
} }
// RefreshableStacks returns stacks that are configured for a periodic update // RefreshableStacks returns stacks that are configured for a periodic update

View file

@ -5,10 +5,8 @@ import (
"github.com/portainer/portainer/api/dataservices" "github.com/portainer/portainer/api/dataservices"
) )
const ( // BucketName represents the name of the bucket where this service stores data.
// BucketName represents the name of the bucket where this service stores data. const BucketName = "tags"
BucketName = "tags"
)
// Service represents a service for managing environment(endpoint) data. // Service represents a service for managing environment(endpoint) data.
type Service struct { type Service struct {

View file

@ -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 { func (service ServiceTx) UpdateTagFunc(ID portainer.TagID, updateFunc func(tag *portainer.Tag)) error {
return errors.New("cannot be called inside a transaction") return errors.New("cannot be called inside a transaction")
} }

View file

@ -477,7 +477,9 @@ type (
// EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints) // EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints)
EndpointAuthorizations map[EndpointID]Authorizations 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 { EndpointGroup struct {
// Environment(Endpoint) group Identifier // Environment(Endpoint) group Identifier
ID EndpointGroupID `json:"Id" example:"1"` ID EndpointGroupID `json:"Id" example:"1"`
@ -1123,7 +1125,9 @@ type (
// TeamID represents a team identifier // TeamID represents a team identifier
TeamID int 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 { TeamMembership struct {
// Membership Identifier // Membership Identifier
ID TeamMembershipID `json:"Id" example:"1"` ID TeamMembershipID `json:"Id" example:"1"`