refactor(mod): gitee.com/wheat-os

This commit is contained in:
bandl 2021-11-02 14:45:08 +08:00
parent 99133bf7ea
commit 70b23849bc
51 changed files with 117 additions and 115 deletions

View File

@ -1,8 +1,8 @@
package client package client
import ( import (
"gitee.com/timedb/wheatCache/client/middle" "gitee.com/wheat-os/wheatCache/client/middle"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
) )

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"testing" "testing"
"gitee.com/timedb/wheatCache/client/middle" "gitee.com/wheat-os/wheatCache/client/middle"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -3,7 +3,7 @@ package middle
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"

View File

@ -7,9 +7,9 @@ package dao
import ( import (
"testing" "testing"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/lru" "gitee.com/wheat-os/wheatCache/pkg/lru"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -4,12 +4,12 @@ import (
"fmt" "fmt"
"net" "net"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
wheatCodec "gitee.com/timedb/wheatCache/gateway/codec" wheatCodec "gitee.com/wheat-os/wheatCache/gateway/codec"
"gitee.com/timedb/wheatCache/gateway/proxy" "gitee.com/wheat-os/wheatCache/gateway/proxy"
"gitee.com/timedb/wheatCache/gateway/transport" "gitee.com/wheat-os/wheatCache/gateway/transport"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"gitee.com/timedb/wheatCache/pkg/util/server" "gitee.com/wheat-os/wheatCache/pkg/util/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -15,7 +15,7 @@ limitations under the License.
*/ */
package main package main
import "gitee.com/timedb/wheatCache/gateway/cmd" import "gitee.com/wheat-os/wheatCache/gateway/cmd"
func main() { func main() {
cmd.Execute() cmd.Execute()

View File

@ -3,7 +3,7 @@ package proxy
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/gateway/transport" "gitee.com/wheat-os/wheatCache/gateway/transport"
"google.golang.org/grpc" "google.golang.org/grpc"
) )

View File

@ -3,9 +3,9 @@ package proxy
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/gateway/codec" "gitee.com/wheat-os/wheatCache/gateway/codec"
"gitee.com/timedb/wheatCache/gateway/transport" "gitee.com/wheat-os/wheatCache/gateway/transport"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"io" "io"
wheatCodec "gitee.com/timedb/wheatCache/gateway/codec" wheatCodec "gitee.com/wheat-os/wheatCache/gateway/codec"
"gitee.com/timedb/wheatCache/gateway/transport" "gitee.com/wheat-os/wheatCache/gateway/transport"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"

View File

@ -5,7 +5,7 @@ import (
"sort" "sort"
"strconv" "strconv"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
) )
type HashFunc func(data []byte) uint32 type HashFunc func(data []byte) uint32

2
go.mod
View File

@ -1,4 +1,4 @@
module gitee.com/timedb/wheatCache module gitee.com/wheat-os/wheatCache
go 1.16 go 1.16

View File

@ -4,7 +4,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
) )
// 事件 poll 降低 new 对象的频率 // 事件 poll 降低 new 对象的频率

View File

@ -2,9 +2,10 @@ package logx
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/pkg/event"
"github.com/spf13/viper"
"sync" "sync"
"gitee.com/wheat-os/wheatCache/pkg/event"
"github.com/spf13/viper"
) )
type LogLevelState int8 type LogLevelState int8

View File

@ -8,8 +8,8 @@ import (
"strings" "strings"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
middleMsg "gitee.com/timedb/wheatCache/pkg/middle-msg" middleMsg "gitee.com/wheat-os/wheatCache/pkg/middle-msg"
) )
func With(ctx context.Context, p event.ProduceInterface) *upLogger { func With(ctx context.Context, p event.ProduceInterface) *upLogger {

View File

@ -2,9 +2,10 @@ package logx
import ( import (
"context" "context"
_ "gitee.com/timedb/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/event"
"testing" "testing"
_ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/wheat-os/wheatCache/pkg/event"
) )
func TestStd(t *testing.T) { func TestStd(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"sync" "sync"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
) )
type SingleWorkFunc func() interface{} type SingleWorkFunc func() interface{}

View File

@ -4,13 +4,13 @@ import (
"container/list" "container/list"
"sync/atomic" "sync/atomic"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/middle" "gitee.com/wheat-os/wheatCache/pkg/middle"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
"gitee.com/timedb/wheatCache/pkg/util" "gitee.com/wheat-os/wheatCache/pkg/util"
"github.com/spf13/viper" "github.com/spf13/viper"
) )

View File

@ -5,8 +5,8 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure/stringx" "gitee.com/wheat-os/wheatCache/pkg/structure/stringx"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -4,8 +4,8 @@ import (
"sync" "sync"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/util/skiplist" "gitee.com/wheat-os/wheatCache/pkg/util/skiplist"
) )
// lru 的 ttl 管理器 // lru 的 ttl 管理器

