Skip to content

Commit

Permalink
improvement: Add wait option to Statements.Insert and testcase. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
locona authored Mar 25, 2020
1 parent 31e5faf commit 1c152ca
Show file tree
Hide file tree
Showing 19 changed files with 471 additions and 308 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: reviewdog on Pull Request
on: [pull_request]
jobs:
golangci-lint:
name: runner / golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--enable-all --exclude-use-default=false"
reporter: github-check

misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v1
- name: misspell
uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.envrc
.vscode
.bin
*.zip
node_modules
apache-livy-0.7.0-incubating-bin

jars/target
jars/project/target
Expand Down
63 changes: 63 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
linters-settings:
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 1.1

lll:
line-length: 180

funlen:
lines: 200
statements: 130
dupl:
threshold: 150
gocognit:
min-complexity: 40
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false

# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false

# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: "fmt:.*,os:.*,Close"

linters:
disable:
- dupl
- maligned
- gochecknoglobals
- gomnd
- wsl
- godox
- gocyclo
- interfacer
- unconvert

issues:
exclude-rules:
- path: _test\.go
linters:
- ineffassign
- gocyclo
- errcheck
- dupl
- gosec
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- should have comment or be unexported
- S1000
- ST1000
- ST1003
- ST1020
- ST1021
- G304
- G402
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

livy.install:
wget -q -O tmp.zip http://ftp.kddilabs.jp/infosystems/apache/incubator/livy/0.7.0-incubating/apache-livy-0.7.0-incubating-bin.zip && unzip tmp.zip && rm -f tmp.zip

livy.start:
apache-livy-0.7.0-incubating-bin/bin/livy-server start

livy.stop:
apache-livy-0.7.0-incubating-bin/bin/livy-server stop

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# livy-go

## Getting Started

### Livy Setup

1. livy install
```
make livy.install
```

2. livy start
```
make livy.start
```

3. livy stop
```
make livy.stop
```
20 changes: 9 additions & 11 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"io"
"net/http"

"github.com/3-shake/livy-go/gensupport"
)

type BatchesService struct {
Expand Down Expand Up @@ -47,7 +45,7 @@ func (c *BatchesListCall) Do() (*Batches, error) {
}

batches := &Batches{}
err = gensupport.DecodeResponse(batches, res)
err = DecodeResponse(batches, res)
if err != nil {
return nil, err
}
Expand All @@ -62,7 +60,7 @@ func (c *BatchesListCall) doRequest() (*http.Response, error) {
return nil, err
}

return gensupport.SendRequest(c.s.client, req)
return SendRequest(c.s.client, req)
}

type BatchesGetCall struct {
Expand All @@ -84,7 +82,7 @@ func (c *BatchesGetCall) Do() (*Batch, error) {
}

batch := &Batch{}
err = gensupport.DecodeResponse(batch, res)
err = DecodeResponse(batch, res)
if err != nil {
return nil, err
}
Expand All @@ -99,7 +97,7 @@ func (c *BatchesGetCall) doRequest() (*http.Response, error) {
return nil, err
}

return gensupport.SendRequest(c.s.client, req)
return SendRequest(c.s.client, req)
}

type BatchState struct {
Expand All @@ -126,7 +124,7 @@ func (c *BatchesStateCall) Do() (*BatchState, error) {
}

state := &BatchState{}
err = gensupport.DecodeResponse(state, res)
err = DecodeResponse(state, res)
if err != nil {
return nil, err
}
Expand All @@ -141,7 +139,7 @@ func (c *BatchesStateCall) doRequest() (*http.Response, error) {
return nil, err
}

return gensupport.SendRequest(c.s.client, req)
return SendRequest(c.s.client, req)
}

type BatchesDeleteCall struct {
Expand Down Expand Up @@ -176,7 +174,7 @@ func (c *BatchesDeleteCall) doRequest() (*http.Response, error) {
return nil, err
}

return gensupport.SendRequest(c.s.client, req)
return SendRequest(c.s.client, req)
}

type BatchLogResponse struct {
Expand Down Expand Up @@ -208,7 +206,7 @@ func (c *BatchesLogCall) Do() (*BatchLogResponse, error) {

batchLog := &BatchLogResponse{}

err = gensupport.DecodeResponse(batchLog, res)
err = DecodeResponse(batchLog, res)
if err != nil {
return nil, err
}
Expand All @@ -225,5 +223,5 @@ func (c *BatchesLogCall) doRequest() (*http.Response, error) {
return nil, err
}

return gensupport.SendRequest(c.s.client, req)
return SendRequest(c.s.client, req)
}
151 changes: 0 additions & 151 deletions examples/spark.go

This file was deleted.

20 changes: 0 additions & 20 deletions gensupport/json.go

This file was deleted.

Loading

0 comments on commit 1c152ca

Please sign in to comment.