{"id":14988348,"url":"https://github.com/apache/openwhisk-client-go","last_synced_at":"2025-05-16T13:08:01.307Z","repository":{"id":16002782,"uuid":"73428254","full_name":"apache/openwhisk-client-go","owner":"apache","description":"Go client library for the Apache OpenWhisk platform","archived":false,"fork":false,"pushed_at":"2025-03-09T04:21:27.000Z","size":371,"stargazers_count":37,"open_issues_count":21,"forks_count":46,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-05-08T15:32:23.425Z","etag":null,"topics":["apache","cloud","faas","functions-as-a-service","openwhisk","serverless","serverless-architectures","serverless-functions"],"latest_commit_sha":null,"homepage":"https://openwhisk.apache.org/","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/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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}},"created_at":"2016-11-10T23:02:42.000Z","updated_at":"2025-03-09T04:21:31.000Z","dependencies_parsed_at":"2023-01-13T18:39:31.649Z","dependency_job_id":"c6d59841-7cc4-4a4f-bee9-886c3230908e","html_url":"https://github.com/apache/openwhisk-client-go","commit_stats":{"total_commits":172,"total_committers":36,"mean_commits":4.777777777777778,"dds":0.8255813953488372,"last_synced_commit":"32c4c3c81aac6c1edf2a92f40e34ff803b621faa"},"previous_names":["apache/incubator-openwhisk-client-go"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/openwhisk-client-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"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":["apache","cloud","faas","functions-as-a-service","openwhisk","serverless","serverless-architectures","serverless-functions"],"created_at":"2024-09-24T14:16:34.594Z","updated_at":"2025-05-16T13:08:01.286Z","avatar_url":"https://github.com/apache.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n--\u003e\n\n# Openwhisk Client Go\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Continuous Integration](https://github.com/apache/openwhisk-client-go/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-client-go/actions/workflows/ci.yaml)\n\nThis project `openwhisk-client-go` is a Go client library to access the Openwhisk API.\n\n---\n\n## Building the project\n\n### Prerequisites\n\nThe Openwhisk Go Client library requires you to [Download and install GoLang](https://golang.org/dl/) onto your local machine.\n\nMake sure you select the package that fits your local environment, and [set the GOPATH environment variable](https://go.dev/wiki/SettingGOPATH).\n\n### Download the source code from GitHub\n\nAs the code is managed using GitHub, it is easiest to retrieve the code using the `git clone` command.\n\nIf you just want to build the code and do not intend to be a Contributor, you can clone the latest code from the Apache repository:\n\n```sh\ngit clone git@github.com:apache/openwhisk-client-go\n```\n\nYou can also specify a release (tag), if you do not want the latest code, by using the `--branch \u003ctag\u003e` flag. For example, you can clone the source code for the tagged 1.1.0 [release](https://github.com/apache/openwhisk-client-go/releases)\n\n```sh\ngit clone --branch 1.1.0 git@github.com:apache/openwhisk-client-go\n```\n\nYou can also pull the code from a fork of the repository. If you intend to become a Contributor to the project, read the section [Contributing to the project](#contributing-to-the-project) below on how to setup a fork.\n\n### Building using `go build`\n\nChange into the cloned project directory and use the following command to build all packages:\n\n```sh\n$ go build -v ./...\n```\n\nor simply build just the whisk commands:\n\n```sh\n$ go build -v ./whisk\n```\n\n\u003e **Note**: There is no `main` function in this project as the `./whisk` packages are treated together as a client library.\n\n### Testing using `go test`\n\nOpen a terminal, change into the project directory and use the following command to run the unit tests:\n\n```sh\n$ go test -v ./... -tags=unit\n```\n\nYou should see all the unit tests passed; if not, please [log an issue](https://github.com/apache/openwhisk-client-go/issues) for us.\n\n---\n\n## Configuration\n\nThis Go client library is used to access the OpenWhisk API, so please make sure you have an OpenWhisk service running somewhere\navailable for you to run this library.\n\nWe use a configuration file called _wskprop_ to specify all the parameters necessary for this Go client library to access the OpenWhisk services. Make sure you create or edit the file _~/.wskprops_, and add the mandatory parameters APIHOST, APIVERSION, NAMESPACE and AUTH.\n\n- The parameter `APIHOST` is the OpenWhisk API hostname.\n    - If you are using a local [quick start standalone](https://github.com/apache/openwhisk#quick-start), OpenWhisk services APIHOST will look like `http://localhost:3233`\n    - If you are using IBM cloud functions as your provider, APIHOST will look like `\u003cregion\u003e.functions.cloud.ibm.com` where region can be `us-east`, `us-south` or any additional [regions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-cloudfunctions_regions)\n\n- The parameter `APIVERSION` is the version of OpenWhisk API to be used to access the OpenWhisk resources.\n- The parameter `NAMESPACE` is the OpenWhisk namespace used to specify the OpenWhisk resources about to be accessed.\n- The parameter `AUTH` is the authentication key used to authenticate the incoming requests to the OpenWhisk services.\n\nFor more information regarding the REST API of OpenWhisk, please refer to [OpenWhisk REST API](https://github.com/apache/openwhisk/blob/master/docs/rest_api.md).\n\n## Usage\n\n```go\nimport \"github.com/apache/openwhisk-client-go/whisk\"\n```\n\nConstruct a new whisk client, then use various services to access different parts of the whisk api.  For example to get the `hello` package actions:\n\n```go\nclient, _ := whisk.NewClient(http.DefaultClient, nil)\nactions, resp, err := client.Actions.List(\"hello\", nil)\n```\n\nSome API methods have optional parameters that can be passed. For example, to list the first 10 actions of the `hello` package:\n```go\nclient, _ := whisk.NewClient(http.DefaultClient, nil)\n\noptions := \u0026whisk.ActionListOptions{\n  Limit: 10,\n  Skip: 0,\n}\n\nactions, resp, err := client.Actions.List(\"hello\", options)\n```\n\nBy default, this Go client library is automatically configured by the configuration file _wskprop_. The parameters of APIHOST, APIVERSION,\nNAMESPACE and AUTH will be used to access the OpenWhisk services.\n\nIn addition, it can also be configured by passing in a `*whisk.Config` object as the second argument to `whisk.New( ... )`.  For example:\n\n```go\nconfig := \u0026whisk.Config{\n  Host: \"\u003cAPIHOST\u003e\",\n  Version: \"\u003cAPIVERSION\u003e\",\n  Namespace: \"\u003cNAMESPACE\u003e\",\n  AuthToken: \"\u003cAUTH\u003e\",\n}\nclient, err := whisk.Newclient(http.DefaultClient, config)\n```\n\n### Example\n\nYou need to have an OpenWhisk service accessible, to run the following [example](https://github.com/apache/openwhisk-client-go/blob/master/example/example_list_actions.go).\n\n```go\npackage main\n\nimport (\n  \"os\"\n  \"fmt\"\n  \"net/http\"\n\n  \"github.com/apache/openwhisk-client-go/whisk\"\n)\n\nfunc main() {\n  client, err := whisk.NewClient(http.DefaultClient, nil)\n  if err != nil {\n    fmt.Println(err)\n    os.Exit(-1)\n  }\n\n  options := \u0026whisk.ActionListOptions{\n    Limit: 10,\n    Skip: 0,\n  }\n\n  actions, resp, err := client.Actions.List(\"\", options)\n  if err != nil {\n    fmt.Println(err)\n    os.Exit(-1)\n  }\n\n  fmt.Println(\"Returned with status: \", resp.Status)\n  fmt.Printf(\"Returned actions: \\n%+v\", actions)\n\n}\n```\n\nThen run it with the `go` tool:\n\n```\n$ cd example\n$ go run example_list_actions.go\n```\n\nIf the openWhisk service is available and your configuration is correct, you should receive the status and the actions with the above example.\n\n---\n\n## Contributing to the project\n\n### Git repository setup\n\n1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the Apache repository\n\n    If you intend to contribute code, you will want to fork the `apache/openwhisk-client-go` repository into your github account and use that as the source for your clone.\n\n2. Clone the repository from your fork:\n\n    ```sh\n    git clone git@github.com:${GITHUB_ACCOUNT_USERNAME}/openwhisk-client-go.git\n    ```\n\n3. Add the Apache repository as a remote with the `upstream` alias:\n\n    ```sh\n    git remote add upstream git@github.com:apache/openwhisk-client-go\n    ```\n\n    You can now use `git push` to push local `commit` changes to your `origin` repository and submit pull requests to the `upstream` project repository.\n\n4. Optionally, prevent accidental pushes to `upstream` using this command:\n\n    ```sh\n    git remote set-url --push upstream no_push\n    ```\n\n\u003e Be sure to [Sync your fork](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) before starting any contributions to keep it up-to-date with the upstream repository.\n\n### Adding new dependencies\n\nPlease use `go get` to add new dependencies to the `go.mod` file:\n\n```sh\ngo get -u github.com/project/libname@v1.2.0\n```\n\n\u003e Please avoid using commit hashes for referencing non-OpenWhisk libraries.\n\n### Updating dependency versions\n\nAlthough you might be tempted to edit the go.mod file directly, please use the recommended method of using the `go get` command:\n\n```sh\ngo get -u github.com/project/libname  # Using \"latest\" version\ngo get -u github.com/project/libname@v1.1.0 # Using tagged version\ngo get -u github.com/project/libname@aee5cab1c  # Using a commit hash\n```\n\n### Updating Go version\n\nAlthough you could edit the version directly in the go.mod file, it is better to use the `go edit` command:\n\n```sh\ngo mod edit -go=1.NN\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fopenwhisk-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-client-go/lists"}