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 Reference
- type ReplacePrimaryRequest
- type Resource
- type ResourceGroup
- type SetPrimaryRequest
- type UpdateAttachmentRequest
- type UpdateRequest
- type Workspace
- type WorkspaceRef
Constants ¶
const ( CollectionKind basespec.CollectionKind = builtinSchema.WorkspaceCollectionV1Kind WorkspaceDescriptorSchemaID basespec.SchemaID = builtinSchema.WorkspaceCollectionV1SchemaID WorkspaceDescriptorSchemaVersion = builtinSchema.WorkspaceCollectionV1SchemaVersion RolePrimary basespec.AttachmentRole = "primary" RoleLibrary basespec.AttachmentRole = "library" RoleAttachedPackage basespec.AttachmentRole = "attached-package" RoleOverlay basespec.AttachmentRole = "overlay" WorkspaceMetadataDirectory = ".flexigpt" WorkspaceMetadataLocator basespec.Locator = WorkspaceMetadataDirectory RepositoryRootLocator basespec.Locator = "." WorkspaceDescriptorFileName = builtinSchema.WorkspaceCollectionV1FileName DescriptorLocator basespec.Locator = WorkspaceMetadataDirectory + "/" + WorkspaceDescriptorFileName )
Variables ¶
var ( ErrInvalidWorkspace = errors.New("workspace: invalid") ErrNotWorkspace = errors.New("workspace: collection is not a Workspace") ErrPrimarySourceRequired = errors.New("workspace: primary source is required") ErrPrimarySourceImmutable = errors.New("workspace: primary source is immutable") ErrReferenceUnresolved = errors.New("workspace: reference unresolved") ErrReferenceAmbiguous = errors.New("workspace: reference ambiguous") 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 []diagnostic.Diagnostic `json:"-"`
}
type CollectionData ¶
type CollectionData struct {
DiscoveryPolicyRevision string `json:"discoveryPolicyRevision"`
Discovery DiscoveryPreferences `json:"discovery"`
}
CollectionData contains local Workspace policy only. The Workspace mode and primary Source are derived from the current collection attachments.
DiscoveryPolicyRevision is deliberately local. It is not portable descriptor content and it gives the running Workspace implementation an explicit way to invalidate a catalog after planner behavior changes.
type DefinitionValidator ¶
type DefinitionValidator func(definition.Definition) error
type DirectoryRoot ¶
type DirectoryRoot = artifactstoreDiscovery.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 = artifactstoreDiscovery.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 []diagnostic.Diagnostic `json:"-"`
}
type LoadPlanItem ¶
type LoadPlanItem struct {
Artifact artifact.Artifact `json:"-"`
Definition definition.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 Reference ¶
type Reference struct {
Artifact *artifact.ArtifactRef `json:"-"`
Selector *definition.Selector `json:"-"`
}
type ReplacePrimaryRequest ¶
type Resource ¶
type Resource struct {
Artifact artifact.Artifact `json:"-"`
Definition definition.Definition `json:"-"`
Occurrence *catalog.Occurrence `json:"-"`
Source source.Summary `json:"-"`
CatalogCurrent bool `json:"-"`
ProjectionValid bool `json:"-"`
Diagnostics []diagnostic.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