{"id":22856614,"url":"https://github.com/deis/steward-framework","last_synced_at":"2025-04-30T15:12:27.600Z","repository":{"id":71905513,"uuid":"72029823","full_name":"deis/steward-framework","owner":"deis","description":"Go SDK for the Service Catalog Controller API","archived":false,"fork":false,"pushed_at":"2017-05-10T21:00:53.000Z","size":496,"stargazers_count":6,"open_issues_count":19,"forks_count":3,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-06-21T14:20:57.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deis.png","metadata":{"files":{"readme":"README-OLD.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":"2016-10-26T17:57:35.000Z","updated_at":"2018-12-09T18:24:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"9740d183-c043-4dc2-a366-c37eb49edbb2","html_url":"https://github.com/deis/steward-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deis%2Fsteward-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deis%2Fsteward-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deis%2Fsteward-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deis%2Fsteward-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deis","download_url":"https://codeload.github.com/deis/steward-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229510765,"owners_count":18084444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-12-13T08:09:09.959Z","updated_at":"2024-12-13T08:09:10.699Z","avatar_url":"https://github.com/deis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Steward Framework [![Build Status](https://travis-ci.org/deis/steward-framework.svg?branch=master)](https://travis-ci.org/deis/steward-framework)\n\nThis repository contains the Steward Framework for creating service catalog controllers.\n\nThe framework utilizes inversion of control, implementing all the core concerns of a service catalog controller, whilst delegating implementation-specific operations to the client library.\n\nThe framework implements all of the following concerns:\n\n* __Service catalog publishing:__ The framework publishes `servicecatalogentries` that reflect a backing service broker's offerings into the Kubernetes cluster. The query for the backing service broker's offerings is delegated to the backing service broker through the client library's implementation of the `framework.Cataloger` interface.\n\n* __Event and control loops:__ The framework watches the Kubernetes event stream for changes to `ServicePlanClaims`. Events that trigger discreet provision, bind, unbind, or deprovision actions delegate those operations to the backing service broker through the client library's implementation of the `framework.Lifecycler` interface.\n\n* __API server__: At this time, the API server implements only a health-check endpoint at `/healthz`.\n\n## Implementation guide\n\nUtilizing the Steward Framework to implement your own service catalog controller requires the following steps:\n\n1. Include the `github.com/deis/steward-framework` package in your project using your dependency management system of choice-- for example, [glide](https://github.com/masterminds/glide) or [godeps](https://github.com/tools/godep).\n\n2. Implement the `framework.Cataloger` and `framework.Lifecycler interfaces`. For your convenience, those interfaces are shown below:\n\n    ```go\n    type Cataloger interface {\n\n      List(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n      ) ([]*framework.Service, error)\n\n    }\n\n    type Lifecycler interface {\n\n      Provision(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n        req *framework.ProvisionRequest,\n      ) (*framework.ProvisionResponse, error)\n\n      Bind(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n        req *framework.BindRequest,\n      ) (*framework.BindResponse, error)\n\n      Unbind(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n        req *framework.UnbindRequest,\n      ) error\n\n      Deprovision(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n        req *framework.DeprovisionRequest,\n      ) (*framework.DeprovisionResponse, error)\n\n      GetOperationStatus(\n        ctx context.Context,\n        serviceBrokerSpec framework.ServiceBrokerSpec,\n        req *framework.OperationStatusRequest,\n      ) (*framework.OperationStatusResponse, error)\n\n    }\n\n    ```\n\n3. Import `github.com/deis/steward-framework/runner`\n\n4. In your `main()` function, call the blocking `runner.Run(...)`. For convenience, the signature of that function is shown below:\n\n    ```go\n    func Run(\n\t  cataloger framework.Cataloger,\n\t  lifecycler framework.Lifecycler,\n\t  maxAsyncDuration time.Duration,\n\t  apiPort int,\n    ) error\n    ```\n\n## Example code\n\nThe following annotated example is adapted from [steward-cf](https://github.com/deis/steward-cf):\n\n```go\nimport \"github.com/deis/steward-framework/runner\"\n\n// ...\n\nfunc main() {\n\n  // A configuration object is built from environment variables.\n  cfg := ...\n\n  // Relevant implementations of the framework.Cataloger and\n  // framework.Lifecycler interfaces are initialized.\n  cataloger, lifecycler := ...\n\n  // Configuration details, cataloger, and lifecycler are passed to runner.Run().\n  // The Steward Framework takes it from there. The call to runner.Run() will\n  // block infinitely or until the framework encounters a fatal error.\n  if err = runner.Run(\n    cataloger,\n    lifecycler,\n    cfg.getMaxAsyncDuration(),\n    cfg.APIPort,\n  ); err != nil {\n    logger.Criticalf(\"error running steward-framework: %s\", err)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeis%2Fsteward-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeis%2Fsteward-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeis%2Fsteward-framework/lists"}