Documentation ¶
Index ¶
- Constants
- func GetTemplate(fType eval.ConfigType, nv feature.NamespaceVersion, defaultValue interface{}) ([]byte, error)
- func RenderExistingProtoTemplate(inputs ProtoStarInputs, nv feature.NamespaceVersion) ([]byte, error)
- func ValToStarStr(value interface{}) (string, error)
- type Builder
- type Compiler
- type Formatter
- type ProtoStarInputs
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
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
Click to show internal directories.
Click to hide internal directories.