star

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeatureConstructor   starlark.String = "feature"
	ExportConstructor    starlark.String = "export"
	ConfigConstructor    starlark.String = "Config"
	ResultVariableName   string          = "result"
	DefaultValueAttrName string          = "default"
	DescriptionAttrName  string          = "description"
	MetadataAttrName     string          = "metadata"
	// TODO: Fully migrate to overrides over rules
	RulesAttrName     string = "rules"
	OverridesAttrName string = "overrides"
)

Variables

This section is empty.

Functions

func GetTemplate

func GetTemplate(fType eval.ConfigType, nv feature.NamespaceVersion, defaultValue interface{}) ([]byte, error)

func RenderExistingProtoTemplate added in v0.2.19

func RenderExistingProtoTemplate(inputs ProtoStarInputs, nv feature.NamespaceVersion) ([]byte, error)

RenderExistingProtoTemplate will render the parsed Proto message descriptor into a Starlark feature model

func ValToStarStr added in v0.3.10

func ValToStarStr(value interface{}) (string, error)

Converts arbitrary value to Starlark equivalent representation

Types

type Builder

type Builder interface {
	Build() (*feature.CompiledFeature, error)
}

type Compiler

type Compiler interface {
	Compile(context.Context, feature.NamespaceVersion) (*feature.CompiledFeature, error)
	Persist(ctx context.Context, f *feature.Feature, nv feature.NamespaceVersion, ignoreBackwardsCompatibility, dryRun bool) (persisted bool, diffExists bool, err error)
}

func NewCompiler

func NewCompiler(registry *protoregistry.Types, ff *feature.FeatureFile, cw fs.ConfigWriter) Compiler

Compile takes the following parameters: protoDir: path to the proto directory that stores all user-defined proto files starfilePath: path to the .star file that defines this feature flag featureName: human-readable name of this feature flag. Also matches the starfile name.

type Formatter

type Formatter interface {
	// Runs the starlark formatter from bazel buildtools.
	Format(ctx context.Context) (persisted, diffExists bool, err error)
	// Runs the lekko static parser to format starlark the way the UI would.
	StaticFormat(ctx context.Context) (persisted, diffExists bool, err error)
}

func NewStarFormatter

func NewStarFormatter(filePath, featureName string, cw fs.ConfigWriter, dryRun bool, registry *protoregistry.Types, nv feature.NamespaceVersion, segments map[string]string) Formatter

type ProtoStarInputs added in v0.2.19

type ProtoStarInputs struct {
	Message  string
	Packages map[string]string
	Fields   []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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