1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

chore(edge): add transaction support for common objects EE-5079 (#8522)

This commit is contained in:
andres-portainer 2023-02-20 16:11:18 -03:00 committed by GitHub
parent 9a8e95d017
commit 95ac2cc4c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 676 additions and 26 deletions

View file

@ -9,10 +9,8 @@ import (
"github.com/rs/zerolog/log"
)
const (
// BucketName represents the name of the bucket where this service stores data.
BucketName = "edge_stack"
)
// BucketName represents the name of the bucket where this service stores data.
const BucketName = "edge_stack"
// Service represents a service for managing Edge stack data.
type Service struct {
@ -55,6 +53,13 @@ func NewService(connection portainer.Connection, cacheInvalidationFn func(portai
return s, nil
}
func (service *Service) Tx(tx portainer.Transaction) ServiceTx {
return ServiceTx{
service: service,
tx: tx,
}
}
// EdgeStacks returns an array containing all edge stacks
func (service *Service) EdgeStacks() ([]portainer.EdgeStack, error) {
var stacks = make([]portainer.EdgeStack, 0)