resource

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityBackup = "backup"
)
View Source
const (
	EntityResource = "resource"
)

Variables

This section is empty.

Functions

func StatusForToCreate

func StatusForToCreate(status Status) bool

func StatusForToUpdate

func StatusForToUpdate(status Status) bool

func StatusIsSuccess

func StatusIsSuccess(status Status) bool

Types

type Backup

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

func NewBackup

func NewBackup(store Store, t tenant.Tenant, resNames []string, desc string, createdAt time.Time, conf map[string]string) (*Backup, error)

func (*Backup) Config

func (b *Backup) Config() map[string]string

func (*Backup) CreatedAt

func (b *Backup) CreatedAt() time.Time

func (*Backup) Description

func (b *Backup) Description() string

func (*Backup) GetConfigOrDefaultFor

func (b *Backup) GetConfigOrDefaultFor(key, fallback string) string

func (*Backup) ID

func (b *Backup) ID() BackupID

func (*Backup) ResourceNames

func (b *Backup) ResourceNames() []string

func (*Backup) Store

func (b *Backup) Store() Store

func (*Backup) Tenant

func (b *Backup) Tenant() tenant.Tenant

func (*Backup) UpdateID

func (b *Backup) UpdateID(id uuid.UUID) error

type BackupID

type BackupID uuid.UUID

func BackupIDFrom

func BackupIDFrom(id string) (BackupID, error)

func (BackupID) IsInvalid

func (i BackupID) IsInvalid() bool

func (BackupID) String

func (i BackupID) String() string

func (BackupID) UUID

func (i BackupID) UUID() uuid.UUID

type BackupResult

type BackupResult struct {
	ID               BackupID
	ResourceNames    []string
	IgnoredResources []IgnoredResource
}

type FromExistingOpt

type FromExistingOpt func(r *Resource)

func ReplaceStatus

func ReplaceStatus(status Status) FromExistingOpt

type IgnoredResource

type IgnoredResource struct {
	Name   string
	Reason string
}

type Metadata

type Metadata struct {
	Version     int32
	Description string
	Labels      map[string]string
}

type Name

type Name string

func NameFrom

func NameFrom(name string) (Name, error)

func (Name) String

func (n Name) String() string

type Resource

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

func FromExisting

func FromExisting(existing *Resource, opts ...FromExistingOpt) *Resource

func NewResource

func NewResource(fullName, kind string, store Store, tnnt tenant.Tenant, meta *Metadata, spec map[string]any) (*Resource, error)

func (*Resource) Equal

func (r *Resource) Equal(incoming *Resource) bool

func (*Resource) FullName

func (r *Resource) FullName() string

func (*Resource) Kind

func (r *Resource) Kind() string

func (*Resource) MarkExistInStore

func (r *Resource) MarkExistInStore() error

func (*Resource) MarkFailure

func (r *Resource) MarkFailure() error

func (*Resource) MarkSkipped

func (r *Resource) MarkSkipped() error

func (*Resource) MarkSuccess

func (r *Resource) MarkSuccess() error

func (*Resource) MarkToCreate

func (r *Resource) MarkToCreate() error

func (*Resource) MarkToUpdate

func (r *Resource) MarkToUpdate() error

func (*Resource) MarkValidationFailure

func (r *Resource) MarkValidationFailure() error

func (*Resource) MarkValidationSuccess

func (r *Resource) MarkValidationSuccess() error

func (*Resource) Metadata

func (r *Resource) Metadata() *Metadata

func (*Resource) Name

func (r *Resource) Name() Name

func (*Resource) NameSections

func (r *Resource) NameSections() []string

func (*Resource) Spec

func (r *Resource) Spec() map[string]any

func (*Resource) Status

func (r *Resource) Status() Status

func (*Resource) Store

func (r *Resource) Store() Store

func (*Resource) Tenant

func (r *Resource) Tenant() tenant.Tenant

func (*Resource) URN

func (r *Resource) URN() string

func (*Resource) UpdateTenant

func (r *Resource) UpdateTenant(tnnt tenant.Tenant)

func (*Resource) UpdateURN

func (r *Resource) UpdateURN(urn string) error

type Status

type Status string
const (
	StatusUnknown           Status = "unknown"
	StatusValidationFailure Status = "validation_failure"
	StatusValidationSuccess Status = "validation_success"
	StatusToCreate          Status = "to_create"
	StatusToUpdate          Status = "to_update"
	StatusSkipped           Status = "skipped"
	StatusCreateFailure     Status = "create_failure"
	StatusUpdateFailure     Status = "update_failure"
	StatusExistInStore      Status = "exist_in_store"
	StatusSuccess           Status = "success"
)

func FromStringToStatus

func FromStringToStatus(status string) Status

func (Status) String

func (s Status) String() string

type Store

type Store string

Store represents the type of datasource, resource corresponds to

const (
	Bigquery Store = "bigquery"
)

func FromStringToStore

func FromStringToStore(name string) (Store, error)

func (Store) String

func (s Store) String() string

type SyncResponse

type SyncResponse struct {
	ResourceNames    []string
	IgnoredResources []IgnoredResource
}

Directories

Path Synopsis
handler

Jump to

Keyboard shortcuts

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