feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
4
vendor/github.com/go-gorp/gorp/v3/.travis.yml
generated
vendored
4
vendor/github.com/go-gorp/gorp/v3/.travis.yml
generated
vendored
@@ -1,7 +1,7 @@
|
||||
language: go
|
||||
go:
|
||||
- "1.12.x"
|
||||
- "1.13.x"
|
||||
- "1.15.x"
|
||||
- "1.16.x"
|
||||
- tip
|
||||
|
||||
matrix:
|
||||
|
||||
7
vendor/github.com/go-gorp/gorp/v3/README.md
generated
vendored
7
vendor/github.com/go-gorp/gorp/v3/README.md
generated
vendored
@@ -1,11 +1,8 @@
|
||||
# Go Relational Persistence
|
||||
|
||||
[](http://travis-ci.org/go-gorp/gorp)
|
||||
[](https://coveralls.io/r/go-gorp/gorp)
|
||||
[](https://github.com/go-gorp/gorp/actions)
|
||||
[](https://github.com/go-gorp/gorp/issues)
|
||||
[](https://godoc.org/gopkg.in/gorp.v1)
|
||||
[](https://godoc.org/gopkg.in/gorp.v2)
|
||||
[](https://godoc.org/github.com/go-gorp/gorp)
|
||||
[](https://pkg.go.dev/github.com/go-gorp/gorp/v3)
|
||||
|
||||
### Update 2016-11-13: Future versions
|
||||
|
||||
|
||||
152
vendor/github.com/go-gorp/gorp/v3/dialect_snowflake.go
generated
vendored
Normal file
152
vendor/github.com/go-gorp/gorp/v3/dialect_snowflake.go
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
// Copyright 2012 James Cooper. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package gorp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type SnowflakeDialect struct {
|
||||
suffix string
|
||||
LowercaseFields bool
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) QuerySuffix() string { return ";" }
|
||||
|
||||
func (d SnowflakeDialect) ToSqlType(val reflect.Type, maxsize int, isAutoIncr bool) string {
|
||||
switch val.Kind() {
|
||||
case reflect.Ptr:
|
||||
return d.ToSqlType(val.Elem(), maxsize, isAutoIncr)
|
||||
case reflect.Bool:
|
||||
return "boolean"
|
||||
case reflect.Int,
|
||||
reflect.Int8,
|
||||
reflect.Int16,
|
||||
reflect.Int32,
|
||||
reflect.Uint,
|
||||
reflect.Uint8,
|
||||
reflect.Uint16,
|
||||
reflect.Uint32:
|
||||
|
||||
if isAutoIncr {
|
||||
return "serial"
|
||||
}
|
||||
return "integer"
|
||||
case reflect.Int64, reflect.Uint64:
|
||||
if isAutoIncr {
|
||||
return "bigserial"
|
||||
}
|
||||
return "bigint"
|
||||
case reflect.Float64:
|
||||
return "double precision"
|
||||
case reflect.Float32:
|
||||
return "real"
|
||||
case reflect.Slice:
|
||||
if val.Elem().Kind() == reflect.Uint8 {
|
||||
return "binary"
|
||||
}
|
||||
}
|
||||
|
||||
switch val.Name() {
|
||||
case "NullInt64":
|
||||
return "bigint"
|
||||
case "NullFloat64":
|
||||
return "double precision"
|
||||
case "NullBool":
|
||||
return "boolean"
|
||||
case "Time", "NullTime":
|
||||
return "timestamp with time zone"
|
||||
}
|
||||
|
||||
if maxsize > 0 {
|
||||
return fmt.Sprintf("varchar(%d)", maxsize)
|
||||
} else {
|
||||
return "text"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Returns empty string
|
||||
func (d SnowflakeDialect) AutoIncrStr() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) AutoIncrBindValue() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) AutoIncrInsertSuffix(col *ColumnMap) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Returns suffix
|
||||
func (d SnowflakeDialect) CreateTableSuffix() string {
|
||||
return d.suffix
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) CreateIndexSuffix() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) DropIndexSuffix() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) TruncateClause() string {
|
||||
return "truncate"
|
||||
}
|
||||
|
||||
// Returns "$(i+1)"
|
||||
func (d SnowflakeDialect) BindVar(i int) string {
|
||||
return "?"
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) InsertAutoIncrToTarget(exec SqlExecutor, insertSql string, target interface{}, params ...interface{}) error {
|
||||
rows, err := exec.Query(insertSql, params...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
if !rows.Next() {
|
||||
return fmt.Errorf("No serial value returned for insert: %s Encountered error: %s", insertSql, rows.Err())
|
||||
}
|
||||
if err := rows.Scan(target); err != nil {
|
||||
return err
|
||||
}
|
||||
if rows.Next() {
|
||||
return fmt.Errorf("more than two serial value returned for insert: %s", insertSql)
|
||||
}
|
||||
return rows.Err()
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) QuoteField(f string) string {
|
||||
if d.LowercaseFields {
|
||||
return `"` + strings.ToLower(f) + `"`
|
||||
}
|
||||
return `"` + f + `"`
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) QuotedTableForQuery(schema string, table string) string {
|
||||
if strings.TrimSpace(schema) == "" {
|
||||
return d.QuoteField(table)
|
||||
}
|
||||
|
||||
return schema + "." + d.QuoteField(table)
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) IfSchemaNotExists(command, schema string) string {
|
||||
return fmt.Sprintf("%s if not exists", command)
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) IfTableExists(command, schema, table string) string {
|
||||
return fmt.Sprintf("%s if exists", command)
|
||||
}
|
||||
|
||||
func (d SnowflakeDialect) IfTableNotExists(command, schema, table string) string {
|
||||
return fmt.Sprintf("%s if not exists", command)
|
||||
}
|
||||
11
vendor/github.com/go-gorp/gorp/v3/logging.go
generated
vendored
11
vendor/github.com/go-gorp/gorp/v3/logging.go
generated
vendored
@@ -6,7 +6,12 @@ package gorp
|
||||
|
||||
import "fmt"
|
||||
|
||||
type GorpLogger interface {
|
||||
// GorpLogger is a deprecated alias of Logger.
|
||||
type GorpLogger = Logger
|
||||
|
||||
// Logger is the type that gorp uses to log SQL statements.
|
||||
// See DbMap.TraceOn.
|
||||
type Logger interface {
|
||||
Printf(format string, v ...interface{})
|
||||
}
|
||||
|
||||
@@ -18,10 +23,10 @@ type GorpLogger interface {
|
||||
// Use TraceOn if you want to spy on the SQL statements that gorp
|
||||
// generates.
|
||||
//
|
||||
// Note that the base log.Logger type satisfies GorpLogger, but adapters can
|
||||
// Note that the base log.Logger type satisfies Logger, but adapters can
|
||||
// easily be written for other logging packages (e.g., the golang-sanctioned
|
||||
// glog framework).
|
||||
func (m *DbMap) TraceOn(prefix string, logger GorpLogger) {
|
||||
func (m *DbMap) TraceOn(prefix string, logger Logger) {
|
||||
m.logger = logger
|
||||
if prefix == "" {
|
||||
m.logPrefix = prefix
|
||||
|
||||
32
vendor/github.com/go-gorp/gorp/v3/test_all.sh
generated
vendored
32
vendor/github.com/go-gorp/gorp/v3/test_all.sh
generated
vendored
@@ -3,39 +3,21 @@
|
||||
# on macs, you may need to:
|
||||
# export GOBUILDFLAG=-ldflags -linkmode=external
|
||||
|
||||
coveralls_testflags="-v -covermode=count -coverprofile=coverage.out"
|
||||
|
||||
echo "Running unit tests"
|
||||
go test -race
|
||||
|
||||
echo "Testing against mysql"
|
||||
export GORP_TEST_DSN=gorptest/gorptest/gorptest
|
||||
export GORP_TEST_DIALECT=mysql
|
||||
go test -tags integration $coveralls_testflags $GOBUILDFLAG $@ .
|
||||
|
||||
echo "Testing against gomysql"
|
||||
export GORP_TEST_DSN=gorptest:gorptest@/gorptest
|
||||
export GORP_TEST_DIALECT=gomysql
|
||||
go test -tags integration $coveralls_testflags $GOBUILDFLAG $@ .
|
||||
|
||||
echo "Testing against postgres"
|
||||
export GORP_TEST_DSN="user=gorptest password=gorptest dbname=gorptest sslmode=disable"
|
||||
export GORP_TEST_DSN="host=postgres user=gorptest password=gorptest dbname=gorptest sslmode=disable"
|
||||
export GORP_TEST_DIALECT=postgres
|
||||
go test -tags integration $coveralls_testflags $GOBUILDFLAG $@ .
|
||||
go test -tags integration $GOBUILDFLAG $@ .
|
||||
|
||||
echo "Testing against sqlite"
|
||||
export GORP_TEST_DSN=/tmp/gorptest.bin
|
||||
export GORP_TEST_DIALECT=sqlite
|
||||
go test -tags integration $coveralls_testflags $GOBUILDFLAG $@ .
|
||||
go test -tags integration $GOBUILDFLAG $@ .
|
||||
rm -f /tmp/gorptest.bin
|
||||
|
||||
case $(go version) in
|
||||
*go1.4*)
|
||||
if [ "$(type -p goveralls)" != "" ]; then
|
||||
goveralls -covermode=count -coverprofile=coverage.out -service=travis-ci
|
||||
elif [ -x $HOME/gopath/bin/goveralls ]; then
|
||||
$HOME/gopath/bin/goveralls -covermode=count -coverprofile=coverage.out -service=travis-ci
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
echo "Testing against mysql"
|
||||
export GORP_TEST_DSN="gorptest:gorptest@tcp(mysql)/gorptest"
|
||||
export GORP_TEST_DIALECT=mysql
|
||||
go test -tags integration $GOBUILDFLAG $@ .
|
||||
|
||||
Reference in New Issue
Block a user