{"id":26514887,"url":"https://github.com/devcyclehq/go-server-sdk","last_synced_at":"2025-03-21T05:29:42.077Z","repository":{"id":37589037,"uuid":"431606638","full_name":"DevCycleHQ/go-server-sdk","owner":"DevCycleHQ","description":"DevCycle - Go Server SDK","archived":false,"fork":false,"pushed_at":"2025-03-19T14:46:01.000Z","size":20721,"stargazers_count":19,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-19T15:30:00.549Z","etag":null,"topics":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"latest_commit_sha":null,"homepage":"https://docs.devcycle.com/","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/DevCycleHQ.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":"2021-11-24T19:35:11.000Z","updated_at":"2025-03-19T14:46:04.000Z","dependencies_parsed_at":"2024-05-13T14:40:59.195Z","dependency_job_id":"bd72a627-2173-4c93-9828-b3cf5201f37f","html_url":"https://github.com/DevCycleHQ/go-server-sdk","commit_stats":{"total_commits":242,"total_committers":24,"mean_commits":"10.083333333333334","dds":0.756198347107438,"last_synced_commit":"616be375c81f211e53149a47eecc544e1d2e253c"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fgo-server-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fgo-server-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fgo-server-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fgo-server-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevCycleHQ","download_url":"https://codeload.github.com/DevCycleHQ/go-server-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745189,"owners_count":20503040,"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":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"created_at":"2025-03-21T05:29:41.358Z","updated_at":"2025-03-21T05:29:42.066Z","avatar_url":"https://github.com/DevCycleHQ.png","language":"Go","readme":"# DevCycle Go Server SDK.\n\nThis SDK supports both cloud bucketing (requests outbound to https://bucketing-api.devcycle.com) as well as local bucketing (requests to a local bucketing engine self-contained in this SDK).\n\n## Installation\n\n```bash\ngo get \"github.com/devcyclehq/go-server-sdk/v2\"\n```\n\n```golang\npackage main\nimport \"github.com/devcyclehq/go-server-sdk/v2\"\n```\n\n## Getting Started\n\n```golang\n    sdkKey := os.Getenv(\"DEVCYCLE_SERVER_SDK_KEY\")\n\tuser := devcycle.User{UserId: \"test\"}\n\n\toptions := devcycle.Options{\n\t\tEnableEdgeDB:                 false,\n\t\tEnableCloudBucketing:         false,\n\t\tEventFlushIntervalMS:         0,\n\t\tConfigPollingIntervalMS:      10 * time.Second,\n\t\tRequestTimeout:               10 * time.Second,\n\t\tDisableAutomaticEventLogging: false,\n\t\tDisableCustomEventLogging:    false,\n\t}\n\n\tclient, _ := devcycle.NewClient(sdkKey, \u0026options)\n```\n\n## Usage\n\nTo find usage documentation, visit our [docs](https://docs.devcycle.com/docs/sdk/server-side-sdks/go#usage).\n\n## Testing\n\nThis SDK is supported by our [test harness](https://github.com/DevCycleHQ/test-harness), a test suite shared between all DevCycle SDKs for consistency.\n\nUnit tests can be run with the standard Go testing tools, or with `make test`. They are run automatically on PRs with the [Go race detector](https://go.dev/doc/articles/race_detector) enabled. To reproduce this locally, run with `RACE=1 make test`. Some race detector errors might only show up on Github actions due to differences in how quickly tests are executed.\n\n## Configuration\n\nConfiguration of the SDK is done through the `Options` struct.\n\n## Logging\n\nBy default, logging is disabled to avoid overhead and noise in your logs. To enable it for debugging the SDK, set the `devcycle_debug_logging` build tag when compiling your project:\n```\ngo build -tags devcycle_debug_logging ...\n```\n\n### Cloud Bucketing\n\nThe following options are available when you are using the SDK in Cloud Bucketing mode.\n\n| Option | Type          | Description                                                                                                                               | Default |\n| --- |---------------|-------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| EnableCloudBucketing | bool          | Sets the SDK to Cloud Bucketing mode                                                                                                      | false   |\n| EnableEdgeDB | bool          | Turns on EdgeDB support for Cloud Bucketing                                                                                               | false   |\n| BucketingAPIURI | string        | The base URI for communicating with the DevCycle Cloud Bucketing service. Can be set if you need to proxy traffic through your own server | https://bucketing-api.devcycle.com        |\n| Logger | util.Logger   | Allows you to set a custom logger to manage output from the SDK. The default logger will write to stdout and stderr                       | nil     |\n\n### Local Bucketing\n\nThe following options are available when you are using the SDK in Local Bucketing mode.\n\n| Option                       | Type           | Description                                                                                                                                                                                                                     | Default    |\n|------------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|\n| OnInitializedChannel         | chan bool      | A callback channel to get notified when the SDK is fully initialized and ready to use                                                                                                                                           | nil        |\n| EventFlushIntervalMS         | time.Duration  | How frequently events are flushed to the backend. \u003cbr\u003e*value must be between 500ms and 60s*                                                                                                                                     | 30000      |\n| ConfigPollingIntervalMS      | time.Duration  | How frequently the SDK will attempt to reload the feature config. \u003cbr\u003e*value must be \u003e 1s*                                                                                                                                      | 10000      |\n| RequestTimeout               | time.Duration  | Maximum time to spend retrieving project configurations. \u003cbr\u003e*value must be \u003e 5s*                                                                                                                                               | 5000       |\n| DisableAutomaticEventLogging | bool           | Turn off tracking of automated variable events                                                                                                                                                                                  | false      |\n| DisableCustomEventLogging    | bool           | Turns off tracking of custom events submitted via the client.Track()                                                                                                                                                            | false      |\n| MaxEventQueueSize            | int            | Maximum size of the event queue before new events get dropped. Higher values can impact memory usage of the SDK. \u003cbr\u003e*value must be \u003e 0 and \u003c= 50000.*                                                                          | 10000      |\n| FlushEventQueueSize          | int            | Maximum size of the queue used to prepare events for submission to DevCycle. Higher values can impact memory usage of the SDK. \u003cbr\u003e*value must be \u003e 0 and \u003c= 50000.*                                                            | 1000       | |\n| ConfigCDNURI                 | string         | The base URI for retrieving your project configuration from DevCycle. Can be set if you need to proxy traffic through your own server                                                                                           | https://config-cdn.devcycle.com           |\n| EventsAPIURI                 | string         | The base URI for sending events to DevCycle for analytics tracking. Can be set if you need to proxy traffic through your own server                                                                                             | https://events.devcycle.com           |\n| Logger                       | util.Logger    | Allows you to set a custom logger to manage output from the SDK. The default logger will write to stdout and stderr                                                                                                             | nil        |\n# OpenFeature Support\n\nThis SDK provides an implementation of the [OpenFeature](https://openfeature.dev/) Provider interface. Use the `OpenFeatureProvider()` method on the DevCycle SDK client to obtain a provider for OpenFeature.\n\n```go\ndevcycleClient, err := devcycle.NewClient(\"DEVCYCLE_SERVER_SDK_KEY\", \u0026options)\nerr = openfeature.SetProvider(devcycleClient.OpenFeatureProvider())\n```\n\n- [The DevCycle Go OpenFeature Provider](https://docs.devcycle.com/sdk/server-side-sdks/go/go-openfeature)\n- [The OpenFeature documentation](https://openfeature.dev/docs/reference/intro)\n\n## Linting\n\nWe run golangci/golangci-lint on every PR to catch common errors. You can run the linter locally via the Makefile with:\n```\nmake lint\n```\n\nLint failures on PRs will show comments on the \"Files changed\" tab inline with the code, not on the main Conversation tab.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fgo-server-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcyclehq%2Fgo-server-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fgo-server-sdk/lists"}