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

feat(home): add a new home view (#2033)

This commit is contained in:
Anthony Lapenna 2018-07-11 10:39:20 +02:00 committed by GitHub
parent a94f2ee7b8
commit b6792461a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 994 additions and 399 deletions

27
api/docker/snapshotter.go Normal file
View file

@ -0,0 +1,27 @@
package docker
import (
"github.com/portainer/portainer"
)
// Snapshotter represents a service used to create endpoint snapshots
type Snapshotter struct {
clientFactory *ClientFactory
}
// NewSnapshotter returns a new Snapshotter instance
func NewSnapshotter(clientFactory *ClientFactory) *Snapshotter {
return &Snapshotter{
clientFactory: clientFactory,
}
}
// CreateSnapshot creates a snapshot of a specific endpoint
func (snapshotter *Snapshotter) CreateSnapshot(endpoint *portainer.Endpoint) (*portainer.Snapshot, error) {
cli, err := snapshotter.clientFactory.CreateClient(endpoint)
if err != nil {
return nil, err
}
return snapshot(cli)
}