config

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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.

func (*AmazonS3) Equal added in v0.6.0

func (a *AmazonS3) Equal(other *AmazonS3) bool

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) Equal added in v0.6.0

func (s *Bundle) Equal(other *Bundle) bool

func (*Bundle) UnmarshalJSON added in v0.6.0

func (s *Bundle) UnmarshalJSON(bs []byte) error

func (*Bundle) UnmarshalYAML added in v0.6.0

func (s *Bundle) UnmarshalYAML(bs []byte) error

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

type Duration time.Duration

Duration wraps time.Duration with JSON/YAML string marshaling (e.g. "5m", "0.5s").

func (Duration) MarshalJSON added in v0.6.0

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) PrepareJSONSchema added in v0.6.0

func (Duration) PrepareJSONSchema(schema *schemareflector.Schema) error

PrepareJSONSchema implements the jsonschema-go Preparer interface.

func (Duration) String added in v0.6.0

func (d Duration) String() string

func (*Duration) UnmarshalJSON added in v0.6.0

func (d *Duration) UnmarshalJSON(data []byte) error

func (*Duration) UnmarshalYAML added in v0.6.0

func (d *Duration) UnmarshalYAML(bs []byte) error

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

type Files map[string]string

Files is a map of file paths to file contents with base64 JSON/YAML marshaling.

func (Files) Equal added in v0.6.0

func (a Files) Equal(b Files) bool

func (Files) MarshalJSON added in v0.6.0

func (f Files) MarshalJSON() ([]byte, error)

func (Files) MarshalYAML added in v0.6.0

func (f Files) MarshalYAML() (any, error)

func (*Files) UnmarshalJSON added in v0.6.0

func (f *Files) UnmarshalJSON(bs []byte) error

func (*Files) UnmarshalYAML added in v0.6.0

func (f *Files) UnmarshalYAML(bs []byte) error

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.

func (*Git) Equal added in v0.6.0

func (g *Git) Equal(other *Git) bool

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 Labels added in v0.6.0

type Labels map[string]string

Labels is a map of key-value string pairs used for bundle labeling.

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.

func (Options) Empty added in v0.6.0

func (o Options) Empty() bool

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) Equal added in v0.6.0

func (s *SecretRef) Equal(other *SecretRef) bool

func (*SecretRef) MarshalJSON added in v0.6.0

func (s *SecretRef) MarshalJSON() ([]byte, error)

func (*SecretRef) MarshalYAML added in v0.6.0

func (s *SecretRef) MarshalYAML() (any, error)

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

func (s *SecretRef) Resolve(ctx context.Context) (any, error)

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

func (s *SecretRef) SetResolver(fn func(context.Context) (any, error))

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 (s *SecretRef) UnmarshalJSON(bs []byte) error

func (*SecretRef) UnmarshalYAML added in v0.6.0

func (s *SecretRef) UnmarshalYAML(bs []byte) error

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) Equal added in v0.6.0

func (s *Source) Equal(other *Source) bool

func (*Source) Files added in v0.6.0

func (s *Source) Files() (map[string]string, error)

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

func (*Source) SetDirectory added in v0.6.0

func (s *Source) SetDirectory(directory string)

func (*Source) SetEmbeddedFile added in v0.6.0

func (s *Source) SetEmbeddedFile(path string, content string)

func (*Source) SetEmbeddedFiles added in v0.6.0

func (s *Source) SetEmbeddedFiles(files map[string]string)

func (*Source) SetPath added in v0.6.0

func (s *Source) SetPath(path string)

type Sources added in v0.6.0

type Sources []*Source

Sources is a slice of Source pointers.

func (Sources) Equal added in v0.6.0

func (a Sources) Equal(b Sources) bool

type StringSet added in v0.6.0

type StringSet []string

StringSet is a slice of strings.

func (StringSet) Add added in v0.6.0

func (a StringSet) Add(value string) StringSet

func (StringSet) Equal added in v0.6.0

func (a StringSet) Equal(b StringSet) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL