tenant

package
v0.11.10 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

type Namespace struct {
	ID     uuid.UUID
	Name   string
	Config map[string]string

	ProjectName string

	CreatedAt time.Time
	UpdatedAt time.Time
}

type NamespaceRepository

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

func NewNamespaceRepository

func NewNamespaceRepository(pool *pgxpool.Pool) *NamespaceRepository

func (*NamespaceRepository) GetAll

func (n *NamespaceRepository) GetAll(ctx context.Context, projectName tenant.ProjectName) ([]*tenant.Namespace, error)

func (*NamespaceRepository) GetByName

func (*NamespaceRepository) Save

func (n *NamespaceRepository) Save(ctx context.Context, namespace *tenant.Namespace) error

type Preset added in v0.10.0

type Preset struct {
	ID uuid.UUID

	ProjectName string
	Name        string
	Description string

	TruncateTo string
	Delay      string
	Size       string
	Location   string

	CreatedAt time.Time
	UpdatedAt time.Time
}

type PresetRepository added in v0.10.0

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

func NewPresetRepository added in v0.10.0

func NewPresetRepository(db *pgxpool.Pool) *PresetRepository

func (PresetRepository) Create added in v0.10.0

func (p PresetRepository) Create(ctx context.Context, projectName tenant.ProjectName, preset tenant.Preset) error

func (PresetRepository) Delete added in v0.10.0

func (p PresetRepository) Delete(ctx context.Context, projectName tenant.ProjectName, presetName string) error

func (PresetRepository) Read added in v0.10.0

func (p PresetRepository) Read(ctx context.Context, projectName tenant.ProjectName) ([]tenant.Preset, error)

func (PresetRepository) Update added in v0.10.0

func (p PresetRepository) Update(ctx context.Context, projectName tenant.ProjectName, preset tenant.Preset) error

type Project

type Project struct {
	ID     uuid.UUID
	Name   string
	Config map[string]string

	CreatedAt time.Time
	UpdatedAt time.Time
}

type ProjectRepository

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

func NewProjectRepository

func NewProjectRepository(pool *pgxpool.Pool) *ProjectRepository

func (ProjectRepository) GetAll

func (repo ProjectRepository) GetAll(ctx context.Context) ([]*tenant.Project, error)

func (ProjectRepository) GetByName

func (repo ProjectRepository) GetByName(ctx context.Context, name tenant.ProjectName) (*tenant.Project, error)

func (ProjectRepository) Save

func (repo ProjectRepository) Save(ctx context.Context, tenantProject *tenant.Project) error

type Secret

type Secret struct {
	ID uuid.UUID

	Name  string
	Value string

	ProjectName   string
	NamespaceName sql.NullString

	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewSecret

func NewSecret(secret *tenant.Secret) Secret

func (*Secret) ToSecretInfo

func (s *Secret) ToSecretInfo() (*dto.SecretInfo, error)

func (*Secret) ToTenantSecret

func (s *Secret) ToTenantSecret() (*tenant.Secret, error)

type SecretRepository

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

func NewSecretRepository

func NewSecretRepository(pool *pgxpool.Pool) *SecretRepository

func (SecretRepository) Delete

func (s SecretRepository) Delete(ctx context.Context, projName tenant.ProjectName, nsName string, name tenant.SecretName) error

Delete will not support soft delete, once deleted it has to be created again

func (SecretRepository) Get

func (s SecretRepository) Get(ctx context.Context, projName tenant.ProjectName, nsName string, name tenant.SecretName) (*tenant.Secret, error)

Get is scoped to the tenant provided in the argument

func (SecretRepository) GetAll

func (s SecretRepository) GetAll(ctx context.Context, projName tenant.ProjectName, nsName string) ([]*tenant.Secret, error)

func (SecretRepository) GetSecretsInfo

func (s SecretRepository) GetSecretsInfo(ctx context.Context, projName tenant.ProjectName) ([]*dto.SecretInfo, error)

func (SecretRepository) Save

func (s SecretRepository) Save(ctx context.Context, tenantSecret *tenant.Secret) error

func (SecretRepository) Update

func (s SecretRepository) Update(ctx context.Context, tenantSecret *tenant.Secret) error

Jump to

Keyboard shortcuts

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