service

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamespaceGetter

type NamespaceGetter interface {
	Get(context.Context, tenant.ProjectName, tenant.NamespaceName) (*tenant.Namespace, error)
}

type NamespaceRepository

type NamespaceRepository interface {
	Save(ctx context.Context, namespace *tenant.Namespace) error
	GetByName(context.Context, tenant.ProjectName, tenant.NamespaceName) (*tenant.Namespace, error)
	GetAll(context.Context, tenant.ProjectName) ([]*tenant.Namespace, error)
}

type NamespaceService

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

func NewNamespaceService

func NewNamespaceService(nsRepo NamespaceRepository) *NamespaceService

func (NamespaceService) Get

func (ns NamespaceService) Get(ctx context.Context, projName tenant.ProjectName, namespaceName tenant.NamespaceName) (*tenant.Namespace, error)

func (NamespaceService) GetAll

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

func (NamespaceService) Save

func (ns NamespaceService) Save(ctx context.Context, namespace *tenant.Namespace) error

type PresetRepository added in v0.10.0

type PresetRepository interface {
	Create(ctx context.Context, projectName tenant.ProjectName, preset tenant.Preset) error
	Read(ctx context.Context, projectName tenant.ProjectName) ([]tenant.Preset, error)
	Update(ctx context.Context, projectName tenant.ProjectName, preset tenant.Preset) error
	Delete(ctx context.Context, projectName tenant.ProjectName, presetName string) error
}

type ProjectGetter

type ProjectGetter interface {
	Get(context.Context, tenant.ProjectName) (*tenant.Project, error)
}

type ProjectRepository

type ProjectRepository interface {
	Save(context.Context, *tenant.Project) error
	GetByName(context.Context, tenant.ProjectName) (*tenant.Project, error)
	GetAll(context.Context) ([]*tenant.Project, error)
}

type ProjectService

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

func NewProjectService

func NewProjectService(projectRepo ProjectRepository, presetRepo PresetRepository) *ProjectService

func (ProjectService) Get

func (ProjectService) GetAll

func (s ProjectService) GetAll(ctx context.Context) ([]*tenant.Project, error)

func (ProjectService) Save

func (s ProjectService) Save(ctx context.Context, project *tenant.Project) error

type SecretRepository

type SecretRepository interface {
	Save(ctx context.Context, secret *tenant.Secret) error
	Update(ctx context.Context, secret *tenant.Secret) error
	Get(ctx context.Context, projName tenant.ProjectName, nsName string, name tenant.SecretName) (*tenant.Secret, error)
	GetAll(ctx context.Context, projName tenant.ProjectName, nsName string) ([]*tenant.Secret, error)
	Delete(ctx context.Context, projName tenant.ProjectName, nsName string, name tenant.SecretName) error
	GetSecretsInfo(ctx context.Context, projName tenant.ProjectName) ([]*dto.SecretInfo, error)
}

type SecretService

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

func NewSecretService

func NewSecretService(appKey *[32]byte, repo SecretRepository, logger log.Logger) *SecretService

func (SecretService) Delete

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

func (SecretService) Get

func (s SecretService) Get(ctx context.Context, projName tenant.ProjectName, namespaceName, name string) (*tenant.PlainTextSecret, error)

func (SecretService) GetAll

func (s SecretService) GetAll(ctx context.Context, projName tenant.ProjectName, namespaceName string) ([]*tenant.PlainTextSecret, error)

func (SecretService) GetSecretsInfo

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

func (SecretService) Save

func (s SecretService) Save(ctx context.Context, projName tenant.ProjectName, nsName string, secret *tenant.PlainTextSecret) error

func (SecretService) Update

func (s SecretService) Update(ctx context.Context, projName tenant.ProjectName, nsName string, secret *tenant.PlainTextSecret) error

type SecretsGetter

type SecretsGetter interface {
	Get(ctx context.Context, projName tenant.ProjectName, namespaceName, name string) (*tenant.PlainTextSecret, error)
	GetAll(ctx context.Context, projName tenant.ProjectName, namespaceName string) ([]*tenant.PlainTextSecret, error)
}

type TenantService

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

func NewTenantService

func NewTenantService(projGetter ProjectGetter, nsGetter NamespaceGetter, secretsGetter SecretsGetter, logger log.Logger) *TenantService

func (TenantService) GetDetails

func (t TenantService) GetDetails(ctx context.Context, tnnt tenant.Tenant) (*tenant.WithDetails, error)

func (TenantService) GetProject

func (t TenantService) GetProject(ctx context.Context, name tenant.ProjectName) (*tenant.Project, error)

func (TenantService) GetSecret

func (t TenantService) GetSecret(ctx context.Context, tnnt tenant.Tenant, name string) (*tenant.PlainTextSecret, error)

func (TenantService) GetSecrets

func (t TenantService) GetSecrets(ctx context.Context, tnnt tenant.Tenant) ([]*tenant.PlainTextSecret, error)

Jump to

Keyboard shortcuts

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