{"id":19453571,"url":"https://github.com/bowei/gce-gen","last_synced_at":"2026-05-14T18:04:24.593Z","repository":{"id":81004859,"uuid":"114499628","full_name":"bowei/gce-gen","owner":"bowei","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-05T07:18:59.000Z","size":1110,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T10:20:41.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bowei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-17T00:40:08.000Z","updated_at":"2017-12-17T01:21:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa695264-1a8b-476e-b2c7-a0b1cdbcfebd","html_url":"https://github.com/bowei/gce-gen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bowei/gce-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowei%2Fgce-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowei%2Fgce-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowei%2Fgce-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowei%2Fgce-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bowei","download_url":"https://codeload.github.com/bowei/gce-gen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowei%2Fgce-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33037047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T17:05:03.108Z","updated_at":"2026-05-14T18:04:24.561Z","avatar_url":"https://github.com/bowei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCE Cloud adapter\n\nPackage cloud implements a more golang friendly interface to the GCE compute\nAPI. The code in this package is generated automatically via the generator\nimplemented in \"gen/main.go\".  The code generator creates the basic CRUD\nactions for the given resource: \"Insert\", \"Get\", \"List\" and \"Delete\".\nAdditional methods by customizing the ServiceInfo object (see below).\nGenerated code includes a full mock of the GCE compute API.\n\n## Usage\n\nThe root of the GCE compute API is the interface \"Cloud\". Code written using\nCloud can be used against the actual implementation \"GCE\" or \"MockGCE\".\n\n```\n func foo(cloud Cloud) {\n   igs, err := cloud.InstanceGroups().List(ctx, \"us-central1-b\")\n   ...\n }\n // Run foo against the actual cloud.\n foo(NewGCE(\u0026Service{...}))\n // Run foo with a mock.\n foo(NewMockGCE())\n```\n\n## Rate limiting and routing\n\nThe generated code allows for custom policies for operation rate limiting\nand GCE project routing. See RateLimiter and ProjectRouter for more details.\n\n## Mocks\n\nMocks are automatically generated for each type implementing basic logic for\nresource manipulation. This eliminates the boilerplate required to mock GCE\nfunctionality. Each method has a corresponding \"xxxHook\" function generated in\nthe mock structure where unit test code can hook the execution of the method.\n\n## Changing service code generation\n\nThe list of services to generate is contained in \"meta/meta.go\". To add a\nservice, add an entry to the list \"meta.AllServices\". An example entry:\n\n```\n \u0026ServiceInfo{\n   Object:      \"InstanceGroup\",   // Name of the object type.\n   Service:     \"InstanceGroups\",  // Name of the service.\n   version:     meta.VersionAlpha, // API version (one entry per version is needed).\n   keyType:     Zonal,             // What kind of resource this is.\n   serviceType: reflect.TypeOf(\u0026alpha.InstanceGroupsService{}), // Associated golang type.\n   additionalMethods: []string{    // Additional methods to generate code for.\n     \"SetNamedPorts\",\n   },\n   options: \u003coptions\u003e              // Or'd (\"|\") together.\n }\n```\n\n## Read-only objects\n\nServices such as Regions and Zones do not allow for mutations. Specify\n\"ReadOnly\" in ServiceInfo.options to omit the mutation methods.\n\n## Adding custom methods\n\nSome methods that may not be properly handled by the generated code. To enable\naddition of custom code to the generated mocks, set the \"CustomOps\" option\nin \"meta.ServiceInfo\" entry. This will make the generated service interface\nembed a \"\u003cServiceName\u003eOps\" interface. This interface MUST be written by hand\nand contain the custom method logic. Corresponding methods must be added to\nthe corresponding Mockxxx and GCExxx struct types.\n\n```\n // In \"meta/meta.go\":\n \u0026ServiceInfo{\n   Object: \"InstanceGroup\",\n   ...\n   options: CustomOps,\n }\n\n // In the generated code \"gen.go\":\n type InstanceGroups interface {\n   InstanceGroupsOps // Added by CustomOps option.\n   ...\n }\n\n // In hand written file:\n type InstanceGroupsOps interface {\n   MyMethod()\n }\n\n func (mock *MockInstanceGroups) MyMethod() {\n   // Custom mock implementation.\n }\n\n func (gce *GCEInstanceGroups) MyMethod() {\n   // Custom implementation.\n }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowei%2Fgce-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbowei%2Fgce-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowei%2Fgce-gen/lists"}