diff --git a/.github/workflows/nightly_tests.yaml b/.github/workflows/nightly_tests.yaml deleted file mode 100644 index 36211b429..000000000 --- a/.github/workflows/nightly_tests.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Go nightly build -on: - workflow_dispatch: - schedule: - - cron: '0 2 * * *' -jobs: - test_client: - runs-on: ${{ matrix.os }} - name: Run tests of master on ${{ matrix.os }} with Go ${{ matrix.go_version }} - if: github.repository == 'hazelcast/hazelcast-go-client' - strategy: - matrix: - os: [ ubuntu-latest ] - go_version: [ 1.17, 1.18, 1.20, 1.22 ] - fail-fast: false - steps: - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '17' - - - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go_version }} - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Test - env: - HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} - HZ_VERSION: 5.1 - ENABLE_SSL: 1 - MEMBER_COUNT: 3 - run: | - ./rc.sh start - go mod tidy - make test-cover diff --git a/.github/workflows/test-all-32bits.yaml b/.github/workflows/test-all-32bits.yaml deleted file mode 100644 index 57b71c2c4..000000000 --- a/.github/workflows/test-all-32bits.yaml +++ /dev/null @@ -1,50 +0,0 @@ - -name: "Test Go Client - 32bit" -on: ["push", "pull_request"] -jobs: - test: - runs-on: "ubuntu-latest" - env: - GOPATH: "${{ github.workspace }}" - HZ_VERSION: "5.1" - defaults: - run: - shell: "bash" - working-directory: "$HOME/hazelcast-go-client" - steps: - - name: "Checkout Code" - uses: "actions/checkout@v2" - with: - path: "$HOME/hazelcast-go-client" - - - name: "Install Dependencies" - run: | - sudo apt-get update &&\ - sudo apt-get install -y openjdk-17-jdk-headless maven - - - name: "Start Hazelcast Remote Controller" - run: | - bash ./rc.sh start - sleep 2 - - - name: "Setup Go" - uses: "actions/setup-go@v2" - with: - go-version: "1.17" - - - name: "Install Go tools" - run: | - go install golang.org/x/tools/...@v0.1.11 - go install honnef.co/go/tools/cmd/staticcheck@2022.1.2 - - - name: "Go mod tidy" - run: | - go mod tidy - - - name: "Run Checkers" - run: | - make check - - - name: "Run All Tests" - run: | - GOARCH=386 make test-all diff --git a/.github/workflows/test-all.yaml b/.github/workflows/test-all.yaml deleted file mode 100644 index 62bd543eb..000000000 --- a/.github/workflows/test-all.yaml +++ /dev/null @@ -1,50 +0,0 @@ - -name: "Test Go Client" -on: ["push", "pull_request"] -jobs: - test: - runs-on: "ubuntu-latest" - env: - GOPATH: "${{ github.workspace }}" - HZ_VERSION: "5.1" - defaults: - run: - shell: "bash" - working-directory: "$HOME/hazelcast-go-client" - steps: - - name: "Checkout Code" - uses: "actions/checkout@v2" - with: - path: "$HOME/hazelcast-go-client" - - - name: "Install Dependencies" - run: | - sudo apt-get update &&\ - sudo apt-get install -y openjdk-17-jdk-headless maven - - - name: "Start Hazelcast Remote Controller" - run: | - bash ./rc.sh start - sleep 2 - - - name: "Setup Go" - uses: "actions/setup-go@v2" - with: - go-version: "1.17" - - - name: "Install Go tools" - run: | - go install golang.org/x/tools/...@v0.6.0 - go install honnef.co/go/tools/cmd/staticcheck@v0.3.3 - - - name: "Go mod tidy" - run: | - go mod tidy - - - name: "Run Checkers" - run: | - make check - - - name: "Run All Tests" - run: | - make test-all diff --git a/.github/workflows/test-race.yaml b/.github/workflows/test-race.yaml index e3633dccb..19f0c4ca6 100644 --- a/.github/workflows/test-race.yaml +++ b/.github/workflows/test-race.yaml @@ -18,28 +18,12 @@ jobs: - name: "Install Dependencies" run: | - sudo apt-get update &&\ - sudo apt-get install -y openjdk-17-jdk-headless maven + sudo apt-get update - - name: "Start Hazelcast Remote Controller" - run: | - bash ./rc.sh start - sleep 2 - - - name: "Setup Go" - uses: "actions/setup-go@v2" - with: - go-version: "1.18" + java --version + type -a java - - name: "Install Go tools" - run: | - go install golang.org/x/tools/...@v0.1.11 - go install honnef.co/go/tools/cmd/staticcheck@2022.1.2 + sudo apt-get install -y openjdk-17-jdk-headless - - name: "Go mod tidy" - run: | - go mod tidy - - - name: "Run Tests with Race Detection" - run: | - make test-race + java --version + type -a java \ No newline at end of file diff --git a/README.md b/README.md index 8f5c2ec8a..564908a57 100644 --- a/README.md +++ b/README.md @@ -1,159 +1 @@ -# Hazelcast Go Client - -[![Go Reference](https://pkg.go.dev/badge/github.com/hazelcast/hazelcast-go-client.svg)](https://pkg.go.dev/github.com/hazelcast/hazelcast-go-client) - -Hazelcast is an open-source distributed in-memory data store and computation platform that provides a wide variety of distributed data structures and concurrency primitives. - -Hazelcast Go client is a way to communicate with Hazelcast 4 and 5 clusters and access the cluster data. - -## Sample Code - -```go -package main - -import ( - "context" - "fmt" - "log" - - "github.com/hazelcast/hazelcast-go-client" -) - -func main() { - ctx := context.TODO() - // create the client and connect to the cluster on localhost - client, err := hazelcast.StartNewClient(ctx) - if err != nil { - log.Fatal(err) - } - // get a map - people, err := client.GetMap(ctx, "people") - if err != nil { - log.Fatal(err) - } - personName := "Jane Doe" - // set a value in the map - if err = people.Set(ctx, personName, 30); err != nil { - log.Fatal(err) - } - // get a value from the map - age, err := people.Get(ctx, personName) - if err != nil { - log.Fatal(err) - } - fmt.Printf("%s is %d years old.\n", personName, age) - // stop the client to release resources - client.Shutdown(ctx) -} -``` - -## Features - -* Distributed, partitioned and queryable in-memory key-value store implementation, called Map. -* Additional data structures and simple messaging constructs such as Replicated Map, MultiMap, Queue, List, PNCounter, Set, Topic and others. -* Support for serverless and traditional web service architectures with Unisocket and Smart operation modes. -* Go context support for all distributed data structures. -* SQL support (only on Hazelcast 5.x). -* External smart client discovery. -* Hazelcast Management Center integration. -* Ability to listen to client lifecycle, cluster state, and distributed data structure events. -* And [more](https://hazelcast.com/clients/go/#client-features)... - -## Install - -Requirements: - -* Hazelcast Go client is compatible only with Hazelcast 4.x and 5.x. -* We support two most recent releases of Go, currently 1.17 and up. - -In your Go module enabled project, add a dependency to `github.com/hazelcast/hazelcast-go-client`: -```shell -# Depend on the latest release -$ go get github.com/hazelcast/hazelcast-go-client@latest -``` - -## Quick Start - -Hazelcast Go client requires a working Hazelcast cluster. - -Check out our [Get Started](https://hazelcast.com/get-started/) page for options. - -### Starting the Default Client - -Start the client with the default Hazelcast host and port using `hazelcast.StartNewClient`, when Hazelcast is running on local with the default options: - -```go -ctx := context.TODO() -client, err := hazelcast.StartNewClient(ctx) -// handle client start error -``` - -### Starting the Client with Given Options - -Note that `Config` structs are not thread-safe. Complete creation of the configuration in a single goroutine. - -```go -// create the default configuration -config := hazelcast.Config{} -// optionally set member addresses manually -config.Cluster.Network.SetAddresses("member1.example.com:5701", "member2.example.com:5701") -// create and start the client with the configuration provider -client, err := hazelcast.StartNewClientWithConfig(ctx, config) -// handle client start error -``` - -## Documentation - -Hazelcast Go Client documentation is hosted at [pkg.go.dev](https://pkg.go.dev/github.com/hazelcast/hazelcast-go-client). - -You can view the documentation locally by using godoc: -``` -$ godoc -http=localhost:5500 -``` - -godoc is not installed by default with the base Go distribution. Install it using: -``` -$ go get -u golang.org/x/tools/...` -``` - -## Support - -Join us at [Go Client channel](https://hazelcastcommunity.slack.com/channels/go-client) or [Hazelcast at Google Groups](https://groups.google.com/g/hazelcast). - -## Running the tests - -Currently, we support only Linux, MacOS and WSL (Windows Subsystem for Linux) for testing the client. - -You need to have the following installed in order to run integration tests: -* Java 8 -* Maven 3 or better -* Bash -* Make - -Before running the tests, starts Hazelcast Remote Controller, which enables the test suite to create clusters: -```shell -# Start RC with Hazelcast Community features -$ ./rc.sh start - -# Or, start RC with Hazelcast Enterprise features -$ HAZELCAST_ENTERPRISE_KEY=ENTERPRISE-KEY-HERE ./rc.sh start -``` - -You can run the tests using one of the following approaches: -* Run `make test-all` to run integration tests. -* Run `make test-all-race` to run integration tests with race detection. -* Run `make test-cover` to generate the coverage report and `make view-cover` to view the test coverage summary and generate an HTML report. - -Testing the client with SSL support requires running the remote controller with Hazelcast Enterprise features. -To enable SSL connections, add `ENABLE_SSL=1` to environment variables, or prepend it to the make commands above. - -In order to turn on verbose logging, add `ENABLE_TRACE=1` to environment variables, or prepend it to the make commands above. - -## License - -[Apache 2 License](https://github.com/hazelcast/hazelcast-go-client/blob/master/LICENSE). - -Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. - -Visit [www.hazelcast.com](http://www.hazelcast.com) for more information. - +Dummy PR change