Skip to content

Commit b8e1744

Browse files
committed
update
1 parent 4db98ad commit b8e1744

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+55
-143
lines changed

bufpool/bufpool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"time"
99
"unsafe"
1010

11-
"github.com/chenjie199234/Corelib/common"
12-
ctime "github.com/chenjie199234/Corelib/time"
11+
"github.com/chenjie199234/Corelib/util/common"
12+
ctime "github.com/chenjie199234/Corelib/util/time"
1313
)
1414

1515
var pool *sync.Pool

bufpool/bufpool_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
ctime "github.com/chenjie199234/Corelib/time"
7+
ctime "github.com/chenjie199234/Corelib/util/time"
88
)
99

1010
type A struct {

codegen/tml/gomod/template_gomod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const text = `module {{.}}
1111
go 1.15
1212
1313
require (
14-
github.com/chenjie199234/Corelib v0.0.3
14+
github.com/chenjie199234/Corelib v0.0.4
1515
github.com/fsnotify/fsnotify v1.4.9
1616
github.com/go-redis/redis/v8 v8.4.8
1717
github.com/go-sql-driver/mysql v1.5.0

codegen/tml/server/xrpc/template_xrpc.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"{{.}}/service"
1717
"{{.}}/source"
1818
19-
"github.com/chenjie199234/Corelib/common"
2019
"github.com/chenjie199234/Corelib/rpc"
2120
"github.com/chenjie199234/Corelib/rpc/mids"
2221
"github.com/chenjie199234/Corelib/stream"
@@ -36,7 +35,7 @@ func StartRpcServer() {
3635
AppWriteBufferNum: 65535,
3736
},
3837
}
39-
s = rpc.NewRpcServer(rpcc, time.Duration(c.RpcTimeout), common.Str2byte(c.RpcVerifydata))
38+
s = rpc.NewRpcServer(rpcc, time.Duration(c.RpcTimeout), []byte(c.RpcVerifydata))
4039
4140
//this place can register global midwares
4241
//s.Use(globalmidwares)

codegen/tml/source/template_source.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
2020
"github.com/chenjie199234/Corelib/log"
2121
"github.com/chenjie199234/Corelib/redis"
22-
ctime "github.com/chenjie199234/Corelib/time"
22+
ctime "github.com/chenjie199234/Corelib/util/time"
2323
"github.com/go-sql-driver/mysql"
2424
"github.com/segmentio/kafka-go"
2525
"github.com/segmentio/kafka-go/sasl/scram"

configcenter/client.go

-1
This file was deleted.

configcenter/msg.go

-17
This file was deleted.

configcenter/server.go

-72
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lru/lru.go container/lru/lru.go

File renamed without changes.
File renamed without changes.

merkletree/merkletree.go container/merkletree/merkletree.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"crypto/sha256"
66
"hash"
77

8-
"github.com/chenjie199234/Corelib/common"
8+
"github.com/chenjie199234/Corelib/util/common"
99
)
1010

1111
type treeNode struct {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

discovery/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"time"
1515
"unsafe"
1616

17-
"github.com/chenjie199234/Corelib/common"
1817
"github.com/chenjie199234/Corelib/log"
1918
"github.com/chenjie199234/Corelib/stream"
19+
"github.com/chenjie199234/Corelib/util/common"
2020
)
2121

2222
var (

discovery/msg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"fmt"
66

7-
"github.com/chenjie199234/Corelib/common"
7+
"github.com/chenjie199234/Corelib/util/common"
88
)
99

1010
const (

discovery/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"strings"
77
"sync"
88

9-
"github.com/chenjie199234/Corelib/common"
109
"github.com/chenjie199234/Corelib/log"
1110
"github.com/chenjie199234/Corelib/stream"
11+
"github.com/chenjie199234/Corelib/util/common"
1212
)
1313

1414
//appuniquename = appname:ip:port

log/log_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ func Test_Mlog(t *testing.T) {
1414
Debug("testdebug", "a", 1)
1515
Info("testinfo", []int{1, 2}, []string{"a", "b"})
1616
Warning("testwarning", true, []bool{false, true})
17-
Error("testerror", map[int]*A{1: &A{Name: "1", Age: 1}, 2: &A{Name: "2", Age: 2}}, &A{Name: "name", Age: 18})
17+
testdata := make(map[int]*A)
18+
testdata[1] = &A{Name: "1", Age: 1}
19+
testdata[2] = &A{Name: "2", Age: 2}
20+
Error("testerror", testdata, &A{Name: "name", Age: 18})
1821
Close()
1922
if e := os.RemoveAll("./log"); e != nil {
2023
panic(e)

redis/bloom.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010
"time"
1111

12-
"github.com/chenjie199234/Corelib/common"
12+
"github.com/chenjie199234/Corelib/util/common"
1313
"github.com/gomodule/redigo/redis"
1414
)
1515

rotatefile/rotatefile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"unsafe"
1414

1515
"github.com/chenjie199234/Corelib/bufpool"
16-
"github.com/chenjie199234/Corelib/common"
16+
"github.com/chenjie199234/Corelib/util/common"
1717
)
1818

1919
type RotateCap uint //unit M

rpc/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"time"
1313
"unsafe"
1414

15-
"github.com/chenjie199234/Corelib/common"
16-
cerror "github.com/chenjie199234/Corelib/error"
1715
"github.com/chenjie199234/Corelib/log"
18-
"github.com/chenjie199234/Corelib/metadata"
1916
"github.com/chenjie199234/Corelib/stream"
17+
"github.com/chenjie199234/Corelib/util/common"
18+
cerror "github.com/chenjie199234/Corelib/util/error"
19+
"github.com/chenjie199234/Corelib/util/metadata"
2020

2121
"google.golang.org/protobuf/proto"
2222
)

rpc/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package rpc
33
import (
44
"context"
55

6-
"github.com/chenjie199234/Corelib/sys/cpu"
6+
"github.com/chenjie199234/Corelib/util/cpu"
77
)
88

99
type Context struct {

rpc/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package rpc
22

33
import (
4-
"github.com/chenjie199234/Corelib/error"
4+
"github.com/chenjie199234/Corelib/util/error"
55
)
66

77
var (

rpc/protoc-gen-go-rpc/rpc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const (
2626
contextPackage = protogen.GoImportPath("context")
2727
rpcPackage = protogen.GoImportPath("github.com/chenjie199234/Corelib/rpc")
2828
streamPackage = protogen.GoImportPath("github.com/chenjie199234/Corelib/stream")
29-
commonPackage = protogen.GoImportPath("github.com/chenjie199234/Corelib/common")
29+
commonPackage = protogen.GoImportPath("github.com/chenjie199234/Corelib/util/common")
3030
bufpoolPackage = protogen.GoImportPath("github.com/chenjie199234/Corelib/bufpool")
3131
)
3232

rpc/server.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"sync/atomic"
1010
"time"
1111

12-
"github.com/chenjie199234/Corelib/common"
1312
"github.com/chenjie199234/Corelib/log"
14-
"github.com/chenjie199234/Corelib/metadata"
1513
"github.com/chenjie199234/Corelib/stream"
16-
"github.com/chenjie199234/Corelib/sys/cpu"
14+
"github.com/chenjie199234/Corelib/util/common"
15+
"github.com/chenjie199234/Corelib/util/cpu"
16+
"github.com/chenjie199234/Corelib/util/metadata"
1717

1818
"google.golang.org/protobuf/proto"
1919
)

stream/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"time"
77

8-
"github.com/chenjie199234/Corelib/common"
8+
"github.com/chenjie199234/Corelib/util/common"
99
)
1010

1111
//Warning!!Don't write block logic in these callback,live for{}

stream/conn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"unsafe"
1313

1414
"github.com/chenjie199234/Corelib/bufpool"
15-
"github.com/chenjie199234/Corelib/common"
1615
"github.com/chenjie199234/Corelib/log"
16+
"github.com/chenjie199234/Corelib/util/common"
1717
)
1818

1919
func (this *Instance) StartTcpServer(listenaddr string) {

stream/instance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"time"
1010

1111
"github.com/chenjie199234/Corelib/bufpool"
12-
"github.com/chenjie199234/Corelib/common"
1312
"github.com/chenjie199234/Corelib/log"
13+
"github.com/chenjie199234/Corelib/util/common"
1414
)
1515

1616
type Instance struct {

stream/msg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66

77
"github.com/chenjie199234/Corelib/bufpool"
8-
"github.com/chenjie199234/Corelib/common"
8+
"github.com/chenjie199234/Corelib/util/common"
99
)
1010

1111
const (

superd/group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"sync"
1212

1313
"github.com/chenjie199234/Corelib/bufpool"
14-
"github.com/chenjie199234/Corelib/common"
1514
"github.com/chenjie199234/Corelib/log"
1615
"github.com/chenjie199234/Corelib/rotatefile"
16+
"github.com/chenjie199234/Corelib/util/common"
1717
)
1818

1919
const (

superd/process.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"syscall"
1010
"time"
1111

12-
"github.com/chenjie199234/Corelib/common"
1312
"github.com/chenjie199234/Corelib/log"
13+
"github.com/chenjie199234/Corelib/util/common"
1414
)
1515

1616
const (

superd/super.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sync"
88
"sync/atomic"
99

10-
"github.com/chenjie199234/Corelib/common"
1110
"github.com/chenjie199234/Corelib/log"
1211
"github.com/chenjie199234/Corelib/rotatefile"
12+
"github.com/chenjie199234/Corelib/util/common"
1313
)
1414

1515
const (

common/common.go util/common/common.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import (
77

88
func NameCheck(name string, haspoint bool) error {
99
if len(name) == 0 {
10-
return errors.New("name is empty")
10+
return errors.New("empty")
1111
}
1212
if len(name) > 32 {
13-
return errors.New("name is too long")
13+
return errors.New("too long")
1414
}
1515
if name[0] < 65 || (name[0] > 90 && name[0] < 97) || name[0] > 122 {
16-
return errors.New("name's first character must in [a-z][A-Z]")
16+
return errors.New("first character must in [a-z][A-Z]")
1717
}
1818
for _, v := range name {
1919
if haspoint {
2020
if (v != 46 && v < 48) || (v > 57 && v < 65) || (v > 90 && v < 97) || v > 122 {
21-
return errors.New("name has illegal character,must in [a-z][A-Z][0-9][.]")
21+
return errors.New("illegal character,must in [a-z][A-Z][0-9][.]")
2222
}
2323
} else {
2424
if v < 48 || (v > 57 && v < 65) || (v > 90 && v < 97) || v > 122 {
25-
return errors.New("name has illegal character,must in [a-z][A-Z][0-9]")
25+
return errors.New("illegal character,must in [a-z][A-Z][0-9]")
2626
}
2727
}
2828
}
File renamed without changes.

sys/cpu/cpu.go util/cpu/cpu.go

File renamed without changes.
File renamed without changes.

error/error.go util/error/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package error
33
import (
44
"encoding/json"
55

6-
"github.com/chenjie199234/Corelib/common"
6+
"github.com/chenjie199234/Corelib/util/common"
77
)
88

99
//if error was not in merror format,code will return -1,msg will use the origin error.Error()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)