feat: command flags cleanup
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
33
internal/setup/default_registry.go
Normal file
33
internal/setup/default_registry.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user