memory

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package memory provides an in-memory implementation of the store.Store interface. It uses maps protected by a sync.RWMutex and is intended for unit tests and development environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the in-memory implementation of store.Store.

func New

func New() *Store

New creates a new in-memory store.

func (*Store) Close

func (s *Store) Close() error

Close is a no-op for the in-memory store.

func (*Store) CountByTenant

func (s *Store) CountByTenant(_ context.Context, tenantID string) (int, error)

func (*Store) CountDatacentersByTenant added in v1.3.0

func (s *Store) CountDatacentersByTenant(_ context.Context, tenantID string) (int, error)

CountDatacentersByTenant returns the total number of datacenters for a tenant.

func (*Store) CountDomainsByTenant

func (s *Store) CountDomainsByTenant(_ context.Context, tenantID string) (int, error)

func (*Store) CountInstancesByDatacenter added in v1.3.0

func (s *Store) CountInstancesByDatacenter(_ context.Context, tenantID string, datacenterID id.ID) (int, error)

CountInstancesByDatacenter returns the number of instances linked to a datacenter.

func (*Store) CountSecretsByTenant

func (s *Store) CountSecretsByTenant(_ context.Context, tenantID string) (int, error)

func (*Store) CountTenants

func (s *Store) CountTenants(_ context.Context) (int, error)

func (*Store) CountTenantsByStatus

func (s *Store) CountTenantsByStatus(_ context.Context, status admin.TenantStatus) (int, error)

func (*Store) Delete

func (s *Store) Delete(_ context.Context, tenantID string, instanceID id.ID) error

func (*Store) DeleteCertificate

func (s *Store) DeleteCertificate(_ context.Context, tenantID string, certID id.ID) error

func (*Store) DeleteCheck

func (s *Store) DeleteCheck(_ context.Context, tenantID string, checkID id.ID) error

func (*Store) DeleteDatacenter added in v1.3.0

func (s *Store) DeleteDatacenter(_ context.Context, tenantID string, datacenterID id.ID) error

DeleteDatacenter removes a datacenter from the store.

func (*Store) DeleteDomain

func (s *Store) DeleteDomain(_ context.Context, tenantID string, domainID id.ID) error

func (*Store) DeleteRoute

func (s *Store) DeleteRoute(_ context.Context, tenantID string, routeID id.ID) error

func (*Store) DeleteSecret

func (s *Store) DeleteSecret(_ context.Context, tenantID string, instanceID id.ID, key string) error

func (*Store) DeleteTemplate added in v1.3.0

func (s *Store) DeleteTemplate(_ context.Context, tenantID string, templateID id.ID) error

DeleteTemplate removes a deployment template.

func (*Store) DeleteTenant

func (s *Store) DeleteTenant(_ context.Context, tenantID string) error

func (*Store) GetByID

func (s *Store) GetByID(_ context.Context, tenantID string, instanceID id.ID) (*instance.Instance, error)

func (*Store) GetBySlug

func (s *Store) GetBySlug(_ context.Context, tenantID string, slug string) (*instance.Instance, error)

func (*Store) GetCertificate

func (s *Store) GetCertificate(_ context.Context, tenantID string, certID id.ID) (*network.Certificate, error)

func (*Store) GetCheck

func (s *Store) GetCheck(_ context.Context, tenantID string, checkID id.ID) (*health.HealthCheck, error)

func (*Store) GetDatacenterByID added in v1.3.0

func (s *Store) GetDatacenterByID(_ context.Context, tenantID string, datacenterID id.ID) (*datacenter.Datacenter, error)

GetDatacenterByID retrieves a datacenter by its ID within a tenant.

func (*Store) GetDatacenterBySlug added in v1.3.0

func (s *Store) GetDatacenterBySlug(_ context.Context, tenantID string, slug string) (*datacenter.Datacenter, error)

GetDatacenterBySlug retrieves a datacenter by its slug within a tenant.

func (*Store) GetDeployment

func (s *Store) GetDeployment(_ context.Context, tenantID string, deployID id.ID) (*deploy.Deployment, error)

func (*Store) GetDomain

func (s *Store) GetDomain(_ context.Context, tenantID string, domainID id.ID) (*network.Domain, error)

