Documentation ¶
Index ¶
- Constants
- func BuildDynamicTypeRegistry(ctx context.Context, protoDir string, provider fs.Provider) (*protoregistry.Types, error)
- func GetTemplate(fType feature.FeatureType) ([]byte, error)
- func ReBuildDynamicTypeRegistry(ctx context.Context, protoDir string, cw fs.ConfigWriter) (*protoregistry.Types, error)
- type Builder
- type Compiler
- type Formatter
Constants ¶
View Source
const ( FeatureConstructor starlark.String = "feature" FeatureVariableName string = "result" DefaultValueAttrName string = "default" DescriptionAttrName string = "description" RulesAttrName string = "rules" )
View Source
const (
InputTypeAuto string = "auto"
)
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.CompiledFeature, error) Persist(context.Context, *feature.Feature, bool) (bool, 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.
Click to show internal directories.
Click to hide internal directories.