Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add editorconfig and Cleanup #29

Merged
merged 7 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.