Giter VIP home page Giter VIP logo

buneary's People

Contributors

dominikbraun avatar raman-antanevich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

buneary's Issues

Enable -v flag for buneary

At the moment, there's no -v flag for printing version information but only the version sub-command instead.

The -v flag can be enabled by assigning the main.version variable to the Version field of the root command.

Interactive mode doesn't quite work on macOS

buneary's interactive mode seems to have some flaws on macOS. To reproduce, run any command that requires you to provide RabbitMQ credentials:

buneary get exchanges localhost
... will wait forever ...

You won't be prompted for your credentials at all. Instead, nothing seems to happen.

Tested on macOS 11.1.

Implement `buneary get` command for retrieving resource information

As a buneary user, I want to be able to display resource information using the buneary get command. Since buneary strives to provide a kubectl-like interface, I'm planning to implement it as follows:

  • buneary get <ADDRESS> <RESOURCE TYPE> - e.g. buneary get localhost queues - returns a table containing all the items of the resources type.
  • buneary get <ADDRESS> <RESOURCE TYPE> <NAME> - e.g. buneary get localhost queue my-queue - returns information for a single item.

Both command forms should return the same information per item. Note that the first form uses the plural and the second form uses the singular of the resource type (queues vs. queue). This is different from kubectl, but I consider it to be cleaner.

The supported resource types will be queues, exchanges, bindings and maybe messages.

For further information for a resource item, a command like buneary describe analogous to kubectl describe could make sense if needed.

Create `lo` abbreviation for `localhost` in commands

buneary commands can become quite long, partially because the host - which mostly corresponds to localhost for local development - has to be specified in each command:

$ buneary create exchange localhost my-exchange topic

Introducing a lo abbreviation could shorten this a bit.

$ buneary create exchange lo my-exchange topic

Internally, it would be sufficient to check whether the address is "lo" and change it to "localhost" if it is.

Add context to errors

At the moment, any error produced by functions in the standard library or third-party packages are returned without context. Additional context should be added to provide more information about when the error occured using fmt.Errorf:

if err != nil {
    return fmt.Errorf("failed to make coffee: %s", err.Error())
}

Implement `get messages` and `get message` command

There should be a command for reading messages from a given queue. The command syntax should look as follows:

$ buneary get messages <QUEUE NAME>

This command should return a list (or actually table) of messages. Also, there should be the buneary get message command for detailed message information:

$ buneary get message [<QUEUE NAME>] <MESSAGE ID OR SOMETHING LIKE THAT>

Not sure if the queue name is required from a technical perspective. This command should return the message body and headers.

Implement headers for messages

At the moment, buneary cannot publish messages with headers. Sending messages with headers should be enabled by implementing a --headers or --header option.

There are two possibilities here:

  • Either let the user pass a list of key-value pairs to the flag: --headers="key1=val1,key2=val2"
  • Or let the user specify multiple flags: --header key1=val1 --header key2=val2

@aligator PTAL

Return error on invalid command syntaxes

At the moment, buneary checks if the number of given arguments matches the required number of arguments. However, there's an edge case where a command does exist, the number of arguments doesn't match and buneary won't complain (but neither will do anything).

Correct:

$ buneary create exchange localhost my-exchange direct

Wrong:

$ buneary create localhost exchange my-exchange direct

There won't be an error in the second case - probably because the buneary create command exists but does not prescribe the number of arguments or require a subcommand (localhost is not a subcommand, but exchange is).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.