Skip to content

Commit fa6daa0

Browse files
authored
update ci (#1)
* update ci * update license
1 parent 995b939 commit fa6daa0

19 files changed

+432
-74
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Enviornment (please complete the following information):**
11+
- OS: [Linux: uname -a]
12+
- envcd version [e.g. v0.0.1]
13+
14+
**Describe the bug**
15+
A clear and concise description of what the bug is.
16+
17+
**To Reproduce**
18+
Steps to reproduce the behavior:
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Background & X Problem**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Proposal and Expectation**
14+
A clear and concise description of what you want to happen.
15+
16+
**Solutions & Y Problems**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- With pull requests:
2+
- Open your pull request against `main`
3+
- Your pull request should have no more than two commits, if not you should squash them.
4+
- You should pass all tests by `go test -v ./...` at the project root path in local.
5+
- It should pass all tests in the available continuous integration systems such as GitHub Actions.
6+
- You should add/modify tests to cover your proposed code changes.
7+
- If your pull request contains a new feature, please document it on the README.
8+

.github/workflows/codeql.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '21 12 * * 4'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ubuntu-latest
13+
services:
14+
etcd:
15+
# Docker Hub image
16+
image: bitnami/etcd:3.5
17+
env:
18+
ETCD_ADVERTISE_CLIENT_URLS: http://127.0.0.1:2379
19+
ALLOW_NONE_AUTHENTICATION: yes
20+
ports:
21+
- 2379:2379
22+
- 2380:2380
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v3
29+
with:
30+
go-version: 1.18
31+
32+
- name: Build
33+
run: go build -v ./...
34+
35+
- name: Test
36+
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
37+
38+
- uses: codecov/codecov-action@v2

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# pagehelper
22

3+
[![license card](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg?label=license)](https://github.com/acmestack/pagehelper/blob/main/LICENSE)
4+
[![go version](https://img.shields.io/github/go-mod/go-version/acmestack/pagehelper)](#)
5+
[![go report](https://goreportcard.com/badge/github.com/acmestack/pagehelper)](https://goreportcard.com/report/github.com/acmestack/pagehelper)
6+
[![codecov report](https://codecov.io/gh/acmestack/pagehelper/branch/main/graph/badge.svg)](https://codecov.io/gh/acmestack/pagehelper)
7+
[![workflow](https://github.com/acmestack/pagehelper/actions/workflows/go.yml/badge.svg?event=push)](#)
8+
[![lasted release](https://img.shields.io/github/v/release/acmestack/pagehelper?label=lasted)](https://github.com/acmestack/pagehelper/releases)
9+
310
## 介绍
411

512
pagehelper是与[gobatis](https://github.com/xfali/gobatis)配套的分页工具

builder.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
// Copyright (C) 2019, Xiongfa Li.
2-
// All right reserved.
3-
// @author xiongfa.li
4-
// @version V1.0
5-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
617

718
package pagehelper
819

factory.go

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
// Copyright (C) 2019, Xiongfa Li.
2-
// All right reserved.
3-
// @author xiongfa.li
4-
// @version V1.0
5-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
617

718
package pagehelper
819

920
import (
10-
"github.com/xfali/gobatis/executor"
11-
"github.com/xfali/gobatis/logging"
12-
"github.com/xfali/gobatis/session"
13-
"github.com/xfali/gobatis/transaction"
21+
"github.com/acmestack/gobatis/executor"
22+
"github.com/acmestack/gobatis/logging"
23+
"github.com/acmestack/gobatis/session"
24+
"github.com/acmestack/gobatis/transaction"
1425
)
1526

1627
type IFactory struct {

go.mod

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
module github.com/xfali/pagehelper
1+
module github.com/acmestack/pagehelper
22

3-
go 1.12
3+
go 1.18
44

5-
require github.com/xfali/gobatis v0.1.1
5+
require (
6+
github.com/acmestack/gobatis v0.2.7
7+
github.com/go-sql-driver/mysql v1.6.0
8+
)
9+
10+
require (
11+
github.com/Masterminds/goutils v1.1.1 // indirect
12+
github.com/Masterminds/semver/v3 v3.1.1 // indirect
13+
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
14+
github.com/google/uuid v1.1.1 // indirect
15+
github.com/huandu/xstrings v1.3.1 // indirect
16+
github.com/imdario/mergo v0.3.11 // indirect
17+
github.com/mitchellh/copystructure v1.0.0 // indirect
18+
github.com/mitchellh/reflectwalk v1.0.0 // indirect
19+
github.com/shopspring/decimal v1.2.0 // indirect
20+
github.com/spf13/cast v1.3.1 // indirect
21+
github.com/xfali/loadbalance v0.0.1 // indirect
22+
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 // indirect
23+
)

go.sum

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
1+
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
2+
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
3+
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
4+
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
5+
github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8=
6+
github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk=
7+
github.com/acmestack/gobatis v0.2.7 h1:aec/toZ5lZTmccI1WQ5jPPQjdITrwbIEPkt5dSajeaE=
8+
github.com/acmestack/gobatis v0.2.7/go.mod h1:vEEXPWzVzeDoFpYD2FoOfGfCyEuLtSiMIbP6jqO44Xg=
9+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
111
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
12+
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
13+
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
14+
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
15+
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
16+
github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs=
17+
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
18+
github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=
19+
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
20+
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
221
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
22+
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
23+
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
24+
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
25+
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
26+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
27+
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
28+
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
29+
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
30+
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
31+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
32+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
33+
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
334
github.com/xfali/gobatis v0.0.4 h1:rBR8m18xMQAL58jDIr+i9zj8RYC+Mfa9rOw4ZB3shf0=
435
github.com/xfali/gobatis v0.0.4/go.mod h1:hXP3PcXMSYpYFHQejG04qQjSQJtrt8jWpslftkUMBrg=
536
github.com/xfali/gobatis v0.0.5 h1:JFpkn0Gihxocc3ZXqKRv4p5q1JiIeRanL0rTdZRZX0Q=
637
github.com/xfali/gobatis v0.0.5/go.mod h1:nAml9g3T+vn1qDF5nLzSQM9t4l9Fu56GYQ33bYp5Mok=
738
github.com/xfali/gobatis v0.1.1 h1:2F1q6bylWG9bc05/OApDGSSrocT/lKrO1U0WclvgcU0=
839
github.com/xfali/gobatis v0.1.1/go.mod h1:nAml9g3T+vn1qDF5nLzSQM9t4l9Fu56GYQ33bYp5Mok=
40+
github.com/xfali/gobatis v0.2.6 h1:+WR8utJrP027+B5Z1wtVpg98CsO3hZ1cyD3bcik4fNI=
41+
github.com/xfali/gobatis v0.2.6/go.mod h1:3IWS/HF+VY3++H/lHz16vPa/ZFL8CId1y/xaTb1qmWM=
42+
github.com/xfali/loadbalance v0.0.1 h1:UVOuuDipJ740KyTaBUxTeW6UEC+fukiQCOn/5YQgexA=
43+
github.com/xfali/loadbalance v0.0.1/go.mod h1:yrzHHRZMdt2wBpLnBDeU2zbjnRYeNvUWV6sq6+3KVG0=
44+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
45+
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8=
46+
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
47+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
48+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
49+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
50+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
51+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
52+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
53+
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

modifier.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
// Copyright (C) 2019-2020, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package pagehelper
719

modifier_mysql.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
// Copyright (C) 2019-2020, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package pagehelper
719

modifier_oracle.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
// Copyright (C) 2019-2020, Xiongfa Li.
2-
// @author xiongfa.li
3-
// @version V1.0
4-
// Description:
1+
/*
2+
* Copyright (c) 2022, AcmeStack
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
517

618
package pagehelper
719

0 commit comments

Comments
 (0)