Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateDiscoveryPreferences(value DiscoveryPreferences) error
- type ArtifactData
- type ArtifactSupport
- type AttachRequest
- type AttachmentData
- type CatalogView
- type CollectionData
- type DefinitionValidator
- type DirectoryRoot
- type DiscoveryPreferences
- type DiscoveryProfile
- type DiscoveryProfiles
- type DiscoveryRoot
- type EmptyWorkspaceRequest
- type FilesystemWorkspaceRequest
- type LoadPlan
- type LoadPlanItem
- type Mode
- type Resource
- type ResourceGroup
- type SetPrimaryRequest
- type UpdateAttachmentRequest
- type UpdateRequest
- type Workspace
- type WorkspaceRef
Constants ¶
const ( RolePrimary basespec.AttachmentRole = "primary" RoleLibrary basespec.AttachmentRole = "library" RoleAttachedPackage basespec.AttachmentRole = "attached-package" RoleOverlay basespec.AttachmentRole = "overlay" )
const ( DiagnosticCodeArtifactInvalid = "workspace.artifact.invalid" DiagnosticCodeContextInvalidContent = "workspace.context.invalid-content" DiagnosticCodeContextInvalidUTF8 = "workspace.context.invalid-utf8" DiagnosticCodeArtifactSchemaUnsupported = "workspace.artifact.schema-unsupported" DiagnosticCodeArtifactKindMismatch = "workspace.artifact.kind-mismatch" DiagnosticCodeProjectionInvalid = "workspace.projection.invalid" DiagnosticCodeArtifactUnresolved = "workspace.artifact.unresolved" DiagnosticCodeRuntimeDenied = "workspace.runtime.denied" DiagnosticCodeCatalogStale = "workspace.catalog.stale" DiagnosticCodeCatalogDecoderStale = "workspace.catalog.decoder-stale" DiagnosticCodeCatalogPlanStale = "workspace.catalog.plan-stale" )
Variables ¶
var ( ErrInvalidWorkspace = errors.New("workspace: invalid") ErrNotWorkspace = errors.New("workspace: collection is not a Workspace") ErrPrimarySourceImmutable = errors.New("workspace: primary source is immutable") ErrReferenceUnresolved = errors.New("workspace: reference unresolved") ErrWorkspaceDefinitionInvalid = errors.New("workspace: descriptor invalid") )
Functions ¶
func ValidateDiscoveryPreferences ¶
func ValidateDiscoveryPreferences( value DiscoveryPreferences, ) error
Types ¶
type ArtifactData ¶
type ArtifactData struct {
RuntimeDisabled bool `json:"runtimeDisabled,omitempty"`
}
type ArtifactSupport ¶
type ArtifactSupport struct {
Kind basespec.ArtifactKind
SchemaID basespec.SchemaID
DecoderID basespec.DecoderID
Validator DefinitionValidator
}
func (ArtifactSupport) Validate ¶
func (s ArtifactSupport) Validate() error
type AttachRequest ¶
type AttachRequest struct {
Workspace WorkspaceRef `json:"workspace"`
ExpectedCollectionRevision uint64 `json:"expectedCollectionRevision"`
SourceID basespec.SourceID `json:"sourceID"`
Role basespec.AttachmentRole `json:"role"`
Enabled bool `json:"enabled"`
Data AttachmentData `json:"data"`
}
type AttachmentData ¶
type CatalogView ¶
type CatalogView struct {
Workspace Workspace `json:"-"`
Catalog catalog.Snapshot `json:"-"`
Resources []Resource `json:"-"`
Unrecorded []catalog.Occurrence `json:"-"`
UnresolvedArtifacts []artifact.Artifact `json:"-"`
Groups []ResourceGroup `json:"-"`
CatalogCurrent bool `json:"-"`
FreshnessDiagnostics []providerapi.Diagnostic `json:"-"`
}
type CollectionData ¶
type CollectionData struct {
Discovery DiscoveryPreferences `json:"discovery"`
}
CollectionData contains persisted Workspace preferences only. Workspace mode and primary Source are derived from current collection attachments. Provider behavior revision is Artifact Store capability input and is intentionally not persisted in Collection local data.
type DefinitionValidator ¶
type DefinitionValidator func(providerapi.Definition) error
type DirectoryRoot ¶
type DirectoryRoot = providerapi.DirectoryRoot
DirectoryRoot is the generic source-discovery scope type.
type DiscoveryPreferences ¶
type DiscoveryPreferences struct {
AdditionalLocators []basespec.Locator `json:"additionalLocators,omitempty"`
AdditionalRoots []DiscoveryRoot `json:"additionalRoots,omitempty"`
IncludeReadme bool `json:"includeReadme,omitempty"`
}
type DiscoveryProfile ¶
type DiscoveryProfile struct {
ExplicitLocators []basespec.Locator
ReadmeLocator basespec.Locator
DirectoryRoots []DirectoryRoot
}
DiscoveryProfile defines discovery rules for one attachment class.
Artifact adapters contribute their own conventions through this type.
type DiscoveryProfiles ¶
type DiscoveryProfiles struct {
Primary DiscoveryProfile
Attached DiscoveryProfile
}
type DiscoveryRoot ¶
type DiscoveryRoot = providerapi.DirectoryRoot
DiscoveryRoot is retained as the Workspace preference name.
type EmptyWorkspaceRequest ¶
type EmptyWorkspaceRequest struct {
CollectionID basespec.CollectionID `json:"collectionID"`
RootID basespec.RootID `json:"rootID"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
Discovery DiscoveryPreferences `json:"discovery"`
}
type FilesystemWorkspaceRequest ¶
type FilesystemWorkspaceRequest struct {
CollectionID basespec.CollectionID `json:"collectionID"`
RootID basespec.RootID `json:"rootID"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
PrimarySourceID basespec.SourceID `json:"primarySourceID"`
Discovery DiscoveryPreferences `json:"discovery"`
}
type LoadPlan ¶
type LoadPlan struct {
Workspace WorkspaceRef `json:"-"`
CatalogRevision uint64 `json:"-"`
Items []LoadPlanItem `json:"-"`
Diagnostics []providerapi.Diagnostic `json:"-"`
}
type LoadPlanItem ¶
type LoadPlanItem struct {
Artifact artifact.Artifact `json:"-"`
Definition providerapi.Definition `json:"-"`
Source source.Summary `json:"-"`
CatalogCurrent bool `json:"-"`
OccurrenceDefinitionDigest cryptoutil.Digest `json:"-"`
SourceContentDigest cryptoutil.Digest `json:"-"`
SourceGeneration string `json:"-"`
}
LoadPlanItem contains privileged materialized source state. It must be projected into an explicit adapter response before crossing an API boundary.
type Resource ¶
type Resource struct {
Artifact artifact.Artifact `json:"-"`
Definition providerapi.Definition `json:"-"`
Occurrence *catalog.Occurrence `json:"-"`
Source source.Summary `json:"-"`
CatalogCurrent bool `json:"-"`
ProjectionValid bool `json:"-"`
Diagnostics []providerapi.Diagnostic `json:"-"`
}
type ResourceGroup ¶
type ResourceGroup struct {
Kind basespec.ArtifactKind `json:"-"`
Resources []Resource `json:"-"`
Unrecorded []catalog.Occurrence `json:"-"`
}
type SetPrimaryRequest ¶
type UpdateAttachmentRequest ¶
type UpdateAttachmentRequest struct {
Workspace WorkspaceRef
SourceID basespec.SourceID
ExpectedCollectionRevision uint64
ExpectedAttachmentRevision uint64
Role basespec.AttachmentRole
Enabled bool
Data AttachmentData
}
type UpdateRequest ¶
type UpdateRequest struct {
Workspace WorkspaceRef `json:"workspace"`
ExpectedRevision uint64 `json:"expectedRevision"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Discovery DiscoveryPreferences `json:"discovery"`
}
type Workspace ¶
type Workspace struct {
Collection collection.Collection `json:"-"`
Data CollectionData `json:"-"`
Mode Mode `json:"-"`
PrimarySourceID basespec.SourceID `json:"-"`
Attachments []collection.Attachment `json:"-"`
Sources []source.Summary `json:"-"`
}
Workspace is an internal privileged aggregate. API packages project it into explicit view models and must not serialize collection local data, attachment local data, or Source configuration.
type WorkspaceRef ¶
type WorkspaceRef = collection.CollectionRef