func (*Store) GetDomainByHostname

func (s *Store) GetDomainByHostname(_ context.Context, hostname string) (*network.Domain, error)

func (*Store) GetLatestResourceSnapshot

func (s *Store) GetLatestResourceSnapshot(_ context.Context, tenantID string, instanceID id.ID) (*telemetry.ResourceSnapshot, error)

func (*Store) GetLatestResult

func (s *Store) GetLatestResult(_ context.Context, tenantID string, checkID id.ID) (*health.HealthResult, error)

func (*Store) GetRelease

func (s *Store) GetRelease(_ context.Context, tenantID string, releaseID id.ID) (*deploy.Release, error)

func (*Store) GetRoute

func (s *Store) GetRoute(_ context.Context, tenantID string, routeID id.ID) (*network.Route, error)

func (*Store) GetSecretByKey

func (s *Store) GetSecretByKey(_ context.Context, tenantID string, instanceID id.ID, key string) (*secrets.Secret, error)

func (*Store) GetTemplate added in v1.3.0

func (s *Store) GetTemplate(_ context.Context, tenantID string, templateID id.ID) (*deploy.Template, error)

GetTemplate retrieves a deployment template by ID within a tenant.

func (*Store) GetTenant

func (s *Store) GetTenant(_ context.Context, tenantID string) (*admin.Tenant, error)

func (*Store) GetTenantBySlug

func (s *Store) GetTenantBySlug(_ context.Context, slug string) (*admin.Tenant, error)

func (*Store) Insert

func (s *Store) Insert(_ context.Context, inst *instance.Instance) error

func (*Store) InsertAuditEntry

func (s *Store) InsertAuditEntry(_ context.Context, entry *admin.AuditEntry) error

func (*Store) InsertCertificate

func (s *Store) InsertCertificate(_ context.Context, cert *network.Certificate) error

func (*Store) InsertCheck

func (s *Store) InsertCheck(_ context.Context, check *health.HealthCheck) error

func (*Store) InsertDatacenter added in v1.3.0

func (s *Store) InsertDatacenter(_ context.Context, dc *datacenter.Datacenter) error

InsertDatacenter persists a new datacenter.

func (*Store) InsertDeployment

func (s *Store) InsertDeployment(_ context.Context, d *deploy.Deployment) error

func (*Store) InsertDomain

func (s *Store) InsertDomain(_ context.Context, domain *network.Domain) error

func (*Store) InsertLogs

func (s *Store) InsertLogs(_ context.Context, logs []telemetry.LogEntry) error

func (*Store) InsertMetrics

func (s *Store) InsertMetrics(_ context.Context, metrics []telemetry.Metric) error

func (*Store) InsertRelease

func (s *Store) InsertRelease(_ context.Context, r *deploy.Release) error

func (*Store) InsertResourceSnapshot

func (s *Store) InsertResourceSnapshot(_ context.Context, snap *telemetry.ResourceSnapshot) error

func (*Store) InsertResult

func (s *Store) InsertResult(_ context.Context, result *health.HealthResult) error

func (*Store) InsertRoute

func (s *Store) InsertRoute(_ context.Context, route *network.Route) error

func (*Store) InsertSecret

func (s *Store) InsertSecret(_ context.Context, secret *secrets.Secret) error

func (*Store) InsertTemplate added in v1.3.0

func (s *Store) InsertTemplate(_ context.Context, t *deploy.Template) error

InsertTemplate persists a new deployment template.

func (*Store) InsertTenant

func (s *Store) InsertTenant(_ context.Context, tenant *admin.Tenant) error

func (*Store) InsertTraces

func (s *Store) InsertTraces(_ context.Context, traces []telemetry.Trace) error

func (*Store) List

func (s *Store) List(_ context.Context, tenantID string, opts instance.ListOptions) (*instance.ListResult, error)

func (*Store) ListCertificates

func (s *Store) ListCertificates(_ context.Context, tenantID string, instanceID id.ID) ([]network.Certificate, error)

func (*Store) ListChecks

func (s *Store) ListChecks(_ context.Context, tenantID string, instanceID id.ID) ([]health.HealthCheck, error)

func (*Store) ListDatacenters added in v1.3.0

