Skip to content

Commit ea560cf

Browse files
author
Cristian Vidmar
committed
feat: non-concurrent cache updates
1 parent 62b99e2 commit ea560cf

15 files changed

+383
-265
lines changed

erm/space.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type spaceConf struct {
2222
Locales []Locale
2323
ContentTypes []ContentType
2424
ContentType ContentType
25+
Version string
2526
}
2627

2728
// GetLocales retrieves locale definition from Contentful
@@ -127,7 +128,7 @@ func getData(spaceID, cmaKey, environment, exportFile string, flagContentTypes [
127128
}
128129

129130
// GenerateAPI calls the generators
130-
func GenerateAPI(dir, packageName, spaceID, cmaKey, environment, exportFile string, flagContentTypes []string) (err error) {
131+
func GenerateAPI(dir, packageName, spaceID, cmaKey, environment, exportFile string, flagContentTypes []string, version string) (err error) {
131132
contentTypes, locales, errGetData := getData(spaceID, cmaKey, environment, exportFile, flagContentTypes)
132133
if errGetData != nil {
133134
return errGetData
@@ -145,6 +146,7 @@ func GenerateAPI(dir, packageName, spaceID, cmaKey, environment, exportFile stri
145146
PackageName: packageName,
146147
Locales: locales,
147148
ContentTypes: contentTypes,
149+
Version: version,
148150
}
149151
return generateCode(conf)
150152
}

erm/templates/contentful_vo.gotmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package {{ .PackageName }} - DO NOT EDIT THIS FILE: Auto-generated code by https://github.com/foomo/gocontentful
1+
// Package {{ .PackageName }} - DO NOT EDIT THIS FILE: Auto-generated code by https://github.com/foomo/gocontentful {{ .Version }}
22
{{ $cfg := . }}{{ $contentTypes := .ContentTypes }}package {{ .PackageName }}
33

44
import "github.com/foomo/contentful"

erm/templates/contentful_vo_base.gotmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package {{ .PackageName }} - DO NOT EDIT THIS FILE: Auto-generated code by https://github.com/foomo/gocontentful
1+
// Package {{ .PackageName }} - DO NOT EDIT THIS FILE: Auto-generated code by https://github.com/foomo/gocontentful {{ .Version }}
22
{{ $cfg := . }}package {{ .PackageName }}
33

44
import "github.com/foomo/contentful"

0 commit comments

Comments
 (0)