View File

@ -5,8 +5,8 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure/stringx" "gitee.com/wheat-os/wheatCache/pkg/structure/stringx"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -5,10 +5,10 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure/stringx" "gitee.com/wheat-os/wheatCache/pkg/structure/stringx"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -4,10 +4,10 @@ import (
"context" "context"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
mMsg "gitee.com/timedb/wheatCache/pkg/middle-msg" mMsg "gitee.com/wheat-os/wheatCache/pkg/middle-msg"
) )
func (lru *SingleCache) lruSingleWork() { func (lru *SingleCache) lruSingleWork() {

View File

@ -3,8 +3,8 @@ package middlemsg
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
) )
const ( const (

View File

@ -1,10 +1,10 @@
package middle package middle
import ( import (
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/plugins" "gitee.com/wheat-os/wheatCache/plugins"
"gitee.com/timedb/wheatCache/plugins/config" "gitee.com/wheat-os/wheatCache/plugins/config"
"github.com/spf13/viper" "github.com/spf13/viper"
) )

View File

@ -3,8 +3,8 @@ package middle
import ( import (
"context" "context"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
middleMsg "gitee.com/timedb/wheatCache/pkg/middle-msg" middleMsg "gitee.com/wheat-os/wheatCache/pkg/middle-msg"
) )
func (m *MiddleWare) startWork() { func (m *MiddleWare) startWork() {

View File

@ -6,8 +6,8 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
middleMsg "gitee.com/timedb/wheatCache/pkg/middle-msg" middleMsg "gitee.com/wheat-os/wheatCache/pkg/middle-msg"
) )
func Test_middleware_loadPlugins(t *testing.T) { func Test_middleware_loadPlugins(t *testing.T) {

View File

@ -1,8 +1,8 @@
package listx package listx
import ( import (
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
) )
/* /*

View File

@ -3,8 +3,8 @@ package stringx
import ( import (
"strconv" "strconv"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
) )
type StringSingle struct { type StringSingle struct {

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"unsafe" "unsafe"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -6,7 +6,7 @@ import (
"math" "math"
"strconv" "strconv"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
) )
// Value 提供一个基础的 动态类型 // Value 提供一个基础的 动态类型

View File

@ -5,7 +5,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
) )
// ParseSizeToBit // ParseSizeToBit

View File

@ -5,7 +5,7 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"google.golang.org/grpc" "google.golang.org/grpc"
) )

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -4,9 +4,9 @@
package config package config
import ( import (
"gitee.com/timedb/wheatCache/plugins" "gitee.com/wheat-os/wheatCache/plugins"
mockPlugin "gitee.com/timedb/wheatCache/plugins/mock-plugin" mockPlugin "gitee.com/wheat-os/wheatCache/plugins/mock-plugin"
) )
func GetMiddlewareMap() map[string]plugins.PluginInterface { func GetMiddlewareMap() map[string]plugins.PluginInterface {

View File

@ -4,9 +4,9 @@
package config package config
import ( import (
"gitee.com/timedb/wheatCache/plugins" "gitee.com/wheat-os/wheatCache/plugins"
{%for dir in dirs %} {%for dir in dirs %}
{{dir[0]}} "gitee.com/timedb/wheatCache/plugins/{{dir[1]}}" {{dir[0]}} "gitee.com/wheat-os/wheatCache/plugins/{{dir[1]}}"
{%- endfor%} {%- endfor%}
) )

View File

@ -5,8 +5,8 @@ import (
"net/http" "net/http"
_ "net/http/pprof" _ "net/http/pprof"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"github.com/spf13/viper" "github.com/spf13/viper"
) )

View File

@ -6,12 +6,12 @@ import (
"log" "log"
"net" "net"
"gitee.com/timedb/wheatCache/storage/service" "gitee.com/wheat-os/wheatCache/storage/service"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/util/server" "gitee.com/wheat-os/wheatCache/pkg/util/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -1,7 +1,7 @@
package dao package dao
import ( import (
"gitee.com/timedb/wheatCache/pkg/lru" "gitee.com/wheat-os/wheatCache/pkg/lru"
) )
type Dao struct { type Dao struct {

View File

@ -1,5 +1,5 @@
package dao package dao
import ( import (
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/wheat-os/wheatCache/conf"
) )

View File

@ -3,7 +3,7 @@
package dao package dao
import "gitee.com/timedb/wheatCache/pkg/proto" import "gitee.com/wheat-os/wheatCache/pkg/proto"
type Interface interface { type Interface interface {
LIndex(*proto.BaseKey, int32) (*proto.LIndexResponse, error) LIndex(*proto.BaseKey, int32) (*proto.LIndexResponse, error)

View File

@ -1,10 +1,10 @@
package dao package dao
import ( import (
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
"gitee.com/timedb/wheatCache/pkg/structure/listx" "gitee.com/wheat-os/wheatCache/pkg/structure/listx"
) )
func (d *Dao) LIndex(key *proto.BaseKey, index int32) (*proto.LIndexResponse, error) { func (d *Dao) LIndex(key *proto.BaseKey, index int32) (*proto.LIndexResponse, error) {

View File

@ -1,10 +1,10 @@
package dao package dao
import ( import (
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/wheat-os/wheatCache/pkg/structure"
"gitee.com/timedb/wheatCache/pkg/structure/stringx" "gitee.com/wheat-os/wheatCache/pkg/structure/stringx"
) )
// stringx 相关的方法 // stringx 相关的方法

View File

@ -16,7 +16,7 @@ limitations under the License.
package main package main
import ( import (
"gitee.com/timedb/wheatCache/storage/cmd" "gitee.com/wheat-os/wheatCache/storage/cmd"
) )
func main() { func main() {

View File

@ -6,8 +6,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/wheat-os/wheatCache/pkg/logx"
protobuf "google.golang.org/protobuf/proto" protobuf "google.golang.org/protobuf/proto"
) )

View File

@ -9,7 +9,7 @@ import (
"testing" "testing"
"time" "time"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -7,8 +7,8 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
protobuf "google.golang.org/protobuf/proto" protobuf "google.golang.org/protobuf/proto"
) )

View File

@ -3,12 +3,12 @@ package service
import ( import (
"time" "time"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/lru" "gitee.com/wheat-os/wheatCache/pkg/lru"
"gitee.com/timedb/wheatCache/pkg/middle" "gitee.com/wheat-os/wheatCache/pkg/middle"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/storage/dao" "gitee.com/wheat-os/wheatCache/storage/dao"
"gitee.com/timedb/wheatCache/storage/persisted" "gitee.com/wheat-os/wheatCache/storage/persisted"
"github.com/spf13/viper" "github.com/spf13/viper"
) )

View File

@ -5,9 +5,9 @@ package service
import ( import (
context "context" context "context"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/lru" "gitee.com/wheat-os/wheatCache/pkg/lru"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
) )
func (s *singleService) LIndex( func (s *singleService) LIndex(

View File

@ -7,8 +7,8 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"gitee.com/timedb/wheatCache/pkg/errorx" "gitee.com/wheat-os/wheatCache/pkg/errorx"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
protobuf "google.golang.org/protobuf/proto" protobuf "google.golang.org/protobuf/proto"
) )

View File

@ -3,7 +3,7 @@
package dao package dao
import "gitee.com/timedb/wheatCache/pkg/proto" import "gitee.com/wheat-os/wheatCache/pkg/proto"
type Interface interface { type Interface interface {
{%for key in keys %} {%for key in keys %}

View File

@ -5,9 +5,9 @@ package service
import ( import (
context "context" context "context"
"gitee.com/timedb/wheatCache/pkg/event" "gitee.com/wheat-os/wheatCache/pkg/event"
"gitee.com/timedb/wheatCache/pkg/lru" "gitee.com/wheat-os/wheatCache/pkg/lru"
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/wheat-os/wheatCache/pkg/proto"
) )
{% for key in keys %} {% for key in keys %}