service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidServiceType

func IsValidServiceType(serviceType string) bool

Types

type Backup

type Backup struct {
	Service CFService
	Files   []File
}

type CFService

type CFService struct {
	Name      string
	Label     string
	Plan      string
	Tags      []string
	Timeout   time.Duration
	Schedule  string
	Retention Retention
}

func (*CFService) Type

func (cf *CFService) Type() ServiceType

type File

type File struct {
	Key          string
	Filepath     string
	Filename     string
	Size         int64
	LastModified time.Time
}

type Retention

type Retention struct {
	Days  int
	Files int
}

type Service

type Service struct {
	App      *cfenv.App
	S3       *s3.Client
	Services []CFService
}

Service is used interact with services and dump/restore backups

func Get

func Get() *Service

func (*Service) Backup

func (s *Service) Backup(service CFService) error

func (*Service) BackupExists

func (s *Service) BackupExists(serviceType, serviceName, filename string) bool

func (*Service) DeleteBackup

func (s *Service) DeleteBackup(serviceType, serviceName, filename string) error

func (*Service) DownloadBackup

func (s *Service) DownloadBackup(serviceType, serviceName, filename string) (*os.File, error)

func (*Service) GetBackup

func (s *Service) GetBackup(serviceType, serviceName, filename string) (*Backup, error)

func (*Service) GetBackups

func (s *Service) GetBackups(serviceType, serviceName string) ([]Backup, error)

func (*Service) GetService

func (s *Service) GetService(serviceType, serviceName string) CFService

func (*Service) GetServices

func (s *Service) GetServices(serviceType, serviceName string) []CFService

func (*Service) ReadBackup

func (s *Service) ReadBackup(serviceType, serviceName, filename string) (io.Reader, error)

func (*Service) Restore

func (s *Service) Restore(service CFService, filename string) error

func (*Service) RetentionCleanup

func (s *Service) RetentionCleanup(service CFService) error

type ServiceType

type ServiceType int
const (
	Postgres ServiceType = iota
	MySQL
	MongoDB
)

func ParseServiceType

func ParseServiceType(serviceType string) ServiceType

func (ServiceType) String

func (s ServiceType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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