feat: command flags cleanup
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2023-06-23 11:08:35 -06:00
parent 8d21e9083c
commit e32c72e030
12 changed files with 292 additions and 136 deletions

View File

@ -0,0 +1,33 @@
package setup
import (
"context"
"forge.cadoles.com/cadoles/bouncer/internal/config"
"forge.cadoles.com/cadoles/bouncer/internal/proxy/director"
"forge.cadoles.com/cadoles/bouncer/internal/store"
"github.com/pkg/errors"
)
var defaultRegistry = NewRegistry()
func RegisterLayer(layerType store.LayerType, setupFunc LayerSetupFunc) {
defaultRegistry.RegisterLayer(layerType, setupFunc)
}
func CreateLayers(ctx context.Context, conf *config.Config) ([]director.Layer, error) {
layers, err := defaultRegistry.CreateLayers(ctx, conf)
if err != nil {
return nil, errors.WithStack(err)
}
return layers, nil
}
func GetLayerTypes() []store.LayerType {
return defaultRegistry.GetLayerTypes()
}
func LayerTypeExists(layerType store.LayerType) bool {
return defaultRegistry.LayerTypeExists(layerType)
}