{"id":20186082,"url":"https://github.com/hawapi/go-sdk","last_synced_at":"2025-03-03T06:44:13.488Z","repository":{"id":249215114,"uuid":"822841980","full_name":"HawAPI/go-sdk","owner":"HawAPI","description":"HawAPI SDK for Golang","archived":false,"fork":false,"pushed_at":"2024-07-19T21:20:12.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-13T18:16:36.195Z","etag":null,"topics":["api","api-sdk","hawapi","hawapi-go-sdk","hawapi-sdk","sdk","stranger-things"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/HawAPI/go-sdk","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/HawAPI.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":"2024-07-02T00:10:26.000Z","updated_at":"2024-07-20T00:21:57.000Z","dependencies_parsed_at":"2024-07-19T11:22:09.835Z","dependency_job_id":null,"html_url":"https://github.com/HawAPI/go-sdk","commit_stats":null,"previous_names":["hawapi/go-sdk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HawAPI%2Fgo-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HawAPI%2Fgo-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HawAPI%2Fgo-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HawAPI%2Fgo-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HawAPI","download_url":"https://codeload.github.com/HawAPI/go-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241622593,"owners_count":19992501,"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":["api","api-sdk","hawapi","hawapi-go-sdk","hawapi-sdk","sdk","stranger-things"],"created_at":"2024-11-14T03:15:55.926Z","updated_at":"2025-03-03T06:44:13.466Z","avatar_url":"https://github.com/HawAPI.png","language":"Go","readme":"# HawAPI - go-sdk\n\nHawAPI SDK for Golang\n\n- [API Docs](https://hawapi.theproject.id/docs/)\n- [SDK Docs](https://pkg.go.dev/github.com/HawAPI/go-sdk)\n\n## Topics\n\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Init client](#init-client)\n    - [Fetch information](#fetch-information)\n    - [Error handling](#error-handling)\n\n## Installation\n\n```\ngo get github.com/HawAPI/go-sdk/hawapi@latest\n```\n\n## Usage\n\n- [See examples](./_examples)\n\n### Init client\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/HawAPI/go-sdk/hawapi\"\n)\n\nfunc main() {\n    // Create a new client with default options\n    client := hawapi.NewClient()\n    \n    // Create client with custom options\n    client = hawapi.NewClientWithOpts(hawapi.Options{\n        Endpoint: \"http://localhost:8080/api\",\n        // When using 'WithOpts' or 'NewClientWithOpts' the value of\n        // 'UseInMemoryCache' will be set to false\n        UseInMemoryCache: true,\n        // Version\n        // Language\n        // Token\n        // ...\n    })\n\t\n    // You can also change the options later\n    client.WithOpts(hawapi.Options{\n        Language: \"pt-BR\",\n        // When using 'WithOpts' or 'NewClientWithOpts' the value of\n        // 'UseInMemoryCache' will be set to false\n        UseInMemoryCache: true,\n    })\n}\n```\n\n### Fetch information\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/HawAPI/go-sdk/hawapi\"\n)\n\nfunc main() {\n    client := hawapi.NewClient()\n    \n    res, err := client.ListActors()\n    if err != nil {\n        panic(err)\n    }\n    \n    fmt.Println(res)\n}\n```\n\n### Error handling\n\n- Check out the [hawapi.ErrorResponse](hawapi/error.go)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/HawAPI/go-sdk/hawapi\"\n\t\"github.com/google/uuid\"\n)\n\nfunc main() {\n    client := hawapi.NewClient()\n    \n    id, _ := uuid.Parse(\"\u003cunknown uuid\u003e\")\n    res, err := client.FindActor(id)\n    if err != nil {\n        // If the error is coming from the API request, \n        // it'll be of type hawapi.ErrorResponse.\n        if resErr, ok := err.(hawapi.ErrorResponse); ok {\n            fmt.Printf(\"API error %d Message: %s\\n\", resErr.Code, resErr.Message)\n        } else {\n            fmt.Println(\"SDK error:\", err)\n        }\n    }\n    \n    fmt.Println(res)\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawapi%2Fgo-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhawapi%2Fgo-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawapi%2Fgo-sdk/lists"}