Skip to content
Merged
16 changes: 16 additions & 0 deletions .header
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
77 changes: 77 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

# How to contribute

If you would like to contribute code to this project, fork the repository and send a pull request.

## Prerequisite

In this project, use `go mod` as the package management tool and make sure your Go version is higher then `Go 1.11`.

## Fork

Before contributing, you need to fork [pulsarctl](https://github.com/streamnative/pulsarcli) to your GitHub repository.

## Contribution flow

```bash
$ git remote add streamnative https://github.com/streamnative/pulsarctl.git
# sync with the remote master
$ git checkout master
$ git fetch streamnative
$ git rebase streamnative/master
$ git push origin master
# create a PR branch
$ git checkout -b your_branch
# do something
$ git add [your change files]
$ git commit -sm "xxx"
$ git push origin your_branch
```

## Configure GoLand

The `pulsarctl` uses `go mod` to manage dependencies, so make sure your IDE enables `Go Modules(vgo)`.

To configure annotation processing in GoLand, follow the steps below.

1. To open the **Go Modules Settings** window, in GoLand, click **Preferences** > **Go** > **Go Modules(vgo)**.

2. Select the **Enable Go Modules(vgo) integration** checkbox.

3. Click **Apply** and **OK**.

## Code style

The code style suggested by the Golang community is used in `pulsarctl`.
For more information, see [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments).

To make your pull request easy to review, maintain and develop, follow this style.

## Create a new file

The project uses the open source protocol of Apache License 2.0. If you need to create a new file when developing new features,
add the license at the beginning of each file. The location of the header file: [header file](.header).

## Update dependencies

The `pulsarctl` uses [Go 1.11 module](https://github.com/golang/go/wiki/Modules) to manage dependencies. To add or update a dependency, use the `go mod edit` command to change the dependency.
82 changes: 78 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,85 @@
# pulsarctl
<!--

a CLI for Apache Pulsar
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

## Build
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/)
[![LICENSE](https://img.shields.io/hexpm/l/pulsar.svg)](https://github.com/streamnative/pulsarctl/blob/master/LICENSE)

# Pulsarctl

A CLI tool for the [Apache Pulsar](https://pulsar.incubator.apache.org/) project.

## Requirement

- Go 1.11 +

## Usage

### Prerequisite

If you have not installed Go, install it according to the [installation instruction](http://golang.org/doc/install).

Since the `go mod` package management tool is used in this project, **Go 1.11 or higher** version is required.

### Install

1. Clone the project from GitHub to your local.

```bash
git clone https://github.com/streamnative/pulsarctl.git
```

2. Use `go mod` to get the dependencies needed for the project.

```bash
go mod download
```

After entering the `go mod download` command, if some libs can not be downloaded, then you can download them by referring to the proxy provided by [GOPROXY.io](https://goproxy.io/).

### Build

```bash
export GO111MODULE=on

go build -o pulsarctl
go build -o pulsarctl main.go
```

## Project Status

The following is an incomplete list of features that are not yet implemented:

- pulsar-admin broker-stats subcommand
- pulsar-admin brokers subcommand
- pulsar-admin ns-isolation-policy subcommand
- pulsar-admin resource-quotas subcommand
- pulsar-admin functions localrun options
- pulsar-admin sources localrun options
- pulsar-admin sinks localrun options
- pulsar-admin schemas extract options

## Contribute

Contributions are welcomed and greatly appreciated.
For more information about how to submit a patch and the contribution workflow, see [CONTRIBUTING.md](CONTRIBUTING.md).

## License

Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Loading