database

package
v0.0.0-...-ce96b73 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *sql.DB)

func GetConninfo

func GetConninfo() (string, error)

func NewFileStore

func NewFileStore(db *sql.DB) *fileStore

func Open

func Open() *sql.DB

Types

type App

type App struct {
	Id   string
	Name string
}

type AppDeleter

type AppDeleter interface {
	Delete(string) (*App, error)
}

type AppStore

type AppStore interface {
	ListAll() ([]App, error)
	Create(App) (*App, error)
	Get(string) (*App, error)
	AppUpdater
	AppDeleter

	UpdateComponents(ctx context.Context, id string, components []string) error
}

func NewAppStore

func NewAppStore(db *sql.DB) AppStore

type AppUpdater

type AppUpdater interface {
	Update(*App) (*App, error)
}

type Archive

type Archive struct {
	File
	Files
}

An archive is a file containing other files (e.g. zip, tar, ...)

type ArchiveLookup

type ArchiveLookup interface {
	// Find archives containing the specified file
	FindByContent(f *File) ([]Archive, error)
}

type Component

type Component struct {
	Id      string
	Name    string
	Updated time.Time
	Version string
	Image   string
}

type ComponentStore

type ComponentStore interface {
	Create(string) (*Component, error)
	CreateIfAbsent(string) (*Component, error)
	SetImage(string, string) (*Component, error)
	GetByName(name string) (*Component, error)
	ListAll() ([]Component, error)
	ListAllForApp(id string) ([]Component, error)
	ListUnassigned() ([]Component, error)
	ListUnassignedForApp(id string) ([]Component, error)
}

func NewComponentStore

func NewComponentStore(db *sql.DB) ComponentStore

type Deployment

type Deployment struct {
	ComponentId string
	PlatformId  string
	ImageRef    string
	Updated     time.Time
}

type DeploymentCounter

type DeploymentCounter interface {
	CountFor(componentId string) (int, error)
}

type DeploymentLister

type DeploymentLister interface {
	ListForEnv(componentId, envId string) ([]Deployment, error)
}

type DeploymentRemover

type DeploymentRemover interface {
	RemoveImage(componentId, platformId string) error
}

type DeploymentStore

func NewDeploymentStore

func NewDeploymentStore(db *sql.DB) DeploymentStore

type DeploymentUpdater

type DeploymentUpdater interface {
	SetImage(componentId, platformId, imageRef string) (*Deployment, error)
}

type Env

type Env struct {
	Id    string
	Name  string
	Order int
}

type EnvCreator

type EnvCreator interface {
	Create(name string) (*Env, error)
}

type EnvDeleter

type EnvDeleter interface {
	Delete(id string) (*Env, error)
}

type EnvFinder

type EnvFinder interface {
	FindByName(name string) (*Env, error)
}

type EnvGetter

type EnvGetter interface {
	Get(id string) (*Env, error)
}

type EnvLister

type EnvLister interface {
	List() ([]Env, error)
}

type EnvStore

func NewEnvStore

func NewEnvStore(db *sql.DB) EnvStore

type EnvUpdater

type EnvUpdater interface {
	Update(env *Env) (*Env, error)
}

type ErrDatabaseAccess

type ErrDatabaseAccess struct {
	// contains filtered or unexported fields
}

func (*ErrDatabaseAccess) Error

func (e *ErrDatabaseAccess) Error() string

type ErrNotFound

type ErrNotFound struct {
	ErrDatabaseAccess
}

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type File

type File struct {
	Id     string
	Name   string
	Digest string
	Parent string
}

func (*File) String

func (f *File) String() string

type FileCreater

type FileCreater interface {
	// Create(f *File) (*File, error)
	CreateIfAbsent(f *File) (*File, error)
}

type FileDigestFinder

type FileDigestFinder interface {
	FindByDigest(string) ([]File, error)
}

type FileLookup

type FileLookup interface {
	Get(string) (*File, error)
	FindByParent(string) ([]File, error)
	FileDigestFinder
}

type FileStore

type FileStore interface {
	ArchiveLookup
	FileCreater
	FileLookup
}

type Files

type Files []File

func (Files) Len

func (f Files) Len() int

func (Files) Less

func (f Files) Less(i, j int) bool

func (Files) Swap

func (f Files) Swap(i, j int)
type ImageLink struct {
	Id     string
	FileId string
}

type ImageLinker

type ImageLinker interface {
	AddLink(id, fileId string) (*ImageLink, error)
	Count(image string) (int, error)
}

func NewImageStore

func NewImageStore(db *sql.DB) ImageLinker

type PlatformCreator

type PlatformCreator interface {
	Create(envId, name string) (*api.Platform, error)
}

type PlatformDeleter

type PlatformDeleter interface {
	Delete(id string) (*api.Platform, error)
}

type PlatformGetter

type PlatformGetter interface {
	Get(id string) (*api.Platform, error)
}

type PlatformLister

type PlatformLister interface {
	List() ([]api.Platform, error)
	ListForEnv(envId string) ([]api.Platform, error)
}

type PlatformLookup

type PlatformLookup interface {
	Lookup(envId, name string) (*api.Platform, error)
}

type PlatformUpdater

type PlatformUpdater interface {
	Update(p *api.Platform) (*api.Platform, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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