tenant

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 12 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 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