func (s *Store) ListDatacenters(_ context.Context, tenantID string, opts datacenter.ListOptions) (*datacenter.ListResult, error)

ListDatacenters returns a filtered, paginated list of datacenters for a tenant.

func (*Store) ListDeployments

func (s *Store) ListDeployments(_ context.Context, tenantID string, instanceID id.ID, opts deploy.ListOptions) (*deploy.DeployListResult, error)

func (*Store) ListDomains

func (s *Store) ListDomains(_ context.Context, tenantID string, instanceID id.ID) ([]network.Domain, error)

func (*Store) ListReleases

func (s *Store) ListReleases(_ context.Context, tenantID string, instanceID id.ID, opts deploy.ListOptions) (*deploy.ReleaseListResult, error)

func (*Store) ListResourceSnapshots

func (s *Store) ListResourceSnapshots(_ context.Context, tenantID string, instanceID id.ID, opts telemetry.TimeRange) ([]telemetry.ResourceSnapshot, error)

func (*Store) ListResults

func (s *Store) ListResults(_ context.Context, tenantID string, checkID id.ID, opts health.HistoryOptions) ([]health.HealthResult, error)

func (*Store) ListRoutes

func (s *Store) ListRoutes(_ context.Context, tenantID string, instanceID id.ID) ([]network.Route, error)

func (*Store) ListSecrets

func (s *Store) ListSecrets(_ context.Context, tenantID string, instanceID id.ID) ([]secrets.Secret, error)

func (*Store) ListTemplates added in v1.3.0

func (s *Store) ListTemplates(_ context.Context, tenantID string, opts deploy.ListOptions) (*deploy.TemplateListResult, error)

ListTemplates returns a paginated list of deployment templates for a tenant.

func (*Store) ListTenants

func (*Store) Migrate

func (s *Store) Migrate(_ context.Context) error

Migrate is a no-op for the in-memory store.

func (*Store) NextReleaseVersion

func (s *Store) NextReleaseVersion(_ context.Context, tenantID string, instanceID id.ID) (int, error)

func (*Store) Ping

func (s *Store) Ping(_ context.Context) error

Ping is a no-op for the in-memory store.

func (*Store) QueryAuditLog

func (s *Store) QueryAuditLog(_ context.Context, opts admin.AuditQuery) (*admin.AuditResult, error)

func (*Store) QueryLogs

func (s *Store) QueryLogs(_ context.Context, q telemetry.LogQuery) ([]telemetry.LogEntry, error)

func (*Store) QueryMetrics

func (s *Store) QueryMetrics(_ context.Context, q telemetry.MetricQuery) ([]telemetry.Metric, error)

func (*Store) QueryTraces

func (s *Store) QueryTraces(_ context.Context, q telemetry.TraceQuery) ([]telemetry.Trace, error)

func (*Store) Update

func (s *Store) Update(_ context.Context, inst *instance.Instance) error

func (*Store) UpdateCertificate

func (s *Store) UpdateCertificate(_ context.Context, cert *network.Certificate) error

func (*Store) UpdateCheck

func (s *Store) UpdateCheck(_ context.Context, check *health.HealthCheck) error

func (*Store) UpdateDatacenter added in v1.3.0

func (s *Store) UpdateDatacenter(_ context.Context, dc *datacenter.Datacenter) error

UpdateDatacenter persists changes to an existing datacenter.

func (*Store) UpdateDeployment

func (s *Store) UpdateDeployment(_ context.Context, d *deploy.Deployment) error

func (*Store) UpdateDomain

func (s *Store) UpdateDomain(_ context.Context, domain *network.Domain) error

func (*Store) UpdateRoute

func (s *Store) UpdateRoute(_ context.Context, route *network.Route) error

func (*Store) UpdateSecret

func (s *Store) UpdateSecret(_ context.Context, secret *secrets.Secret) error

func (*Store) UpdateTemplate added in v1.3.0

func (s *Store) UpdateTemplate(_ context.Context, t *deploy.Template) error

UpdateTemplate persists changes to an existing deployment template.

func (*Store) UpdateTenant

func (s *Store) UpdateTenant(_ context.Context, tenant *admin.Tenant) error

Jump to

Keyboard shortcuts

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