Documentation
¶
Index ¶
- type AmazonS3
- type AzureBlobStorage
- type Bundle
- type BundleStatus
- type Datasource
- type Datasources
- type Duration
- type FileSystemStorage
- type Files
- type GCPCloudStorage
- type Git
- type GitRequirement
- type Labels
- type ObjectStorage
- type Optimization
- type Options
- type Requirement
- type Requirements
- type SecretRef
- func (s *SecretRef) Equal(other *SecretRef) bool
- func (s *SecretRef) MarshalJSON() ([]byte, error)
- func (s *SecretRef) MarshalYAML() (any, error)
- func (*SecretRef) PrepareJSONSchema(schema *schemareflector.Schema) error
- func (s *SecretRef) Resolve(ctx context.Context) (any, error)
- func (s *SecretRef) SetResolver(fn func(context.Context) (any, error))
- func (s *SecretRef) UnmarshalJSON(bs []byte) error
- func (s *SecretRef) UnmarshalYAML(bs []byte) error
- type Source
- func (s *Source) Equal(other *Source) bool
- func (s *Source) Files() (map[string]string, error)
- func (*Source) PrepareJSONSchema(schema *schemareflector.Schema) error
- func (s *Source) Requirement() Requirement
- func (s *Source) SetDirectory(directory string)
- func (s *Source) SetEmbeddedFile(path string, content string)
- func (s *Source) SetEmbeddedFiles(files map[string]string)
- func (s *Source) SetPath(path string)
- type Sources
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmazonS3 ¶ added in v0.6.0
type AmazonS3 struct {
Bucket string `json:"bucket"`
Key string `json:"key"`
Region string `json:"region,omitempty"`
Credentials *SecretRef `json:"credentials,omitempty"`
URL string `json:"url,omitempty"` // for test purposes
}
AmazonS3 defines the configuration for an Amazon S3-compatible object storage.
type AzureBlobStorage ¶ added in v0.6.0
type AzureBlobStorage struct {
AccountURL string `json:"account_url"`
Container string `json:"container"`
Path string `json:"path"`
Credentials *SecretRef `json:"credentials,omitempty"`
}
AzureBlobStorage defines the configuration for an Azure Blob Storage container.
func (*AzureBlobStorage) Equal ¶ added in v0.6.0
func (a *AzureBlobStorage) Equal(other *AzureBlobStorage) bool
type Bundle ¶ added in v0.6.0
type Bundle struct {
Name string `json:"name"`
Labels Labels `json:"labels,omitempty"`
Revision string `json:"revision,omitempty"`
ObjectStorage ObjectStorage `json:"object_storage,omitzero"`
Requirements Requirements `json:"requirements,omitempty"`
ExcludedFiles StringSet `json:"excluded_files,omitempty"`
Interval Duration `json:"rebuild_interval,omitzero"`
Options Options `json:"options,omitzero"`
// contains filtered or unexported fields
}
Bundle defines the configuration for an OPA Control Plane Bundle.
func (*Bundle) UnmarshalJSON ¶ added in v0.6.0
func (*Bundle) UnmarshalYAML ¶ added in v0.6.0
type BundleStatus ¶ added in v0.6.0
type BundleStatus struct {
ID int64 `json:"-"`
TenantID int64 `json:"-"`
BundleID int64 `json:"-"`
BundleName string `json:"bundle_name"`
Revision string `json:"revision,omitempty"`
Phase string `json:"phase"`
Status string `json:"status"`
ErrorMessage *string `json:"error_message,omitempty"`
CreatedAt time.Time `json:"created_at"`
// contains filtered or unexported fields
}
BundleStatus represents the build status of a bundle.
type Datasource ¶ added in v0.6.0
type Datasource struct {
Name string `json:"name"`
Path string `json:"path"`
Type string `json:"type"`
TransformQuery string `json:"transform_query,omitempty"`
Config map[string]any `json:"config,omitempty"`
Credentials *SecretRef `json:"credentials,omitempty"`
// contains filtered or unexported fields
}
Datasource defines a data source configuration for an OPA Control Plane Source.
func (*Datasource) Equal ¶ added in v0.6.0
func (d *Datasource) Equal(other *Datasource) bool
type Datasources ¶ added in v0.6.0
type Datasources []Datasource
Datasources is a slice of Datasource.
func (Datasources) Equal ¶ added in v0.6.0
func (a Datasources) Equal(b Datasources) bool
type Duration ¶ added in v0.6.0
Duration wraps time.Duration with JSON/YAML string marshaling (e.g. "5m", "0.5s").
func (Duration) MarshalJSON ¶ added in v0.6.0
func (Duration) PrepareJSONSchema ¶ added in v0.6.0
func (Duration) PrepareJSONSchema(schema *schemareflector.Schema) error
PrepareJSONSchema implements the jsonschema-go Preparer interface.
func (*Duration) UnmarshalJSON ¶ added in v0.6.0
func (*Duration) UnmarshalYAML ¶ added in v0.6.0
type FileSystemStorage ¶ added in v0.6.0
type FileSystemStorage struct {
Path string `json:"path"`
}
FileSystemStorage defines the configuration for a local filesystem storage.
func (*FileSystemStorage) Equal ¶ added in v0.6.0
func (f *FileSystemStorage) Equal(other *FileSystemStorage) bool
type Files ¶ added in v0.6.0
Files is a map of file paths to file contents with base64 JSON/YAML marshaling.
func (Files) MarshalJSON ¶ added in v0.6.0
func (Files) MarshalYAML ¶ added in v0.6.0
func (*Files) UnmarshalJSON ¶ added in v0.6.0
func (*Files) UnmarshalYAML ¶ added in v0.6.0
type GCPCloudStorage ¶ added in v0.6.0
type GCPCloudStorage struct {
Project string `json:"project"`
Bucket string `json:"bucket"`
Object string `json:"object"`
Credentials *SecretRef `json:"credentials,omitempty"`
}
GCPCloudStorage defines the configuration for a Google Cloud Storage bucket.
func (*GCPCloudStorage) Equal ¶ added in v0.6.0
func (g *GCPCloudStorage) Equal(other *GCPCloudStorage) bool
type Git ¶ added in v0.6.0
type Git struct {
Repo string `json:"repo"`
Reference *string `json:"reference,omitempty"`
Commit *string `json:"commit,omitempty"`
Path *string `json:"path,omitempty"`
IncludedFiles StringSet `json:"included_files,omitempty"`
ExcludedFiles StringSet `json:"excluded_files,omitempty"`
Credentials *SecretRef `json:"credentials,omitempty"`
// contains filtered or unexported fields
}
Git defines the Git synchronization configuration used by OPA Control Plane Sources.
type GitRequirement ¶
type GitRequirement struct {
Commit *string `json:"commit,omitempty"`
// contains filtered or unexported fields
}
GitRequirement specifies Git-specific constraints for a requirement. It allows pinning a dependency to a specific Git commit hash.
type ObjectStorage ¶ added in v0.6.0
type ObjectStorage struct {
AmazonS3 *AmazonS3 `json:"aws,omitempty"`
GCPCloudStorage *GCPCloudStorage `json:"gcp,omitempty"`
AzureBlobStorage *AzureBlobStorage `json:"azure,omitempty"`
FileSystemStorage *FileSystemStorage `json:"filesystem,omitempty"`
}
ObjectStorage defines where bundles are stored.
func (*ObjectStorage) Equal ¶ added in v0.6.0
func (o *ObjectStorage) Equal(other *ObjectStorage) bool
type Optimization ¶ added in v0.6.0
type Optimization struct {
Level int `json:"level,omitzero" enum:"0,1,2"`
// contains filtered or unexported fields
}
Optimization configures bundle optimization settings.
type Options ¶ added in v0.6.0
type Options struct {
NoDefaultStackMount bool `json:"no_default_stack_mount"`
Optimization *Optimization `json:"optimization,omitempty"`
Target string `json:"target,omitzero" enum:"rego,ir,plan,wasm"`
// contains filtered or unexported fields
}
Options configures bundle build options.
type Requirement ¶
type Requirement struct {
Source *string `json:"source,omitempty"`
Git GitRequirement `json:"git,omitzero"`
Path string `json:"path,omitzero"`
Prefix string `json:"prefix,omitzero"`
AutoMount *bool `json:"automount,omitempty"`
// contains filtered or unexported fields
}
Requirement specifies a dependency on a source (such as a Git repository) with optional constraints for how it should be resolved and mounted.
func (Requirement) Compare ¶
func (a Requirement) Compare(b Requirement) int
func (Requirement) Equal ¶
func (a Requirement) Equal(b Requirement) bool
type Requirements ¶ added in v0.6.0
type Requirements []Requirement
Requirements is a slice of Requirement.
func (Requirements) Equal ¶ added in v0.6.0
func (a Requirements) Equal(b Requirements) bool
type SecretRef ¶ added in v0.6.0
type SecretRef struct {
Name string `json:"-"`
// contains filtered or unexported fields
}
SecretRef is a reference to a named secret. External consumers see only the secret name; secret resolution is handled internally.
func (*SecretRef) MarshalJSON ¶ added in v0.6.0
func (*SecretRef) MarshalYAML ¶ added in v0.6.0
func (*SecretRef) PrepareJSONSchema ¶ added in v0.6.0
func (*SecretRef) PrepareJSONSchema(schema *schemareflector.Schema) error
PrepareJSONSchema implements the jsonschema-go Preparer interface.
func (*SecretRef) Resolve ¶ added in v0.6.0
Resolve retrieves the secret value from the secret store. If no resolver was configured (e.g. the config was not loaded through the internal unmarshal pipeline), an error is returned.
func (*SecretRef) SetResolver ¶ added in v0.6.0
SetResolver sets the resolve function for this secret reference. This is called by the internal config unmarshal pipeline to wire up secret resolution.
func (*SecretRef) UnmarshalJSON ¶ added in v0.6.0
func (*SecretRef) UnmarshalYAML ¶ added in v0.6.0
type Source ¶ added in v0.6.0
type Source struct {
ID int64 `json:"-"`
Name string `json:"name"`
Builtin *string `json:"builtin,omitempty"`
Git Git `json:"git,omitzero"`
Datasources Datasources `json:"datasources,omitempty"`
EmbeddedFiles Files `json:"files,omitempty"`
Directory string `json:"directory,omitempty"`
Paths StringSet `json:"paths,omitempty"`
Requirements Requirements `json:"requirements,omitempty"`
}
Source defines the configuration for an OPA Control Plane Source.
func (*Source) Files ¶ added in v0.6.0
Files returns the merged set of embedded files and filesystem files for a source.
func (*Source) PrepareJSONSchema ¶ added in v0.6.0
func (*Source) PrepareJSONSchema(schema *schemareflector.Schema) error
PrepareJSONSchema implements the jsonschema-go Preparer interface. This allows a null YAML source like:
sources: empty-source:
func (*Source) Requirement ¶ added in v0.6.0
func (s *Source) Requirement() Requirement