Documentation
¶
Index ¶
- type Local
- func (l *Local) CurrentlyQueuedTasksCount(_ context.Context) (count uint64, err error)
- func (l *Local) DelEnvironment(_ context.Context, k schemas.EnvironmentKey) error
- func (l *Local) DelMetric(_ context.Context, k schemas.MetricKey) error
- func (l *Local) DelProject(_ context.Context, k schemas.ProjectKey) error
- func (l *Local) DelRef(_ context.Context, k schemas.RefKey) error
- func (l *Local) EnvironmentExists(_ context.Context, k schemas.EnvironmentKey) (bool, error)
- func (l *Local) Environments(_ context.Context) (environments schemas.Environments, err error)
- func (l *Local) EnvironmentsCount(_ context.Context) (int64, error)
- func (l *Local) ExecutedTasksCount(_ context.Context) (uint64, error)
- func (l *Local) GetEnvironment(ctx context.Context, environment *schemas.Environment) error
- func (l *Local) GetMetric(ctx context.Context, m *schemas.Metric) error
- func (l *Local) GetProject(ctx context.Context, p *schemas.Project) error
- func (l *Local) GetRef(ctx context.Context, ref *schemas.Ref) error
- func (l *Local) MetricExists(_ context.Context, k schemas.MetricKey) (bool, error)
- func (l *Local) Metrics(_ context.Context) (metrics schemas.Metrics, err error)
- func (l *Local) MetricsCount(_ context.Context) (int64, error)
- func (l *Local) ProjectExists(_ context.Context, k schemas.ProjectKey) (bool, error)
- func (l *Local) Projects(_ context.Context) (projects schemas.Projects, err error)
- func (l *Local) ProjectsCount(_ context.Context) (int64, error)
- func (l *Local) QueueTask(_ context.Context, tt schemas.TaskType, uniqueID, _ string) (bool, error)
- func (l *Local) RefExists(_ context.Context, k schemas.RefKey) (bool, error)
- func (l *Local) Refs(_ context.Context) (refs schemas.Refs, err error)
- func (l *Local) RefsCount(_ context.Context) (int64, error)
- func (l *Local) SetEnvironment(_ context.Context, environment schemas.Environment) error
- func (l *Local) SetMetric(_ context.Context, m schemas.Metric) error
- func (l *Local) SetProject(_ context.Context, p schemas.Project) error
- func (l *Local) SetRef(_ context.Context, ref schemas.Ref) error
- func (l *Local) UnqueueTask(_ context.Context, tt schemas.TaskType, uniqueID string) error
- type Redis
- func (r *Redis) CurrentlyQueuedTasksCount(ctx context.Context) (count uint64, err error)
- func (r *Redis) DelEnvironment(ctx context.Context, k schemas.EnvironmentKey) error
- func (r *Redis) DelMetric(ctx context.Context, k schemas.MetricKey) error
- func (r *Redis) DelProject(ctx context.Context, k schemas.ProjectKey) error
- func (r *Redis) DelRef(ctx context.Context, k schemas.RefKey) error
- func (r *Redis) EnvironmentExists(ctx context.Context, k schemas.EnvironmentKey) (bool, error)
- func (r *Redis) Environments(ctx context.Context) (schemas.Environments, error)
- func (r *Redis) EnvironmentsCount(ctx context.Context) (int64, error)
- func (r *Redis) ExecutedTasksCount(ctx context.Context) (uint64, error)
- func (r *Redis) GetEnvironment(ctx context.Context, e *schemas.Environment) error
- func (r *Redis) GetMetric(ctx context.Context, m *schemas.Metric) error
- func (r *Redis) GetProject(ctx context.Context, p *schemas.Project) error
- func (r *Redis) GetRef(ctx context.Context, ref *schemas.Ref) error
- func (r *Redis) KeepaliveExists(ctx context.Context, uuid string) (bool, error)
- func (r *Redis) MetricExists(ctx context.Context, k schemas.MetricKey) (bool, error)
- func (r *Redis) Metrics(ctx context.Context) (schemas.Metrics, error)
- func (r *Redis) MetricsCount(ctx context.Context) (int64, error)
- func (r *Redis) ProjectExists(ctx context.Context, k schemas.ProjectKey) (bool, error)
- func (r *Redis) Projects(ctx context.Context) (schemas.Projects, error)
- func (r *Redis) ProjectsCount(ctx context.Context) (int64, error)
- func (r *Redis) QueueTask(ctx context.Context, tt schemas.TaskType, taskUUID, processUUID string) (set bool, err error)
- func (r *Redis) RefExists(ctx context.Context, k schemas.RefKey) (bool, error)
- func (r *Redis) Refs(ctx context.Context) (schemas.Refs, error)
- func (r *Redis) RefsCount(ctx context.Context) (int64, error)
- func (r *Redis) SetEnvironment(ctx context.Context, e schemas.Environment) error
- func (r *Redis) SetKeepalive(ctx context.Context, uuid string, ttl time.Duration) (bool, error)
- func (r *Redis) SetMetric(ctx context.Context, m schemas.Metric) error
- func (r *Redis) SetProject(ctx context.Context, p schemas.Project) error
- func (r *Redis) SetRef(ctx context.Context, ref schemas.Ref) error
- func (r *Redis) UnqueueTask(ctx context.Context, tt schemas.TaskType, taskUUID string) (err error)
- type Store
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 represents an in-memory storage implementation for managing projects, environments, references, and metrics.
func (*Local) CurrentlyQueuedTasksCount ¶
CurrentlyQueuedTasksCount returns the count of currently queued tasks.
func (*Local) DelEnvironment ¶
DelEnvironment deletes an environment from the local storage.
func (*Local) DelProject ¶
DelProject deletes a project from the local storage.
func (*Local) EnvironmentExists ¶
EnvironmentExists checks if an environment exists in the local storage.
func (*Local) Environments ¶
Environments retrieves all environments from the local storage.
func (*Local) EnvironmentsCount ¶
EnvironmentsCount returns the count of environments in the local storage.
func (*Local) ExecutedTasksCount ¶
ExecutedTasksCount returns the count of executed tasks.
func (*Local) GetEnvironment ¶
GetEnvironment retrieves an environment from the local storage.
func (*Local) GetProject ¶
GetProject retrieves a project from the local storage.
func (*Local) MetricExists ¶
MetricExists checks if a metric exists in the local storage.
func (*Local) MetricsCount ¶
MetricsCount returns the count of metrics in the local storage.
func (*Local) ProjectExists ¶
ProjectExists checks if a project exists in the local storage.
func (*Local) ProjectsCount ¶
ProjectsCount returns the count of projects in the local storage.
func (*Local) QueueTask ¶
QueueTask registers that we are queueing the task. It returns true if it managed to schedule it, false if it was already scheduled.
func (*Local) SetEnvironment ¶
SetEnvironment stores an environment in the local storage.
func (*Local) SetProject ¶
SetProject stores a project in the local storage.
type Redis ¶
Redis represents a Redis client wrapper.
func (*Redis) CurrentlyQueuedTasksCount ¶
CurrentlyQueuedTasksCount returns the count of currently queued tasks.
func (*Redis) DelEnvironment ¶
DelEnvironment deletes an environment from Redis.
func (*Redis) DelProject ¶
DelProject deletes a project from Redis.
func (*Redis) EnvironmentExists ¶
EnvironmentExists checks if an environment exists in Redis.
func (*Redis) Environments ¶
Environments retrieves all environments from Redis.
func (*Redis) EnvironmentsCount ¶
EnvironmentsCount returns the count of environments in Redis.
func (*Redis) ExecutedTasksCount ¶
ExecutedTasksCount returns the count of executed tasks.
func (*Redis) GetEnvironment ¶
GetEnvironment retrieves an environment from Redis.
func (*Redis) GetProject ¶
GetProject retrieves a project from Redis.
func (*Redis) KeepaliveExists ¶
KeepaliveExists returns whether a keepalive exists or not for a particular UUID.
func (*Redis) MetricExists ¶
MetricExists checks if a metric exists in Redis.
func (*Redis) MetricsCount ¶
MetricsCount returns the count of metrics in Redis.
func (*Redis) ProjectExists ¶
ProjectExists checks if a project exists in Redis.
func (*Redis) ProjectsCount ¶
ProjectsCount returns the count of projects in Redis.
func (*Redis) QueueTask ¶
func (r *Redis) QueueTask(ctx context.Context, tt schemas.TaskType, taskUUID, processUUID string) (set bool, err error)
QueueTask registers that we are queueing the task. It returns true if it managed to schedule it, false if it was already scheduled.
func (*Redis) SetEnvironment ¶
SetEnvironment stores an environment in Redis.
func (*Redis) SetKeepalive ¶
SetKeepalive sets a key with a UUID corresponding to the currently running process.
func (*Redis) SetProject ¶
SetProject stores a project in Redis.
type Store ¶
type Store interface {
// Methods for manipulating projects
SetProject(ctx context.Context, p schemas.Project) error // Stores a project
DelProject(ctx context.Context, pk schemas.ProjectKey) error // Deletes a project
GetProject(ctx context.Context, p *schemas.Project) error // Retrieves a project
ProjectExists(ctx context.Context, pk schemas.ProjectKey) (bool, error) // Checks the existence of a project
Projects(ctx context.Context) (schemas.Projects, error) // Retrieves all projects
ProjectsCount(ctx context.Context) (int64, error) // Counts the number of projects
// Methods for manipulating environments
SetEnvironment(ctx context.Context, e schemas.Environment) error // Stores an environment
DelEnvironment(ctx context.Context, ek schemas.EnvironmentKey) error // Deletes an environment
GetEnvironment(ctx context.Context, e *schemas.Environment) error // Retrieves an environment
EnvironmentExists(ctx context.Context, ek schemas.EnvironmentKey) (bool, error) // Checks the existence of an environment
Environments(ctx context.Context) (schemas.Environments, error) // Retrieves all environments
EnvironmentsCount(ctx context.Context) (int64, error) // Counts the number of environments
// Methods for manipulating references
SetRef(ctx context.Context, r schemas.Ref) error // Stores a reference
DelRef(ctx context.Context, rk schemas.RefKey) error // Deletes a reference
GetRef(ctx context.Context, r *schemas.Ref) error // Retrieves a reference
RefExists(ctx context.Context, rk schemas.RefKey) (bool, error) // Checks the existence of a reference
Refs(ctx context.Context) (schemas.Refs, error) // Retrieves all references
RefsCount(ctx context.Context) (int64, error) // Counts the number of references
// Methods for manipulating metrics
SetMetric(ctx context.Context, m schemas.Metric) error // Stores a metric
DelMetric(ctx context.Context, mk schemas.MetricKey) error // Deletes a metric
GetMetric(ctx context.Context, m *schemas.Metric) error // Retrieves a metric
MetricExists(ctx context.Context, mk schemas.MetricKey) (bool, error) // Checks the existence of a metric
Metrics(ctx context.Context) (schemas.Metrics, error) // Retrieves all metrics
MetricsCount(ctx context.Context) (int64, error) // Counts the number of metrics
// Methods for managing queued tasks
QueueTask(ctx context.Context, tt schemas.TaskType, taskUUID, processUUID string) (bool, error) // Adds a task to the queue
UnqueueTask(ctx context.Context, tt schemas.TaskType, taskUUID string) error // Removes a task from the queue
CurrentlyQueuedTasksCount(ctx context.Context) (uint64, error) // Counts the number of currently queued tasks
ExecutedTasksCount(ctx context.Context) (uint64, error) // Counts the number of executed tasks
}
Store is an interface that defines methods for interacting with storage. It includes methods for manipulating projects, environments, references, and metrics.
func NewLocalStore ¶
func NewLocalStore() Store
NewLocalStore creates a new instance of local storage.
func NewRedisStore ¶
NewRedisStore creates a new instance of storage using Redis.