resource

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromModelToResource

func FromModelToResource(r *Resource) (*resource.Resource, error)

Types

type Backup

type Backup struct {
	ID uuid.UUID

	Store         string
	ProjectName   string
	NamespaceName string

	Description   string
	ResourceNames pq.StringArray

	Config map[string]string

	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewBackup

func NewBackup(b *resource.Backup) Backup

func (Backup) ToResourceBackup

func (b Backup) ToResourceBackup() (*resource.Backup, error)

type BackupRepository

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

func NewBackupRepository

func NewBackupRepository(pool *pgxpool.Pool) *BackupRepository

func (BackupRepository) Create

func (repo BackupRepository) Create(ctx context.Context, resourceBackup *resource.Backup) error

func (BackupRepository) GetAll

func (repo BackupRepository) GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Backup, error)

func (BackupRepository) GetByID

type Repository

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

func NewRepository

func NewRepository(pool *pgxpool.Pool) *Repository

func (Repository) ChangeNamespace added in v0.8.0

func (r Repository) ChangeNamespace(ctx context.Context, res *resource.Resource, newTenant tenant.Tenant) error

func (Repository) Create

func (r Repository) Create(ctx context.Context, resourceModel *resource.Resource) error

func (Repository) GetResources

func (r Repository) GetResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) ([]*resource.Resource, error)

func (Repository) ReadAll

func (r Repository) ReadAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error)

func (Repository) ReadByFullName

func (r Repository) ReadByFullName(ctx context.Context, tnnt tenant.Tenant, store resource.Store, fullName string) (*resource.Resource, error)

func (Repository) Update

func (r Repository) Update(ctx context.Context, resourceModel *resource.Resource) error

func (Repository) UpdateStatus

func (r Repository) UpdateStatus(ctx context.Context, resources ...*resource.Resource) error

type Resource

type Resource struct {
	ID uuid.UUID

	FullName string
	Kind     string
	Store    string

	ProjectName   string
	NamespaceName string

	Metadata json.RawMessage
	Spec     map[string]any

	URN string

	Status string

	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromResourceToModel

func FromResourceToModel(r *resource.Resource) *Resource

Jump to

Keyboard shortcuts

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