store

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

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

Local ..

func (*Local) CurrentlyQueuedTasksCount added in v0.5.1

func (l *Local) CurrentlyQueuedTasksCount() (count uint64, err error)

CurrentlyQueuedTasksCount ..

func (*Local) DelEnvironment

func (l *Local) DelEnvironment(k schemas.EnvironmentKey) error

DelEnvironment ..

func (*Local) DelMetric

func (l *Local) DelMetric(k schemas.MetricKey) error

DelMetric ..

func (*Local) DelProject

func (l *Local) DelProject(k schemas.ProjectKey) error

DelProject ..

func (*Local) DelRef

func (l *Local) DelRef(k schemas.RefKey) error

DelRef ..

func (*Local) EnvironmentExists

func (l *Local) EnvironmentExists(k schemas.EnvironmentKey) (bool, error)

EnvironmentExists ..

func (*Local) Environments

func (l *Local) Environments() (environments schemas.Environments, err error)

Environments ..

func (*Local) EnvironmentsCount

func (l *Local) EnvironmentsCount() (int64, error)

EnvironmentsCount ..

func (*Local) ExecutedTasksCount added in v0.5.1

func (l *Local) ExecutedTasksCount() (uint64, error)

ExecutedTasksCount ..

func (*Local) GetEnvironment

func (l *Local) GetEnvironment(environment *schemas.Environment) error

GetEnvironment ..

func (*Local) GetMetric

func (l *Local) GetMetric(m *schemas.Metric) error

GetMetric ..

func (*Local) GetProject

func (l *Local) GetProject(p *schemas.Project) error

GetProject ..

func (*Local) GetRef

func (l *Local) GetRef(ref *schemas.Ref) error

GetRef ..

func (*Local) MetricExists

func (l *Local) MetricExists(k schemas.MetricKey) (bool, error)

MetricExists ..

func (*Local) Metrics

func (l *Local) Metrics() (metrics schemas.Metrics, err error)

Metrics ..

func (*Local) MetricsCount

func (l *Local) MetricsCount() (int64, error)

MetricsCount ..

func (*Local) ProjectExists

func (l *Local) ProjectExists(k schemas.ProjectKey) (bool, error)

ProjectExists ..

func (*Local) Projects

func (l *Local) Projects() (projects schemas.Projects, err error)

Projects ..

func (*Local) ProjectsCount

func (l *Local) ProjectsCount() (int64, error)

ProjectsCount ..

func (*Local) QueueTask added in v0.5.1

func (l *Local) QueueTask(tt schemas.TaskType, uniqueID string) (bool, error)

QueueTask registers that we are queueing the task

func (*Local) RefExists

func (l *Local) RefExists(k schemas.RefKey) (bool, error)

RefExists ..

func (*Local) Refs

func (l *Local) Refs() (refs schemas.Refs, err error)

Refs ..

func (*Local) RefsCount

func (l *Local) RefsCount() (int64, error)

RefsCount ..

func (*Local) SetEnvironment

func (l *Local) SetEnvironment(environment schemas.Environment) error

SetEnvironment ..

func (*Local) SetMetric

func (l *Local) SetMetric(m schemas.Metric) error

SetMetric ..

func (*Local) SetProject

func (l *Local) SetProject(p schemas.Project) error

SetProject ..

func (*Local) SetRef

func (l *Local) SetRef(ref schemas.Ref) error

SetRef ..

func (*Local) UnqueueTask added in v0.5.1

func (l *Local) UnqueueTask(tt schemas.TaskType, uniqueID string) error

UnqueueTask removes the task from the tracker

type Redis

type Redis struct {
	*redis.Client
	// contains filtered or unexported fields
}

Redis ..

func (*Redis) CurrentlyQueuedTasksCount added in v0.5.1

func (r *Redis) CurrentlyQueuedTasksCount() (uint64, error)

CurrentlyQueuedTasksCount ..

func (*Redis) DelEnvironment

func (r *Redis) DelEnvironment(k schemas.EnvironmentKey) error

DelEnvironment ..

func (*Redis) DelMetric

func (r *Redis) DelMetric(k schemas.MetricKey) error

DelMetric ..

func (*Redis) DelProject

func (r *Redis) DelProject(k schemas.ProjectKey) error

DelProject ..

func (*Redis) DelRef

func (r *Redis) DelRef(k schemas.RefKey) error

DelRef ..

func (*Redis) EnvironmentExists

func (r *Redis) EnvironmentExists(k schemas.EnvironmentKey) (bool, error)

EnvironmentExists ..

func (*Redis) Environments

func (r *Redis) Environments() (schemas.Environments, error)

