star

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeatureConstructor   starlark.String = "feature"
	FeatureVariableName  string          = "result"
	DefaultValueAttrName string          = "default"
	DescriptionAttrName  string          = "description"
	RulesAttrName        string          = "rules"
)

Variables

This section is empty.

Functions

func BuildDynamicTypeRegistry

func BuildDynamicTypeRegistry(ctx context.Context, protoDir string, provider fs.Provider) (*protoregistry.Types, error)

Takes a path to the protobuf directory in the config repo, and generates a registry of user-defined types. This registry implements the Resolver interface, which is useful for compiling to json.

func GetTemplate

func GetTemplate(fType feature.FeatureType) ([]byte, error)

func ReBuildDynamicTypeRegistry

func ReBuildDynamicTypeRegistry(ctx context.Context, protoDir string, cw fs.ConfigWriter) (*protoregistry.Types, error)

Note: this method is not safe to be run on ephemeral repos, as it invokes the buf cmd line.

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 {
	Format(ctx context.Context) (persisted, diffExists bool, err error)
}

func NewStarFormatter

func NewStarFormatter(filePath, featureName string, fType feature.FeatureType, cw fs.ConfigWriter, dryRun bool) Formatter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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