manifest

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(path string) error

Create creates a new manifest file at the given path.

func FormatValidationError added in v0.3.6

func FormatValidationError(issues []ValidationError) string

func GetValidOutputFormats added in v0.3.4

func GetValidOutputFormats() []string

GetValidOutputFormats returns a list of all valid output formats

func IsValidOutputFormat added in v0.3.4

func IsValidOutputFormat(format string) bool

IsValidOutputFormat checks if the given format is a valid output format

func LoadFlagSet added in v0.3.6

func LoadFlagSet(manifestPath string) (*flagset.Flagset, error)

LoadFlagSet loads, validates, and unmarshals the manifest file at the given path into a flagset

func LoadFromLocal added in v0.3.6

func LoadFromLocal(filePath string) (*flagset.Flagset, error)

LoadFromLocal loads flags from a local file path

func LoadFromRemote added in v0.3.6

func LoadFromRemote(url string, authToken string) (*flagset.Flagset, error)

LoadFromRemote loads flags from a remote URL

func ToJSONSchema

func ToJSONSchema() *jsonschema.Schema

Converts the Manifest struct to a JSON schema.

func Write added in v0.3.6

func Write(path string, flagset flagset.Flagset) error

Write writes a flagset to a manifest file at the given path

Types

type BaseFlag

type BaseFlag struct {
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"required"`
	// A concise description of this feature flag's purpose.
	Description string `json:"description,omitempty"`
}

type BooleanFlag

type BooleanFlag struct {
	BaseFlag
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"enum=boolean"`
	// The value returned from an unsuccessful flag evaluation
	DefaultValue bool `json:"defaultValue,omitempty"`
}

type Change

type Change struct {
	Type     string `json:"type"`
	Path     string `json:"path"`
	OldValue any    `json:"oldValue,omitempty"`
	NewValue any    `json:"newValue,omitempty"`
}

func Compare

func Compare(oldManifest, newManifest *Manifest) ([]Change, error)

type FloatFlag

type FloatFlag struct {
	BaseFlag
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"enum=float"`
	// The value returned from an unsuccessful flag evaluation
	DefaultValue float64 `json:"defaultValue,omitempty"`
}

type IntegerFlag

type IntegerFlag struct {
	BaseFlag
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"enum=integer"`
	// The value returned from an unsuccessful flag evaluation
	DefaultValue int `json:"defaultValue,omitempty"`
}

type Manifest

type Manifest struct {
	// Collection of feature flag definitions
	Flags map[string]any `json:"flags" jsonschema:"title=Flags,required"`
}

Feature flag manifest for the OpenFeature CLI

type ObjectFlag

type ObjectFlag struct {
	BaseFlag
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"enum=object"`
	// The value returned from an unsuccessful flag evaluation
	DefaultValue any `json:"defaultValue,omitempty"`
}

type OutputFormat added in v0.3.4

type OutputFormat string

OutputFormat represents the available output formats for the compare command

const (
	// OutputFormatTree represents the tree output format (default)
	OutputFormatTree OutputFormat = "tree"
	// OutputFormatFlat represents the flat output format
	OutputFormatFlat OutputFormat = "flat"
	// OutputFormatJSON represents the JSON output format
	OutputFormatJSON OutputFormat = "json"
	// OutputFormatYAML represents the YAML output format
	OutputFormatYAML OutputFormat = "yaml"
)

type StringFlag

type StringFlag struct {
	BaseFlag
	// The type of feature flag (e.g., boolean, string, integer, float)
	Type string `json:"flagType,omitempty" jsonschema:"enum=string"`
	// The value returned from an unsuccessful flag evaluation
	DefaultValue string `json:"defaultValue,omitempty"`
}

type ValidationError

type ValidationError struct {
	Type    string `json:"type"`
	Path    string `json:"path"`
	Message string `json:"message"`
}

func Validate

func Validate(data []byte) ([]ValidationError, error)

Jump to

Keyboard shortcuts

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