Documentation
¶
Index ¶
- Variables
- type CompileResult
- type Compiler
- type Definition
- type DeletionPolicy
- type Diagnostic
- type Document
- type EntityMetadata
- type EntitySchema
- type FieldSchema
- type FieldType
- type FieldUI
- type FieldValidation
- type IDRule
- type Metadata
- type Reference
- type Registry
- func (r *Registry) Get(name, version string) (Definition, uint64, error)
- func (r *Registry) List() Snapshot
- func (r *Registry) Register(definition Definition) error
- func (r *Registry) Resolve(reference string) (Definition, uint64, error)
- func (r *Registry) Schema(name, version string, requestedVersion *uint64) (Schema, uint64, error)
- type Schema
- type SchemaIncompatibleError
- type SchemaMigration
- type SchemaMigrator
- type SemanticChange
- type SemanticDiff
- type SemanticDiffer
- type Sensitivity
- type Snapshot
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidReference = errors.New("invalid pack reference") ErrUnknownPack = errors.New("unknown pack") ErrUnknownVersion = errors.New("unknown pack version") ErrSchemaIncompatible = errors.New("pack schema incompatible") ErrInvalidDefinition = errors.New("invalid pack definition") ErrDuplicateDefinition = errors.New("duplicate pack definition") )
Functions ¶
This section is empty.
Types ¶
type CompileResult ¶
type CompileResult struct {
Values map[string]json.RawMessage
}
type Compiler ¶
type Compiler interface {
Compile(context.Context, Document) (CompileResult, error)
}
type Definition ¶
Definition is the immutable, declarative contract for one Pack version. It contains no executable rules; the runtime extension points below are intentionally separate from the data exposed to clients.
type DeletionPolicy ¶
type DeletionPolicy string
const ( DeletionPolicyRestrict DeletionPolicy = "restrict" DeletionPolicyCascade DeletionPolicy = "cascade" DeletionPolicyAllow DeletionPolicy = "allow" )
type Diagnostic ¶
type Document ¶
type Document struct {
SchemaVersion uint64 `json:"schema_version"`
Entities map[string][]json.RawMessage `json:"entities"`
EnvironmentOverrides map[string]map[string]any `json:"environment_overrides"`
}
Document is the Pack-neutral representation passed between future draft, validation, compilation, and diff services. Source and provider adapters do not appear in this contract.
type EntityMetadata ¶
type EntityMetadata struct {
Name string `json:"name"`
// Collection is the configuration field that stores the entity records. It
// is intentionally internal until the public Pack metadata contract gains a
// collection member.
Collection string `json:"-"`
Label string `json:"label"`
Description string `json:"description"`
IDRule IDRule `json:"id_rule"`
DeletionPolicy DeletionPolicy `json:"deletion_policy"`
EnvironmentOverrideFields []string `json:"environment_override_fields"`
}
type EntitySchema ¶
type EntitySchema struct {
Name string `json:"name"`
Fields []FieldSchema `json:"fields"`
}
type FieldSchema ¶
type FieldSchema struct {
Name string `json:"name"`
Type FieldType `json:"type"`
Required bool `json:"required"`
Nullable bool `json:"nullable"`
Default json.RawMessage `json:"default"`
Sensitivity Sensitivity `json:"sensitivity"`
UI FieldUI `json:"ui"`
Validation FieldValidation `json:"validation"`
}
type FieldValidation ¶
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Capabilities []string `json:"capabilities"`
EntityTypes []EntityMetadata `json:"entity_types"`
}
type Reference ¶
Reference preserves the name/version identity of a Pack without changing the manifest's opaque pack.id string.
func ParseReference ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is safe for concurrent readers and registration during startup. It only accepts compiled-in declarations; it never loads or executes user supplied Pack code.
func BuiltinRegistry ¶
func BuiltinRegistry() *Registry
BuiltinRegistry contains Pack declarations compiled into the Conflow binary.
func MustNewRegistry ¶
func MustNewRegistry(definitions ...Definition) *Registry
func NewRegistry ¶
func NewRegistry(definitions ...Definition) (*Registry, error)
func (*Registry) Register ¶
func (r *Registry) Register(definition Definition) error
type Schema ¶
type Schema struct {
Version uint64 `json:"version"`
Entities []EntitySchema `json:"entities"`
Migrations []SchemaMigration `json:"migrations"`
}
type SchemaIncompatibleError ¶
func (*SchemaIncompatibleError) Error ¶
func (e *SchemaIncompatibleError) Error() string
func (*SchemaIncompatibleError) Unwrap ¶
func (e *SchemaIncompatibleError) Unwrap() error
type SchemaMigration ¶
type SchemaMigrator ¶
type SemanticChange ¶
type SemanticDiff ¶
type SemanticDiff struct {
Changes []SemanticChange `json:"changes"`
}
type SemanticDiffer ¶
type Sensitivity ¶
type Sensitivity string
const ( SensitivityPublic Sensitivity = "public" SensitivitySensitive Sensitivity = "sensitive" )
type Snapshot ¶
type Snapshot struct {
Definitions []Definition
Revision uint64
}