Environments ..

func (*Redis) EnvironmentsCount

func (r *Redis) EnvironmentsCount() (int64, error)

EnvironmentsCount ..

func (*Redis) ExecutedTasksCount added in v0.5.1

func (r *Redis) ExecutedTasksCount() (uint64, error)

ExecutedTasksCount ..

func (*Redis) GetEnvironment

func (r *Redis) GetEnvironment(e *schemas.Environment) error

GetEnvironment ..

func (*Redis) GetMetric

func (r *Redis) GetMetric(m *schemas.Metric) error

GetMetric ..

func (*Redis) GetProject

func (r *Redis) GetProject(p *schemas.Project) error

GetProject ..

func (*Redis) GetRef

func (r *Redis) GetRef(ref *schemas.Ref) error

GetRef ..

func (*Redis) MetricExists

func (r *Redis) MetricExists(k schemas.MetricKey) (bool, error)

MetricExists ..

func (*Redis) Metrics

func (r *Redis) Metrics() (schemas.Metrics, error)

Metrics ..

func (*Redis) MetricsCount

func (r *Redis) MetricsCount() (int64, error)

MetricsCount ..

func (*Redis) ProjectExists

func (r *Redis) ProjectExists(k schemas.ProjectKey) (bool, error)

ProjectExists ..

func (*Redis) Projects

func (r *Redis) Projects() (schemas.Projects, error)

Projects ..

func (*Redis) ProjectsCount

func (r *Redis) ProjectsCount() (int64, error)

ProjectsCount ..

func (*Redis) QueueTask added in v0.5.1

func (r *Redis) QueueTask(tt schemas.TaskType, uniqueID string) (bool, error)

QueueTask registers that we are queueing the task

func (*Redis) RefExists

func (r *Redis) RefExists(k schemas.RefKey) (bool, error)

RefExists ..

func (*Redis) Refs

func (r *Redis) Refs() (schemas.Refs, error)

Refs ..

func (*Redis) RefsCount

func (r *Redis) RefsCount() (int64, error)

RefsCount ..

func (*Redis) SetEnvironment

func (r *Redis) SetEnvironment(e schemas.Environment) error

SetEnvironment ..

func (*Redis) SetMetric

func (r *Redis) SetMetric(m schemas.Metric) error

SetMetric ..

func (*Redis) SetProject

func (r *Redis) SetProject(p schemas.Project) error

SetProject ..

func (*Redis) SetRef

func (r *Redis) SetRef(ref schemas.Ref) error

SetRef ..

func (*Redis) UnqueueTask added in v0.5.1

func (r *Redis) UnqueueTask(tt schemas.TaskType, uniqueID string) (err error)

UnqueueTask removes the task from the tracker

type Store

type Store interface {
	SetProject(schemas.Project) error
	DelProject(schemas.ProjectKey) error
	GetProject(*schemas.Project) error
	ProjectExists(schemas.ProjectKey) (bool, error)
	Projects() (schemas.Projects, error)
	ProjectsCount() (int64, error)

	SetEnvironment(schemas.Environment) error
	DelEnvironment(schemas.EnvironmentKey) error
	GetEnvironment(*schemas.Environment) error
	EnvironmentExists(schemas.EnvironmentKey) (bool, error)
	Environments() (schemas.Environments, error)
	EnvironmentsCount() (int64, error)

	SetRef(schemas.Ref) error
	DelRef(schemas.RefKey) error
	GetRef(*schemas.Ref) error
	RefExists(schemas.RefKey) (bool, error)
	Refs() (schemas.Refs, error)
	RefsCount() (int64, error)

	SetMetric(schemas.Metric) error
	DelMetric(schemas.MetricKey) error
	GetMetric(*schemas.Metric) error
	MetricExists(schemas.MetricKey) (bool, error)
	Metrics() (schemas.Metrics, error)
	MetricsCount() (int64, error)

	// Helpers to keep track of currently queued tasks and avoid scheduling them
	// twice at the risk of ending up with loads of dangling goroutines being locked
	QueueTask(schemas.TaskType, string) (bool, error)
	UnqueueTask(schemas.TaskType, string) error
	CurrentlyQueuedTasksCount() (uint64, error)
	ExecutedTasksCount() (uint64, error)
}

Store ..

func New

func New(
	r *redis.Client,
	projects config.Projects,
) (s Store)

New creates a new store and populates it with provided []schemas.Project

func NewLocalStore

func NewLocalStore() Store

NewLocalStore ..

func NewRedisStore

func NewRedisStore(client *redis.Client) Store

NewRedisStore ..

Jump to

Keyboard shortcuts

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