resource

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityResourceChangelog = "resource_changelog"

	ChangelogChangeTypeCreate = "create"
	ChangelogChangeTypeUpdate = "update"
	ChangelogChangeTypeDelete = "delete"
)
View Source
const (
	EntityResource = "resource"

	UnspecifiedImpactChange    UpdateImpact = "unspecified_impact"
	ResourceDataPipeLineImpact UpdateImpact = "data_impact"

	ResourceSpecV1 = 1
	ResourceSpecV2 = 2

	DefaultResourceSpecVersion = ResourceSpecV1
)
View Source
const (
	EntityBackup = "backup"
)

Variables

This section is empty.

Functions

func StatusForToCreate

func StatusForToCreate(status Status) bool

func StatusForToDelete added in v0.12.0

func StatusForToDelete(status Status) bool

func StatusForToUpdate

func StatusForToUpdate(status Status) bool

func StatusIsSuccess

func StatusIsSuccess(status Status) bool

Types

type AlertAttrs added in v0.16.2

type AlertAttrs struct {
	Name      Name
	URN       string
	Tenant    tenant.Tenant
	EventTime time.Time
	EventType ChangeType
}

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 Change added in v0.15.0

type Change struct {
	Property string
	Diff     string
}

type ChangeLog added in v0.15.0

type ChangeLog struct {
	Change []Change
	Type   string
	Time   time.Time
}

type ChangeType added in v0.16.2

type ChangeType string
const (
	ChangeTypeUpdate ChangeType = "Modified"
	ChangeTypeDelete ChangeType = "Deleted"
)

func (ChangeType) String added in v0.16.2

func (j ChangeType) String() string

type DeleteRequest added in v0.12.0

type DeleteRequest struct {
	Tenant    tenant.Tenant
	Datastore Store
	FullName  string
	Force     bool
}

type DeleteResponse added in v0.12.0

type DeleteResponse struct {
	DownstreamJobs []string
	Resource       *Resource
}

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      labels.Labels
}

func (*Metadata) Validate added in v0.10.2

func (m *Metadata) Validate() error

type Name

type Name string

func NameFrom

func NameFrom(name string) (Name, error)

func (Name) Sections added in v0.12.0

func (n Name) Sections() []string

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) ConsoleURN added in v0.16.2

func (r *Resource) ConsoleURN() string

func (*Resource) Equal

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

func (*Resource) FullName

func (r *Resource) FullName() string

func (*Resource) GetUpdateImpact added in v0.12.0

func (r *Resource) GetUpdateImpact(incoming *Resource) UpdateImpact

func (*Resource) IsDeleted added in v0.12.0

func (r *Resource) IsDeleted() bool

func (*Resource) Kind

func (r *Resource) Kind() string

func (*Resource) MarkDeleted added in v0.12.0

func (r *Resource) MarkDeleted() error

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) MarkToDelete added in v0.12.0

func (r *Resource) MarkToDelete() 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) 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() URN

func (*Resource) UpdateSpec added in v0.17.0

func (r *Resource) UpdateSpec(spec map[string]any)

func (*Resource) UpdateTenant added in v0.8.0

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

func (*Resource) UpdateURN

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

func (*Resource) Version added in v0.17.0

func (r *Resource) Version() int32

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"
	StatusToDelete          Status = "to_delete"
	StatusDeleted           Status = "deleted"
	StatusSkipped           Status = "skipped"
	StatusCreateFailure     Status = "create_failure"
	StatusUpdateFailure     Status = "update_failure"
	StatusExistInStore      Status = "exist_in_store"
	StatusSuccess           Status = "success"

	StatusFailure Status = "failed"
)

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 added in v0.9.0

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

type URN added in v0.12.0

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

func NewURN added in v0.12.0

func NewURN(store, name string) (URN, error)

func ParseURN added in v0.12.0

func ParseURN(urn string) (URN, error)

func ZeroURN added in v0.12.0

func ZeroURN() URN

func (URN) GetName added in v0.12.0

func (u URN) GetName() string

func (URN) GetStore added in v0.12.0

func (u URN) GetStore() string

func (URN) IsZero added in v0.12.0

func (u URN) IsZero() bool

func (URN) String added in v0.12.0

func (u URN) String() string

type UpdateImpact added in v0.12.0

type UpdateImpact string

Directories

Path Synopsis
handler

Jump to

Keyboard shortcuts

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