Skip to content

Commit

Permalink
Add editorconfig and Cleanup (vesoft-inc#29)
Browse files Browse the repository at this point in the history
* Add Makefile and Cleanup

* Add fmt target in Makefile

* Update readme

* Add editorconfig

* RM huge gc file

* cleanup modules

* MV test directory
  • Loading branch information
yixinglu authored Jul 22, 2021
1 parent d36610e commit 61329d8
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[{Makefile,go.mod,go.sum,*.go}]
indent_style = tab
indent_size = 2
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ nebula-httpd
vendor/

# Dependency directories (remove the comment below to include it)
# vendor/
tmp/*
tmp/
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

.PHONY: build clean fmt

default: build

clean:
@go mod tidy && rm -rf nebula-httpd

build: clean fmt
@go build -o nebula-httpd main.go

fmt:
@find . -type f -iname \*.go -exec go fmt {} \;

build: clean fmt
@go build -o nebula-httpd main.go
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ $ ./nebula-httpd
## User Guide

#### API Definition
| Name | Path | Method |
| --- | --- | --- |
| connect | /api/db/connect | POST |
| exec | /api/db/exec | POST |
| disconnect | /api/db/disconnect | POST |
| Name | Path | Method |
|------------|--------------------|--------|
| connect | /api/db/connect | POST |
| exec | /api/db/exec | POST |
| disconnect | /api/db/disconnect | POST |

> Connect API
Expand All @@ -42,12 +42,12 @@ The requested json body
```
The description of the parameters is as follows.

| Field | Description |
| --- | --- |
| Field | Description |
|----------|-----------------------------------------------------------------------------------------------------------------------------|
| username | Sets the username of your Nebula Graph account. Before enabling authentication, you can use any characters as the username. |
| password | Sets the password of your Nebula Graph account. Before enabling authentication, you can use any characters as the password. |
| address | Sets the IP address of the graphd service. |
| port | Sets the port number of the graphd service. The default port number is 9669. |
| address | Sets the IP address of the graphd service. |
| port | Sets the port number of the graphd service. The default port number is 9669. |

```bash
$ curl -i -X POST -d '{"username":"user","password":"password","address":"192.168.8.26","port":9669}' http://127.0.0.1:8080/api/db/connect
Expand All @@ -67,10 +67,10 @@ Date: Fri, 02 Apr 2021 08:49:18 GMT
}
```

Notice:
Notice:

The response data nsid "5e18fa40-5343-422f-84e3-e7f9cad6b735" is encoded by HMAC-SH256 encryption algorithm,so it's not the same as what you get from a cookie.
If you connect the graphd service succeed, remember to save the *NSID*, it's important for the *exec api* to execute nGQL.
The response data nsid "5e18fa40-5343-422f-84e3-e7f9cad6b735" is encoded by HMAC-SH256 encryption algorithm,so it's not the same as what you get from a cookie.
If you connect the graphd service succeed, remember to save the *NSID*, it's important for the *exec api* to execute nGQL.
If you restart the gateway server, all authenticated session will be lost, please noticed.

> Exec API
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1
github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vesoft-inc/nebula-go/v2 v2.0.0-20210603033436-24ea78f90a1e h1:B53wGI1tbj/QP2nPm+ubQx/3UTmf4gMhmCVqndfis/o=
github.com/vesoft-inc/nebula-go/v2 v2.0.0-20210603033436-24ea78f90a1e/go.mod h1:B7nR6+nOSo0umq/HkCmUfyRtYrJVOsNiPS9u4djDbSc=
github.com/vesoft-inc/nebula-go/v2 v2.0.0-20210709070507-5ab4bdcd57db h1:I22+tDn3oRUPAyhLgjwteYE8ZmZDJZfkQEBHyGiosKo=
github.com/vesoft-inc/nebula-go/v2 v2.0.0-20210709070507-5ab4bdcd57db/go.mod h1:B7nR6+nOSo0umq/HkCmUfyRtYrJVOsNiPS9u4djDbSc=
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
Expand Down
Binary file removed tmp/runner-build
Binary file not shown.

0 comments on commit 61329d8

Please sign in to comment.