{"id":44508499,"url":"https://github.com/flagright/flagright-go","last_synced_at":"2026-06-16T00:01:22.721Z","repository":{"id":285195253,"uuid":"957333254","full_name":"flagright/flagright-go","owner":"flagright","description":"The Flagright Go library provides access to the Flagright API from Golang. ","archived":false,"fork":false,"pushed_at":"2026-04-01T19:32:32.000Z","size":440,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-03T06:49:44.714Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flagright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-30T05:09:07.000Z","updated_at":"2026-04-01T19:32:33.000Z","dependencies_parsed_at":"2025-05-21T05:25:06.048Z","dependency_job_id":"e2eb71eb-567e-4f78-b4be-3bba1cd6733d","html_url":"https://github.com/flagright/flagright-go","commit_stats":null,"previous_names":["flagright/flagright-go"],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/flagright/flagright-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flagright%2Fflagright-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flagright%2Fflagright-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flagright%2Fflagright-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flagright%2Fflagright-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flagright","download_url":"https://codeload.github.com/flagright/flagright-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flagright%2Fflagright-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34385031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":"2026-02-13T12:33:54.598Z","updated_at":"2026-06-16T00:01:22.704Z","avatar_url":"https://github.com/flagright.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flagright Go Library\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=readme\u0026utm_source=https%3A%2F%2Fgithub.com%2Fflagright%2Fflagright-go)\n\nThe Flagright Go library provides convenient access to the Flagright APIs from Go.\n\n## Table of Contents\n\n- [Reference](#reference)\n- [Usage](#usage)\n- [Environments](#environments)\n- [Errors](#errors)\n- [Request Options](#request-options)\n- [Advanced](#advanced)\n  - [Response Headers](#response-headers)\n  - [Retries](#retries)\n  - [Timeouts](#timeouts)\n  - [Explicit Null](#explicit-null)\n- [Contributing](#contributing)\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/flagright/flagright-go/blob/HEAD/./reference.md).\n\n## Usage\n\nInstantiate and use the client with the following:\n\n```go\npackage example\n\nimport (\n    context \"context\"\n\n    flagrightgo \"github.com/flagright/flagright-go\"\n    client \"github.com/flagright/flagright-go/client\"\n    option \"github.com/flagright/flagright-go/option\"\n)\n\nfunc do() {\n    client := client.NewClient(\n        option.WithApiKey(\n            \"\u003cvalue\u003e\",\n        ),\n    )\n    request := \u0026flagrightgo.TransactionsVerifyRequest{\n        ValidateOriginUserId: flagrightgo.BooleanStringTrue.Ptr(),\n        ValidateDestinationUserId: flagrightgo.BooleanStringTrue.Ptr(),\n        Body: \u0026flagrightgo.Transaction{\n            Type: \"DEPOSIT\",\n            TransactionId: \"7b80a539eea6e78acbd6d458e5971482\",\n            Timestamp: 1641654664000,\n            OriginUserId: flagrightgo.String(\n                \"8650a2611d0771cba03310f74bf6\",\n            ),\n            DestinationUserId: flagrightgo.String(\n                \"9350a2611e0771cba03310f74bf6\",\n            ),\n            OriginAmountDetails: \u0026flagrightgo.TransactionAmountDetails{\n                TransactionAmount: 2000,\n                TransactionCurrency: flagrightgo.CurrencyCodeEur,\n                Country: flagrightgo.CountryCodeDe.Ptr(),\n            },\n            DestinationAmountDetails: \u0026flagrightgo.TransactionAmountDetails{\n                TransactionAmount: 68351.34,\n                TransactionCurrency: flagrightgo.CurrencyCodeInr,\n                Country: flagrightgo.CountryCodeIn.Ptr(),\n            },\n            OriginPaymentDetails: \u0026flagrightgo.TransactionOriginPaymentDetails{\n                Card: \u0026flagrightgo.CardDetails{\n                    CardFingerprint: flagrightgo.String(\n                        \"20ac00fed8ef913aefb17cfae1097cce\",\n                    ),\n                    CardIssuedCountry: flagrightgo.CountryCodeTr.Ptr(),\n                    TransactionReferenceField: flagrightgo.String(\n                        \"Deposit\",\n                    ),\n                    Field3DsDone: flagrightgo.Bool(\n                        true,\n                    ),\n                },\n            },\n            DestinationPaymentDetails: \u0026flagrightgo.TransactionDestinationPaymentDetails{\n                Card: \u0026flagrightgo.CardDetails{\n                    CardFingerprint: flagrightgo.String(\n                        \"20ac00fed8ef913aefb17cfae1097cce\",\n                    ),\n                    CardIssuedCountry: flagrightgo.CountryCodeTr.Ptr(),\n                    TransactionReferenceField: flagrightgo.String(\n                        \"Deposit\",\n                    ),\n                    Field3DsDone: flagrightgo.Bool(\n                        true,\n                    ),\n                },\n            },\n            PromotionCodeUsed: flagrightgo.Bool(\n                true,\n            ),\n            Reference: flagrightgo.String(\n                \"loan repayment\",\n            ),\n            OriginDeviceData: \u0026flagrightgo.DeviceData{\n                BatteryLevel: flagrightgo.Float64(\n                    95,\n                ),\n                DeviceLatitude: flagrightgo.Float64(\n                    13.0033,\n                ),\n                DeviceLongitude: flagrightgo.Float64(\n                    76.1004,\n                ),\n                IpAddress: flagrightgo.String(\n                    \"10.23.191.2\",\n                ),\n                DeviceIdentifier: flagrightgo.String(\n                    \"3c49f915d04485e34caba\",\n                ),\n                VpnUsed: flagrightgo.Bool(\n                    false,\n                ),\n                OperatingSystem: flagrightgo.String(\n                    \"Android 11.2\",\n                ),\n                DeviceMaker: flagrightgo.String(\n                    \"ASUS\",\n                ),\n                DeviceModel: flagrightgo.String(\n                    \"Zenphone M2 Pro Max\",\n                ),\n                DeviceYear: flagrightgo.String(\n                    \"2018\",\n                ),\n                AppVersion: flagrightgo.String(\n                    \"1.1.0\",\n                ),\n            },\n            DestinationDeviceData: \u0026flagrightgo.DeviceData{\n                BatteryLevel: flagrightgo.Float64(\n                    95,\n                ),\n                DeviceLatitude: flagrightgo.Float64(\n                    13.0033,\n                ),\n                DeviceLongitude: flagrightgo.Float64(\n                    76.1004,\n                ),\n                IpAddress: flagrightgo.String(\n                    \"10.23.191.2\",\n                ),\n                DeviceIdentifier: flagrightgo.String(\n                    \"3c49f915d04485e34caba\",\n                ),\n                VpnUsed: flagrightgo.Bool(\n                    false,\n                ),\n                OperatingSystem: flagrightgo.String(\n                    \"Android 11.2\",\n                ),\n                DeviceMaker: flagrightgo.String(\n                    \"ASUS\",\n                ),\n                DeviceModel: flagrightgo.String(\n                    \"Zenphone M2 Pro Max\",\n                ),\n                DeviceYear: flagrightgo.String(\n                    \"2018\",\n                ),\n                AppVersion: flagrightgo.String(\n                    \"1.1.0\",\n                ),\n            },\n            Tags: []*flagrightgo.Tag{\n                \u0026flagrightgo.Tag{\n                    Key: \"customKey\",\n                    Value: \"customValue\",\n                },\n            },\n        },\n    }\n    client.Transactions.Verify(\n        context.TODO(),\n        request,\n    )\n}\n```\n\n## Environments\n\nYou can choose between different environments by using the `option.WithBaseURL` option. You can configure any arbitrary base\nURL, which is particularly useful in test environments.\n\n```go\nclient := client.NewClient(\n    option.WithBaseURL(api.Environments.SandboxApiServerEu1),\n)\n```\n\n## Errors\n\nStructured error types are returned from API calls that return non-success status codes. These errors are compatible\nwith the `errors.Is` and `errors.As` APIs, so you can access the error like so:\n\n```go\nresponse, err := client.Transactions.Verify(...)\nif err != nil {\n    var apiError *core.APIError\n    if errors.As(err, apiError) {\n        // Do something with the API error ...\n    }\n    return err\n}\n```\n\n## Request Options\n\nA variety of request options are included to adapt the behavior of the library, which includes configuring\nauthorization tokens, or providing your own instrumented `*http.Client`.\n\nThese request options can either be\nspecified on the client so that they're applied on every request, or for an individual request, like so:\n\n\u003e Providing your own `*http.Client` is recommended. Otherwise, the `http.DefaultClient` will be used,\n\u003e and your client will wait indefinitely for a response (unless the per-request, context-based timeout\n\u003e is used).\n\n```go\n// Specify default options applied on every request.\nclient := client.NewClient(\n    option.WithToken(\"\u003cYOUR_API_KEY\u003e\"),\n    option.WithHTTPClient(\n        \u0026http.Client{\n            Timeout: 5 * time.Second,\n        },\n    ),\n)\n\n// Specify options for an individual request.\nresponse, err := client.Transactions.Verify(\n    ...,\n    option.WithToken(\"\u003cYOUR_API_KEY\u003e\"),\n)\n```\n\n## Advanced\n\n### Response Headers\n\nYou can access the raw HTTP response data by using the `WithRawResponse` field on the client. This is useful\nwhen you need to examine the response headers received from the API call. (When the endpoint is paginated,\nthe raw HTTP response data will be included automatically in the Page response object.)\n\n```go\nresponse, err := client.Transactions.WithRawResponse.Verify(...)\nif err != nil {\n    return err\n}\nfmt.Printf(\"Got response headers: %v\", response.Header)\nfmt.Printf(\"Got status code: %d\", response.StatusCode)\n```\n\n### Retries\n\nThe SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long\nas the request is deemed retryable and the number of retry attempts has not grown larger than the configured\nretry limit (default: 2).\n\nWhich status codes are retried depends on the `retryStatusCodes` generator configuration:\n\n**`legacy`** (current default): retries on\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)\n\n**`recommended`**: retries on\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)\n- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)\n- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)\n\nIf the `Retry-After` header is present in the response, the SDK will prioritize respecting its value exactly\nover the default exponential backoff.\n\nUse the `option.WithMaxAttempts` option to configure this behavior for the entire client or an individual request:\n\n```go\nclient := client.NewClient(\n    option.WithMaxAttempts(1),\n)\n\nresponse, err := client.Transactions.Verify(\n    ...,\n    option.WithMaxAttempts(1),\n)\n```\n\n### Timeouts\n\nSetting a timeout for each individual request is as simple as using the standard context library. Setting a one second timeout for an individual API call looks like the following:\n\n```go\nctx, cancel := context.WithTimeout(ctx, time.Second)\ndefer cancel()\n\nresponse, err := client.Transactions.Verify(ctx, ...)\n```\n\n### Explicit Null\n\nIf you want to send the explicit `null` JSON value through an optional parameter, you can use the setters\\\nthat come with every object. Calling a setter method for a property will flip a bit in the `explicitFields`\nbitfield for that setter's object; during serialization, any property with a flipped bit will have its\nomittable status stripped, so zero or `nil` values will be sent explicitly rather than omitted altogether:\n\n```go\ntype ExampleRequest struct {\n    // An optional string parameter.\n    Name *string `json:\"name,omitempty\" url:\"-\"`\n\n    // Private bitmask of fields set to an explicit value and therefore not to be omitted\n    explicitFields *big.Int `json:\"-\" url:\"-\"`\n}\n\nrequest := \u0026ExampleRequest{}\nrequest.SetName(nil)\n\nresponse, err := client.Transactions.Verify(ctx, request, ...)\n```\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nAdditions made directly to this library would have to be moved over to our generation code,\notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\na proof of concept, but know that we will not be able to merge it as-is. We suggest opening\nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflagright%2Fflagright-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflagright%2Fflagright-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflagright%2Fflagright-go/lists"}