star

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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