* Create user handler stuff. * Fixing Not Found errors from DB. * Fixing param names. * Update the proto's go package generation. * Generate the user resource. * Adding SDK methods for users. * Fix the base type of Users and add tests. * Connect user service to the controller handler. * Attach the default org to the Test Controller's client. * Take into account the provided request paths when the client builds the org/project path prefix. * Adding comments to the API. * rename repo function to repoFn. * Fix typo in update mask errors. * Clean up tests. * Remove special checks for request url content in the api client and fix CORS test.
140 lines
2.9 KiB
Go
140 lines
2.9 KiB
Go
package main
|
|
|
|
import "os"
|
|
|
|
type structInfo struct {
|
|
inFile string
|
|
inName string
|
|
outFile string
|
|
outName string
|
|
outPkg string
|
|
structFields string
|
|
parentName string
|
|
detailName string
|
|
templateType templateType
|
|
}
|
|
|
|
var inputStructs = []*structInfo{
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go",
|
|
"Error",
|
|
os.Getenv("GEN_BASEPATH") + "/api/error.gen.go",
|
|
"Error",
|
|
"api",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go",
|
|
"ErrorDetails",
|
|
os.Getenv("GEN_BASEPATH") + "/api/error_details.gen.go",
|
|
"ErrorDetails",
|
|
"api",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/error.pb.go",
|
|
"FieldError",
|
|
os.Getenv("GEN_BASEPATH") + "/api/field_error.gen.go",
|
|
"FieldError",
|
|
"api",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host.pb.go",
|
|
"Host",
|
|
os.Getenv("GEN_BASEPATH") + "/api/hosts/host.gen.go",
|
|
"Host",
|
|
"hosts",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_set.pb.go",
|
|
"HostSet",
|
|
os.Getenv("GEN_BASEPATH") + "/api/hosts/host_set.gen.go",
|
|
"HostSet",
|
|
"hosts",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go",
|
|
"HostCatalog",
|
|
os.Getenv("GEN_BASEPATH") + "/api/hosts/host_catalog.gen.go",
|
|
"HostCatalog",
|
|
"hosts",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/scopes/organization.pb.go",
|
|
"Organization",
|
|
os.Getenv("GEN_BASEPATH") + "/api/scopes/organization.gen.go",
|
|
"Organization",
|
|
"scopes",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/scopes/project.pb.go",
|
|
"Project",
|
|
os.Getenv("GEN_BASEPATH") + "/api/scopes/project.gen.go",
|
|
"Project",
|
|
"scopes",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/users/user.pb.go",
|
|
"User",
|
|
os.Getenv("GEN_BASEPATH") + "/api/users/user.gen.go",
|
|
"User",
|
|
"users",
|
|
"",
|
|
"",
|
|
"",
|
|
templateTypeResource,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go",
|
|
"StaticHostCatalogDetails",
|
|
os.Getenv("GEN_BASEPATH") + "/api/hosts/static_host_catalog.gen.go",
|
|
"StaticHostCatalogDetails",
|
|
"hosts",
|
|
"",
|
|
"HostCatalog",
|
|
"StaticHostCatalog",
|
|
templateTypeDetail,
|
|
},
|
|
{
|
|
os.Getenv("GEN_BASEPATH") + "/internal/gen/controller/api/resources/hosts/host_catalog.pb.go",
|
|
"AwsEc2HostCatalogDetails",
|
|
os.Getenv("GEN_BASEPATH") + "/api/hosts/awsec2_host_catalog.gen.go",
|
|
"AwsEc2HostCatalogDetails",
|
|
"hosts",
|
|
"",
|
|
"HostCatalog",
|
|
"AwsEc2HostCatalog",
|
|
templateTypeDetail,
|
|
},
|
|
}
|