Documentation
¶
Overview ¶
Package project loads and validates the native UWS/Ramen desired-state project format.
The project package is part of Ramen's supported v0.1 core API.
Index ¶
- Constants
- func ApplyValues(profile Profile, values map[string]resolvedValueInternal) (Profile, []ValueDiagnostic)
- func AttributeStrings(attrs map[string]any) map[string]string
- func ResolvePath(path string) (string, error)
- func ResolveProfile(profile Profile, projectDir string, opts ValuesOptions) (Profile, ResolvedInputs, []ValueDiagnostic)
- func ResolveValues(profile Profile, projectDir string, opts ValuesOptions) (map[string]resolvedValueInternal, ResolvedInputs, []ValueDiagnostic)
- func ValidateProfile(profile Profile) error
- type AIMetadata
- type APISource
- type Confidence
- type Document
- type IdentityAttribute
- type Lifecycle
- type MappingLifecycle
- type MappingLifecyclePath
- type Normalizer
- type OperationRole
- type Profile
- type Redaction
- type RequestBinding
- type ResolvedInputs
- type ResolvedValue
- type Resource
- type ResponseBinding
- type RuntimeHints
- type SchemaPath
- type ValueDiagnostic
- type ValuesOptions
- type Variable
Constants ¶
View Source
const ( Version = "ramen.project.v1" ExtensionKey = "x-ramen-desired-state" DefaultFile = "project.uws.yaml" DefaultJSON = "project.uws.json" DefaultYAML = "project.uws.yml" WorkflowYAML = "workflows/workflow.uws.yaml" WorkflowJSON = "workflows/workflow.uws.json" WorkflowYML = "workflows/workflow.uws.yml" )
View Source
const InputsVersion = "ramen.inputs.v1"
Variables ¶
This section is empty.
Functions ¶
func ApplyValues ¶
func ApplyValues(profile Profile, values map[string]resolvedValueInternal) (Profile, []ValueDiagnostic)
func ResolvePath ¶
func ResolveProfile ¶
func ResolveProfile(profile Profile, projectDir string, opts ValuesOptions) (Profile, ResolvedInputs, []ValueDiagnostic)
func ResolveValues ¶
func ResolveValues(profile Profile, projectDir string, opts ValuesOptions) (map[string]resolvedValueInternal, ResolvedInputs, []ValueDiagnostic)
func ValidateProfile ¶
Types ¶
type AIMetadata ¶
type AIMetadata struct {
Confidence *Confidence `json:"confidence,omitempty"`
Uncertainty string `json:"uncertainty,omitempty"`
Rationale string `json:"rationale,omitempty"`
Citations []string `json:"citations,omitempty"`
}
type APISource ¶
func SourceForRole ¶
func SourceForRole(profile Profile, role OperationRole) APISource
type Confidence ¶
type IdentityAttribute ¶
type MappingLifecycle ¶
type MappingLifecycle struct {
OperationRoles []string `json:"operation_roles,omitempty"`
Paths []MappingLifecyclePath `json:"paths,omitempty"`
}
type MappingLifecyclePath ¶
type MappingLifecyclePath struct {
Path string `json:"path"`
Immutable bool `json:"immutable,omitempty"`
CreateOnly bool `json:"create_only,omitempty"`
Updateable bool `json:"updateable,omitempty"`
ReplaceOnChange bool `json:"replace_on_change,omitempty"`
Computed bool `json:"computed,omitempty"`
Ignored bool `json:"ignored,omitempty"`
}
type Normalizer ¶
type OperationRole ¶
type OperationRole struct {
Purpose string `json:"purpose,omitempty"`
Method string `json:"method,omitempty"`
SourceKind string `json:"source_kind,omitempty"`
SourceID string `json:"source_id,omitempty"`
SourcePath string `json:"source_path,omitempty"`
OperationID string `json:"operation_id,omitempty"`
CredentialBindings []string `json:"credential_bindings,omitempty"`
AI *AIMetadata `json:"ai,omitempty"`
}
type Profile ¶
type Profile struct {
Version string `json:"version"`
APISources []APISource `json:"api_sources,omitempty"`
Variables []Variable `json:"variables,omitempty"`
Resources []Resource `json:"resources,omitempty"`
Redaction Redaction `json:"redaction,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type RequestBinding ¶
type RequestBinding struct {
OperationRole string `json:"operation_role"`
OperationID string `json:"operation_id,omitempty"`
Path string `json:"path"`
RequestPath string `json:"request_path"`
Location string `json:"location,omitempty"`
Encoding string `json:"encoding,omitempty"`
Required bool `json:"required,omitempty"`
Identity bool `json:"identity,omitempty"`
}
type ResolvedInputs ¶
type ResolvedInputs struct {
Version string `json:"version"`
Digest string `json:"digest,omitempty"`
Values []ResolvedValue `json:"values,omitempty"`
}
type ResolvedValue ¶
type Resource ¶
type Resource struct {
Address string `json:"address"`
Kind string `json:"kind"`
Type string `json:"type"`
Name string `json:"name,omitempty"`
Provider string `json:"provider,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
Lifecycle Lifecycle `json:"lifecycle,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Operations map[string]OperationRole `json:"operations,omitempty"`
IdentityAttributes []IdentityAttribute `json:"identity_attributes,omitempty"`
Schema []SchemaPath `json:"schema,omitempty"`
RequestBindings []RequestBinding `json:"request_bindings,omitempty"`
ResponseBindings []ResponseBinding `json:"response_bindings,omitempty"`
Normalizers []Normalizer `json:"normalizers,omitempty"`
MappingLifecycle *MappingLifecycle `json:"mapping_lifecycle,omitempty"`
RequiredOperations []string `json:"required_operations,omitempty"`
CredentialBindings []string `json:"credential_bindings,omitempty"`
RuntimeHints *RuntimeHints `json:"runtime_hints,omitempty"`
Redaction Redaction `json:"redaction,omitempty"`
AI *AIMetadata `json:"ai,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type ResponseBinding ¶
type ResponseBinding struct {
OperationRole string `json:"operation_role"`
OperationID string `json:"operation_id,omitempty"`
ResponsePath string `json:"response_path"`
StatePath string `json:"state_path"`
Identity bool `json:"identity,omitempty"`
ResponseDerivedIdentity bool `json:"response_derived_identity,omitempty"`
Computed bool `json:"computed,omitempty"`
Observed bool `json:"observed,omitempty"`
Sensitive bool `json:"sensitive,omitempty"`
}
type RuntimeHints ¶
type SchemaPath ¶
type SchemaPath struct {
Path string `json:"path"`
Type string `json:"type,omitempty"`
EnumValues []string `json:"enum_values,omitempty"`
Required bool `json:"required,omitempty"`
Optional bool `json:"optional,omitempty"`
Computed bool `json:"computed,omitempty"`
Sensitive bool `json:"sensitive,omitempty"`
Identity bool `json:"identity,omitempty"`
ResponseDerivedIdentity bool `json:"response_derived_identity,omitempty"`
Immutable bool `json:"immutable,omitempty"`
CreateOnly bool `json:"create_only,omitempty"`
Updateable bool `json:"updateable,omitempty"`
ReplaceOnChange bool `json:"replace_on_change,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
Ignored bool `json:"ignored,omitempty"`
}
type ValueDiagnostic ¶
type ValuesOptions ¶
Click to show internal directories.
Click to hide internal directories.