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 ¶
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 ¶
func NewStarFormatter ¶
func NewStarFormatter(filePath, featureName string, fType feature.FeatureType, cw fs.ConfigWriter, dryRun bool) Formatter
Click to show internal directories.
Click to hide internal directories.