db

package
v0.0.0-...-519bf1e Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RolePlacement = "placement"
	RoleAutoScale = "autoscale"
	RoleCron      = "cron"
)

Variables

View Source
var AlreadyExists = fmt.Errorf("Entity already exists")
View Source
var IncorrectPreviousVersion = fmt.Errorf("Incorrect PreviousVersion")
View Source
var NotFound = fmt.Errorf("Not Found")

Functions

This section is empty.

Types

type Db

type Db interface {
	Migrate() error

	AcquireOrRenewRole(roleId string, nodeId string, lockDur time.Duration) (bool, string, error)
	ReleaseRole(roleId string, nodeId string) error
	ReleaseAllRoles(nodeId string) error

	ListProjects(input v1.ListProjectsInput) (v1.ListProjectsOutput, error)

	PutComponent(component v1.Component) (int64, error)
	GetComponent(componentName string) (v1.Component, error)
	ListComponents(input v1.ListComponentsInput) (v1.ListComponentsOutput, error)
	RemoveComponent(componentName string) (bool, error)

	GetComponentDeployCount(componentName string, version int64) (int, error)
	IncrementComponentDeployCount(componentName string, version int64) error

	PutEventSource(eventSource v1.EventSource) (int64, error)
	GetEventSource(eventSourceName string) (v1.EventSource, error)
	ListEventSources(input v1.ListEventSourcesInput) (v1.ListEventSourcesOutput, error)
	RemoveEventSource(eventSourceName string) (bool, error)
	SetEventSourcesEnabled(eventSourceNames []string, enabled bool) (int64, error)

	PutNodeStatus(status v1.NodeStatus) error
	ListNodeStatus() ([]v1.NodeStatus, error)
	RemoveNodeStatusOlderThan(observedAt time.Time) (int64, error)
	RemoveNodeStatus(nodeId string) (bool, error)
}

type SqlDb

type SqlDb struct {
	DebugLog bool
	// contains filtered or unexported fields
}

func NewSqlDb

func NewSqlDb(driver string, dsn string) (*SqlDb, error)

func NewTestSqlDb

func NewTestSqlDb() *SqlDb

func (*SqlDb) AcquireOrRenewRole

func (d *SqlDb) AcquireOrRenewRole(roleId string, nodeId string, lockDur time.Duration) (bool, string, error)

func (*SqlDb) Close

func (d *SqlDb) Close()

func (*SqlDb) DeleteAll

func (d *SqlDb) DeleteAll() error

func (*SqlDb) GetComponent

func (d *SqlDb) GetComponent(componentName string) (component v1.Component, err error)

func (*SqlDb) GetComponentDeployCount

func (d *SqlDb) GetComponentDeployCount(componentName string, version int64) (int, error)

func (*SqlDb) GetEventSource

func (d *SqlDb) GetEventSource(eventSourceName string) (es v1.EventSource, err error)

func (*SqlDb) IncrementComponentDeployCount

func (d *SqlDb) IncrementComponentDeployCount(componentName string, version int64) error

func (*SqlDb) ListComponents

func (d *SqlDb) ListComponents(input v1.ListComponentsInput) (output v1.ListComponentsOutput, err error)

func (*SqlDb) ListEventSources

func (d *SqlDb) ListEventSources(input v1.ListEventSourcesInput) (v1.ListEventSourcesOutput, error)

func (*SqlDb) ListNodeStatus

func (d *SqlDb) ListNodeStatus() ([]v1.NodeStatus, error)

func (*SqlDb) ListProjects

func (d *SqlDb) ListProjects(input v1.ListProjectsInput) (v1.ListProjectsOutput, error)

func (*SqlDb) Migrate

func (d *SqlDb) Migrate() error

func (*SqlDb) PutComponent

func (d *SqlDb) PutComponent(component v1.Component) (int64, error)

func (*SqlDb) PutEventSource

func (d *SqlDb) PutEventSource(eventSource v1.EventSource) (int64, error)

func (*SqlDb) PutNodeStatus

func (d *SqlDb) PutNodeStatus(status v1.NodeStatus) error

func (*SqlDb) ReleaseAllRoles

func (d *SqlDb) ReleaseAllRoles(nodeId string) error

func (*SqlDb) ReleaseRole

func (d *SqlDb) ReleaseRole(roleId string, nodeId string) error

func (*SqlDb) RemoveComponent

func (d *SqlDb) RemoveComponent(componentName string) (found bool, err error)

func (*SqlDb) RemoveEventSource

func (d *SqlDb) RemoveEventSource(eventSourceName string) (bool, error)

func (*SqlDb) RemoveNodeStatus

func (d *SqlDb) RemoveNodeStatus(nodeId string) (bool, error)

func (*SqlDb) RemoveNodeStatusOlderThan

func (d *SqlDb) RemoveNodeStatusOlderThan(observedAt time.Time) (int64, error)

func (*SqlDb) SetEventSourcesEnabled

func (d *SqlDb) SetEventSourcesEnabled(eventSourceNames []string, enabled bool) (int64, error)

Jump to

Keyboard shortcuts

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