-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
116 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,36 +37,82 @@ Download the appropriate version for your platform from [releases](https://githu | |
You don’t need to install it into a global location. This works well for shared hosts and other systems where you don’t have a privileged account. | ||
Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location. | ||
|
||
#### Homebrew | ||
#### macOS | ||
|
||
`guardian` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/odpf/guardian/releases/latest) page: | ||
|
||
```sh | ||
brew install odpf/tap/guardian | ||
``` | ||
|
||
To upgrade to the latest version: | ||
|
||
``` | ||
brew upgrade guardian | ||
``` | ||
|
||
Check for installed guardian version | ||
|
||
```sh | ||
# Install guardian (requires homebrew installed) | ||
$ brew install odpf/tap/guardian | ||
guardian version | ||
``` | ||
|
||
#### Windows | ||
|
||
`guardian` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/odpf/guardian/releases/latest) page: | ||
|
||
``` | ||
scoop bucket add guardian https://github.com/odpf/scoop-bucket.git | ||
``` | ||
|
||
To upgrade to the latest version: | ||
|
||
``` | ||
scoop update guardian | ||
``` | ||
|
||
#### Docker | ||
|
||
We provide ready to use Docker container images. To pull the latest image: | ||
|
||
``` | ||
docker pull odpf/guardian:latest | ||
``` | ||
|
||
To pull a specific version: | ||
|
||
``` | ||
docker pull odpf/guardian:v0.3.2 | ||
``` | ||
|
||
# Upgrade guardian (requires homebrew installed) | ||
$ brew upgrade guardian | ||
If you like to have a shell alias that runs the latest version of pscale from docker whenever you type `pscale`: | ||
|
||
# Check for installed guardian version | ||
$ guardian version | ||
``` | ||
mkdir -p $HOME/.config/odpf | ||
alias guardian="docker run -e HOME=/tmp -v $HOME/.config/odpf:/tmp/.config/odpf --user $(id -u):$(id -g) --rm -it -p 3306:3306/tcp odpf/guardian:latest" | ||
``` | ||
|
||
## Usage | ||
|
||
Guardian is purely API-driven. It is very easy to get started with Guardian. It provides CLI, HTTP and GRPC APIs for simpler developer experience. | ||
|
||
### CLI | ||
#### CLI | ||
|
||
Guardian CLI is fully featured and simple to use, even for those who have very limited experience working from the command line. Run `guardian --help` to see list of all available commands and instructions to use. | ||
|
||
List of commands | ||
|
||
``` | ||
guardian --help | ||
``` | ||
# List of commands | ||
$ guardian --help | ||
|
||
# Print command reference | ||
$ guardian reference | ||
Print command reference | ||
|
||
```sh | ||
guardian reference | ||
``` | ||
|
||
### API | ||
#### API | ||
|
||
Guardian provides a fully-featured GRPC and HTTP API to interact with Guardian server. Both APIs adheres to a set of standards that are rigidly followed. Please refer to [proton](https://github.com/odpf/proton/tree/main/odpf/guardian/v1beta1) for GRPC API definitions. | ||
|
||
|
@@ -81,38 +127,55 @@ Guardian provides a fully-featured GRPC and HTTP API to interact with Guardian s | |
|
||
</details> | ||
|
||
```sh | ||
# Clone the repo | ||
$ git clone [email protected]:odpf/guardian.git | ||
Clone the repo | ||
|
||
# Install all the golang dependencies | ||
$ make install | ||
``` | ||
git clone [email protected]:odpf/guardian.git | ||
``` | ||
|
||
# Check all build commands available | ||
$ make help | ||
Install all the golang dependencies | ||
|
||
# Build meteor binary file | ||
$ make build | ||
``` | ||
make install | ||
``` | ||
|
||
# Init config | ||
$ cp internal/server/config.yaml config.yaml | ||
$ ./guardian config init | ||
Build guardian binary file | ||
|
||
``` | ||
make build | ||
``` | ||
|
||
# Run database migrations | ||
$ ./guardian server migrate | ||
Init config | ||
|
||
# Start guardian server | ||
$ ./guardian server start | ||
``` | ||
cp internal/server/config.yaml config.yaml | ||
./guardian config init | ||
``` | ||
|
||
Run database migrations | ||
|
||
``` | ||
./guardian server migrate -c config.yaml | ||
``` | ||
|
||
Start guardian server | ||
|
||
``` | ||
./guardian server start -c config.yaml | ||
``` | ||
|
||
## Running tests | ||
|
||
Running all unit tests | ||
|
||
```sh | ||
# Running all unit tests | ||
$ make test | ||
make test | ||
``` | ||
|
||
Print code coverage | ||
|
||
# Print code coverage | ||
$ make coverage | ||
``` | ||
make coverage | ||
``` | ||
|
||
## Contribute | ||
|