datastore

package
v0.0.0-...-270f78c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupOptions

type BackupOptions struct {
	Version        string
	BackupDir      string
	BackupFileName string
	BackupPath     string
}

BackupOptions provide a helper to inject backup options

type Store

type Store struct {
	CustomTemplateService     *customtemplate.Service
	DockerHubService          *dockerhub.Service
	EdgeGroupService          *edgegroup.Service
	EdgeJobService            *edgejob.Service
	EdgeStackService          *edgestack.Service
	EndpointGroupService      *endpointgroup.Service
	EndpointService           *endpoint.Service
	EndpointRelationService   *endpointrelation.Service
	ExtensionService          *extension.Service
	FDOProfilesService        *fdoprofile.Service
	HelmUserRepositoryService *helmuserrepository.Service
	RegistryService           *registry.Service
	ResourceControlService    *resourcecontrol.Service
	RoleService               *role.Service
	APIKeyRepositoryService   *apikeyrepository.Service
	ScheduleService           *schedule.Service
	SettingsService           *settings.Service
	SnapshotService           *snapshot.Service
	SSLSettingsService        *ssl.Service
	StackService              *stack.Service
	TagService                *tag.Service
	TeamMembershipService     *teammembership.Service
	TeamService               *team.Service
	TunnelServerService       *tunnelserver.Service
	UserService               *user.Service
	VersionService            *version.Service
	WebhookService            *webhook.Service
	// contains filtered or unexported fields
}

Store defines the implementation of portainer.DataStore using BoltDB as the storage system.

func MustNewTestStore

func MustNewTestStore(t testing.TB, init, secure bool) (bool, *Store, func())

func NewStore

func NewStore(storePath string, fileService portainer.FileService, connection portainer.Connection) *Store

NewStore initializes a new Store and the associated services

func NewTestStore

func NewTestStore(t testing.TB, init, secure bool) (bool, *Store, func(), error)

func (*Store) APIKeyRepository

func (store *Store) APIKeyRepository() dataservices.APIKeyRepository

APIKeyRepository gives access to the api-key data management layer

func (*Store) Backup

func (store *Store) Backup(version *models.Version) (string, error)

Backup current database with default options

func (*Store) BackupTo

func (store *Store) BackupTo(w io.Writer) error

BackupTo backs up db to a provided writer. It does hot backup and doesn't block other database reads and writes

func (*Store) CheckCurrentEdition

func (store *Store) CheckCurrentEdition() error

CheckCurrentEdition checks if current edition is community edition

func (*Store) Close

func (store *Store) Close() error

func (*Store) Connection

func (store *Store) Connection() portainer.Connection

func (*Store) CustomTemplate

func (store *Store) CustomTemplate() dataservices.CustomTemplateService

CustomTemplate gives access to the CustomTemplate data management layer

func (*Store) EdgeGroup

func (store *Store) EdgeGroup() dataservices.EdgeGroupService

EdgeGroup gives access to the EdgeGroup data management layer

func (*Store) EdgeJob

func (store *Store) EdgeJob() dataservices.EdgeJobService

EdgeJob gives access to the EdgeJob data management layer

func (*Store) EdgeStack

func (store *Store) EdgeStack() dataservices.EdgeStackService

EdgeStack gives access to the EdgeStack data management layer

func (*Store) Endpoint

func (store *Store) Endpoint() dataservices.EndpointService

Environment(Endpoint) gives access to the Environment(Endpoint) data management layer

func (*Store) EndpointGroup

func (store *Store) EndpointGroup() dataservices.EndpointGroupService

EndpointGroup gives access to the EndpointGroup data management layer

func (*Store) EndpointRelation

func (store *Store) EndpointRelation() dataservices.EndpointRelationService

EndpointRelation gives access to the EndpointRelation data management layer

func (*Store) Export

func (store *Store) Export(filename string) (err error)

func (*Store) FDOProfile

func (store *Store) FDOProfile() dataservices.FDOProfileService

FDOProfile gives access to the FDOProfile data management layer

func (*Store) FailSafeMigrate

func (store *Store) FailSafeMigrate(migrator *migrator.Migrator, version *models.Version) (err error)

FailSafeMigrate backup and restore DB if migration fail

func (*Store) GetConnection

func (store *Store) GetConnection() portainer.Connection

func (*Store) HelmUserRepository

func (store *Store) HelmUserRepository() dataservices.HelmUserRepositoryService

HelmUserRepository access the helm user repository settings

func (*Store) Import

func (store *Store) Import(filename string) (err error)

func (*Store) Init

func (store *Store) Init() error

Init creates the default data set.

func (*Store) IsErrObjectNotFound

func (store *Store) IsErrObjectNotFound(e error) bool

TODO: move the use of this to dataservices.IsErrObjectNotFound()?

func (*Store) MigrateData

func (store *Store) MigrateData() error

func (*Store) Open

func (store *Store) Open() (newStore bool, err error)

Open opens and initializes the BoltDB database.

func (*Store) Registry

func (store *Store) Registry() dataservices.RegistryService

Registry gives access to the Registry data management layer

func (*Store) ResourceControl

func (store *Store) ResourceControl() dataservices.ResourceControlService

ResourceControl gives access to the ResourceControl data management layer

func (*Store) Role

func (store *Store) Role() dataservices.RoleService

Role gives access to the Role data management layer

func (*Store) Rollback

func (store *Store) Rollback(force bool) error

func (*Store) SSLSettings

func (store *Store) SSLSettings() dataservices.SSLSettingsService

SSLSettings gives access to the SSL Settings data management layer

func (*Store) Settings

func (store *Store) Settings() dataservices.SettingsService

Settings gives access to the Settings data management layer

func (*Store) Snapshot

func (store *Store) Snapshot() dataservices.SnapshotService

func (*Store) Stack

func (store *Store) Stack() dataservices.StackService

Stack gives access to the Stack data management layer

func (*Store) Tag

func (store *Store) Tag() dataservices.TagService

Tag gives access to the Tag data management layer

func (*Store) Team

func (store *Store) Team() dataservices.TeamService

Team gives access to the Team data management layer

func (*Store) TeamMembership

func (store *Store) TeamMembership() dataservices.TeamMembershipService

TeamMembership gives access to the TeamMembership data management layer

func (*Store) TunnelServer

func (store *Store) TunnelServer() dataservices.TunnelServerService

TunnelServer gives access to the TunnelServer data management layer

func (*Store) User

func (store *Store) User() dataservices.UserService

User gives access to the User data management layer

func (*Store) Version

func (store *Store) Version() dataservices.VersionService

Version gives access to the Version data management layer

func (*Store) Webhook

func (store *Store) Webhook() dataservices.WebhookService

Webhook gives access to the Webhook data management layer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL