forked from StephanHCB/go-generator-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublic.go
34 lines (26 loc) · 1.19 KB
/
public.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package generatorlib
import (
"context"
"github.com/StephanHCB/go-generator-lib/api"
"github.com/StephanHCB/go-generator-lib/internal/implementation"
"github.com/StephanHCB/go-generator-lib/internal/logfacade"
)
var Instance api.Api
func init() {
Instance = &logfacade.GeneratorLogfacade{Wrapped: &implementation.GeneratorImpl{}}
}
func FindGeneratorNames(ctx context.Context, sourceBaseDir string) ([]string, error) {
return Instance.FindGeneratorNames(ctx, sourceBaseDir)
}
func ObtainGeneratorSpec(ctx context.Context, sourceBaseDir string, generatorName string) (*api.GeneratorSpec, error) {
return Instance.ObtainGeneratorSpec(ctx, sourceBaseDir, generatorName)
}
func WriteRenderSpecWithDefaults(ctx context.Context, request *api.Request, generatorName string) *api.Response {
return Instance.WriteRenderSpecWithDefaults(ctx, request, generatorName)
}
func WriteRenderSpecWithValues(ctx context.Context, request *api.Request, generatorName string, parameters map[string]interface{}) *api.Response {
return Instance.WriteRenderSpecWithValues(ctx, request, generatorName, parameters)
}
func Render(ctx context.Context, request *api.Request) *api.Response {
return Instance.Render(ctx, request)
}