Skip to content

Official Go client SDK for Iggy.rs message streaming.

License

Notifications You must be signed in to change notification settings

iggy-rs/iggy-go-client

Repository files navigation

Contributors Forks Stargazers Issues Go


iggy-go

SDK for iggy written using go language
View Samples · Report Bug · Request Feature · iggy documentation

About The Project

iggy-go is a golang SDK for iggy - persistent message streaming platform written in Rust.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

In order to use this SDK you need to install golang on your environment. Here's a link to official go documentation explaining how you can do that!

Installation

  1. Clone the repo
    git clone https://github.com/iggy-rs/iggy-go-client.git
  2. Verify that the solution builds correctly
    cd iggy-go
    go build

Usage (OBSOLETE; will be updated soon)

If you want to use this sdk as a CLI tool, you can do that by following these steps:

  1. Clone iggy repo and run it in background

    git clone https://github.com/iggy-rs/iggy.git
    cd iggy
    cargo r --bin iggy-server -r
  2. Open new terminal instance and enter iggy-go root folder

    cd iggy-go
  3. Run your command

    go run ./cli <commandname>

    You can run help command if you would like to see available commands:

      $ go run ./cli help
    
    Usage:
        getstream    -url <url> -port <port> -streamId <streamId>
        createstream -url <url> -port <port> -streamId <streamId> -name <name>
        deletestream -url <url> -port <port> -streamId <streamId>
        gettopic     -url <url> -port <port> -streamId <streamId> -topicId <topicId>
        createtopic  -url <url> -port <port> -streamId <streamId> -topicId <topicId> -name <name> -partitionsCount <partitionsCount>
        deletetopic  -url <url> -port <port> -streamId <streamId> -topicId <topicId>
    

    Some parameters don't have default values so you have to define them manually:

        $ go run ./cli createstream
    
    Error: Name flag is required.
    -n string
            Stream name
    -name string
            Stream name
    -port string
            Iggy server port (default "8090")
    -s int
            Alias for Stream Id (default 1)
    -sid int
            Alias for Stream Id (default 1)
    -streamid int
            Stream Id (default 1)
    -url string
            Iggy server url (default "127.0.0.1")

    This is how createstream command is called correctly

    $ go run ./cli createstream -s 1 -n stream_name

Roadmap

  • Basic CLI tool (already obsolete)
  • Samples
  • Rewrite the CLI tool using CLI frameworks (like Cobra/Viper)
  • Implementing all iggy features in the SDK
    • TCP
    • HTTP (can be picked up at any moment)
    • QUIC
  • Implementing benchmarks
  • Implementing optional logging
  • Implementing tests
    • Unit tests for binary serialization
    • BDD integration tests
      • Improve BDD tests assertions, so they can detect breaking changes in iggy-server
  • Human friendly error handling
  • Documentation
  • GitHub actions CI/CD
  • Publishing to official golang packages repository

See the open issues for a full list of proposed features (and known issues).

Contributing

If you believe that you can improve this SDK feel free to contribute. Here's how you can do it:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments