Documentation
¶
Index ¶
- func Create(path string) error
- func FormatValidationError(issues []ValidationError) string
- func GetValidOutputFormats() []string
- func IsKnownProperty(path, flagKey string) bool
- func IsValidOutputFormat(format string) bool
- func LoadFlagSet(manifestPath string) (*flagset.Flagset, error)
- func LoadFromLocal(filePath string) (*flagset.Flagset, error)
- func LoadFromRemote(url string, authToken string) (*flagset.Flagset, error)
- func LoadFromSyncAPI(baseURL string, authToken string) (*flagset.Flagset, error)
- func SaveToRemote(url string, flags *flagset.Flagset, authToken string, dryRun bool) (*sync.PushResult, error)
- func ShouldIgnorePath(path string, ignorePatterns []string) bool
- func ToJSONSchema() *jsonschema.Schema
- func URLLooksLikeAFile(url string) bool
- func Write(path string, flagset flagset.Flagset) error
- type BaseFlag
- type BooleanFlag
- type Change
- type CompareOptions
- type FloatFlag
- type IntegerFlag
- type Manifest
- type ObjectFlag
- type OutputFormat
- type StringFlag
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 IsKnownProperty ¶ added in v0.3.11
IsKnownProperty checks if a path represents a known schema property
func IsValidOutputFormat ¶ added in v0.3.4
IsValidOutputFormat checks if the given format is a valid output format
func LoadFlagSet ¶ added in v0.3.6
LoadFlagSet loads, validates, and unmarshals the manifest file at the given path into a flagset
func LoadFromLocal ¶ added in v0.3.6
LoadFromLocal loads flags from a local file path
func LoadFromRemote ¶ added in v0.3.6
LoadFromRemote loads flags from a remote URL using direct HTTP requests This is a fallback for sources that don't implement the sync API specification
func LoadFromSyncAPI ¶ added in v0.3.10
LoadFromSyncAPI loads flags from a remote URL using the sync API client This should be used when the remote source implements the sync API specification
func SaveToRemote ¶ added in v0.3.10
func SaveToRemote(url string, flags *flagset.Flagset, authToken string, dryRun bool) (*sync.PushResult, error)
SaveToRemote saves flags to a remote URL using HTTP/HTTPS This function performs a smart push: it fetches remote flags first, compares them with local flags, and intelligently creates or updates flags as needed. Returns a PushResult with details of what was changed. If dryRun is true, only performs the comparison without making actual API calls.
func ShouldIgnorePath ¶ added in v0.3.11
ShouldIgnorePath checks if a path should be ignored based on the ignore patterns
func ToJSONSchema ¶
func ToJSONSchema() *jsonschema.Schema
Converts the Manifest struct to a JSON schema.
func URLLooksLikeAFile ¶ added in v0.3.10
URLLooksLikeAFile checks if the given URL string appears to point to a file
Types ¶
type BooleanFlag ¶
type Change ¶
type CompareOptions ¶ added in v0.3.11
type CompareOptions struct {
IgnorePatterns []string
}
CompareOptions holds options for comparing manifests
type IntegerFlag ¶
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 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 ValidationError ¶
type ValidationError struct {
Type string `json:"type"`
Path string `json:"path"`
Message string `json:"message"`
}
func Validate ¶
func Validate(data []byte) ([]ValidationError, error)