Skip to content

Commit

Permalink
feat: add core package (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Oct 20, 2022
1 parent 56549fd commit 82aacbe
Show file tree
Hide file tree
Showing 130 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion doc/wiki-cn/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func main() {

``` golang
import (
"github.com/douyu/jupiter/pkg/registry/etcdv3"
"github.com/douyu/jupiter/pkg/core/registry/etcdv3"
)
func main() {
app := &MyApplication{}
Expand Down
4 changes: 2 additions & 2 deletions jupiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package jupiter

import (
"github.com/douyu/jupiter/pkg/application"
"github.com/douyu/jupiter/pkg/hooks"
"github.com/douyu/jupiter/pkg/core/application"
"github.com/douyu/jupiter/pkg/core/hooks"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion jupiter_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package jupiter

import (
"github.com/douyu/jupiter/pkg/application"
"github.com/douyu/jupiter/pkg/core/application"
)

type Option = application.Option
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/xfreecache/localcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package xfreecache

import (
"github.com/coocood/freecache"
prome "github.com/douyu/jupiter/pkg/metric"
prome "github.com/douyu/jupiter/pkg/core/metric"
"github.com/douyu/jupiter/pkg/xlog"
"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/etcdv3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"time"

"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/xlog"
grpcprom "github.com/grpc-ecosystem/go-grpc-prometheus"
mvccpb "go.etcd.io/etcd/api/v3/mvccpb"
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/etcdv3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"time"

"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/constant"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/core/constant"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/core/singleton"
"github.com/douyu/jupiter/pkg/flag"
"github.com/douyu/jupiter/pkg/singleton"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/spf13/cast"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/etcdv3/intercept.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package etcdv3
import (
"context"

"github.com/douyu/jupiter/pkg/xtrace"
"github.com/douyu/jupiter/pkg/core/xtrace"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/etcdv3/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package etcdv3
import (
"context"

"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/util/xgo"
"github.com/douyu/jupiter/pkg/xlog"
"go.etcd.io/etcd/api/v3/mvccpb"
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/grpc/balancer/swr.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"fmt"
"sync"

"github.com/douyu/jupiter/pkg/constant"
"github.com/douyu/jupiter/pkg/registry"
"github.com/douyu/jupiter/pkg/core/constant"
"github.com/douyu/jupiter/pkg/core/registry"
"github.com/douyu/jupiter/pkg/server"
"github.com/smallnest/weighted"
"google.golang.org/grpc/attributes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"time"

"github.com/douyu/jupiter/pkg/client/grpc/resolver"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/xlog"
"google.golang.org/grpc"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/grpc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"time"

"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/constant"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/singleton"
"github.com/douyu/jupiter/pkg/core/constant"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/core/singleton"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/spf13/cast"
"google.golang.org/grpc"
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/grpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"time"

"github.com/douyu/jupiter/pkg"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/metric"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/core/metric"
"github.com/douyu/jupiter/pkg/core/xtrace"
"github.com/douyu/jupiter/pkg/util/xstring"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/douyu/jupiter/pkg/xtrace"
"github.com/fatih/color"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/grpc/resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package resolver
import (
"context"

"github.com/douyu/jupiter/pkg/constant"
"github.com/douyu/jupiter/pkg/registry/etcdv3"
"github.com/douyu/jupiter/pkg/core/constant"
"github.com/douyu/jupiter/pkg/core/registry/etcdv3"
"github.com/douyu/jupiter/pkg/util/xgo"
"google.golang.org/grpc/attributes"
"google.golang.org/grpc/resolver"
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/resty/resty.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"github.com/alibaba/sentinel-golang/api"
"github.com/alibaba/sentinel-golang/core/base"
"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/metric"
"github.com/douyu/jupiter/pkg/sentinel"
"github.com/douyu/jupiter/pkg/core/metric"
"github.com/douyu/jupiter/pkg/core/sentinel"
"github.com/douyu/jupiter/pkg/core/xtrace"
"github.com/douyu/jupiter/pkg/util/xdebug"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/douyu/jupiter/pkg/xtrace"
"github.com/go-resty/resty/v2"
"github.com/spf13/cast"
"go.opentelemetry.io/otel/attribute"
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/rocketmq/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"github.com/apache/rocketmq-client-go/v2"
"github.com/apache/rocketmq-client-go/v2/consumer"
"github.com/apache/rocketmq-client-go/v2/primitive"
"github.com/douyu/jupiter/pkg/hooks"
"github.com/douyu/jupiter/pkg/istats"
"github.com/douyu/jupiter/pkg/core/hooks"
"github.com/douyu/jupiter/pkg/core/istats"
"github.com/douyu/jupiter/pkg/core/xtrace"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/douyu/jupiter/pkg/xtrace"
"github.com/juju/ratelimit"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/propagation"
Expand Down
8 changes: 4 additions & 4 deletions pkg/client/rocketmq/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import (
"strings"
"time"

"github.com/douyu/jupiter/pkg/xtrace"
"github.com/douyu/jupiter/pkg/core/xtrace"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"

"github.com/apache/rocketmq-client-go/v2/consumer"
"github.com/apache/rocketmq-client-go/v2/primitive"
"github.com/douyu/jupiter/pkg/imeta"
"github.com/douyu/jupiter/pkg/istats"
"github.com/douyu/jupiter/pkg/metric"
"github.com/douyu/jupiter/pkg/core/imeta"
"github.com/douyu/jupiter/pkg/core/istats"
"github.com/douyu/jupiter/pkg/core/metric"
"github.com/douyu/jupiter/pkg/util/xdebug"
"github.com/douyu/jupiter/pkg/xlog"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/rocketmq/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/constant"
"github.com/douyu/jupiter/pkg/core/constant"
"github.com/douyu/jupiter/pkg/util/xdebug"
"github.com/douyu/jupiter/pkg/xlog"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/rocketmq/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/apache/rocketmq-client-go/v2"
"github.com/apache/rocketmq-client-go/v2/primitive"
"github.com/apache/rocketmq-client-go/v2/producer"
"github.com/douyu/jupiter/pkg/hooks"
"github.com/douyu/jupiter/pkg/istats"
"github.com/douyu/jupiter/pkg/core/hooks"
"github.com/douyu/jupiter/pkg/core/istats"
"github.com/douyu/jupiter/pkg/util/xdebug"
"github.com/douyu/jupiter/pkg/xlog"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/conf/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"log"

"github.com/BurntSushi/toml"
"github.com/douyu/jupiter/pkg/core/hooks"
"github.com/douyu/jupiter/pkg/flag"
"github.com/douyu/jupiter/pkg/hooks"
)

const DefaultEnvPrefix = "APP_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ import (
"time"

//go-lint
_ "github.com/douyu/jupiter/pkg/autoproc"
_ "github.com/douyu/jupiter/pkg/conf/datasource/file"
_ "github.com/douyu/jupiter/pkg/conf/datasource/http"
_ "github.com/douyu/jupiter/pkg/registry/etcdv3"
_ "github.com/douyu/jupiter/pkg/core/autoproc"
_ "github.com/douyu/jupiter/pkg/core/registry/etcdv3"

"github.com/BurntSushi/toml"
"github.com/douyu/jupiter/pkg/component"
"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/core/component"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/hooks"
"github.com/douyu/jupiter/pkg/core/registry"
"github.com/douyu/jupiter/pkg/core/signals"
"github.com/douyu/jupiter/pkg/flag"
"github.com/douyu/jupiter/pkg/hooks"
"github.com/douyu/jupiter/pkg/registry"
"github.com/douyu/jupiter/pkg/server"
"github.com/douyu/jupiter/pkg/signals"
"github.com/douyu/jupiter/pkg/util/xcycle"
"github.com/douyu/jupiter/pkg/util/xdebug"
"github.com/douyu/jupiter/pkg/util/xgo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

"github.com/BurntSushi/toml"
"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/executor/xxl"
"github.com/douyu/jupiter/pkg/hooks"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/executor/xxl"
"github.com/douyu/jupiter/pkg/core/hooks"
"github.com/douyu/jupiter/pkg/server"
"github.com/douyu/jupiter/pkg/server/xgrpc"
. "github.com/smartystreets/goconvey/convey"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/autoproc/autoproc.go → pkg/core/autoproc/autoproc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"runtime"

"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/ecode"
"github.com/douyu/jupiter/pkg/core/ecode"
"github.com/douyu/jupiter/pkg/xlog"
"go.uber.org/automaxprocs/maxprocs"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package component

import "github.com/douyu/jupiter/pkg/metric"
import "github.com/douyu/jupiter/pkg/core/metric"

type Component interface {
// Start blocks until the channel is closed or an error occurs.
Expand Down
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.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/elect/elector.go → pkg/core/elect/elector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package elect
import (
"sync"

"github.com/douyu/jupiter/pkg/component"
"github.com/douyu/jupiter/pkg/core/component"
)

var _ component.Manager = &electorComponent{}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package memelector

import "github.com/douyu/jupiter/pkg/elect"
import "github.com/douyu/jupiter/pkg/core/elect"

type noopLeaderElector struct {
alwaysLeader bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"time"

"cirello.io/pglock"
"github.com/douyu/jupiter/pkg/elect"
"github.com/douyu/jupiter/pkg/core/elect"
"github.com/douyu/jupiter/pkg/xlog"
"go.uber.org/zap"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package rediselector

import "github.com/douyu/jupiter/pkg/elect"
import "github.com/douyu/jupiter/pkg/core/elect"

var _ elect.LeaderElector = &redisLeaderElector{}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"strings"
"time"

"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/executor/xxl/logger"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/executor/xxl/logger"
"github.com/douyu/jupiter/pkg/util/xdebug"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/BurntSushi/toml"
"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/executor/xxl/constants"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/executor/xxl/constants"
"github.com/go-basic/ipv4"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"github.com/douyu/jupiter/pkg/executor/xxl/constants"
"github.com/douyu/jupiter/pkg/core/executor/xxl/constants"
)

type LogIDKey string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/executor/xxl/constants"
"github.com/douyu/jupiter/pkg/core/executor/xxl/constants"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/go-basic/ipv4"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/BurntSushi/toml"
"github.com/douyu/jupiter/pkg/conf"
"github.com/douyu/jupiter/pkg/executor/xxl/constants"
"github.com/douyu/jupiter/pkg/core/executor/xxl/constants"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/executor/xxl/task.go → pkg/core/executor/xxl/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"sync/atomic"
"time"

"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/executor/xxl/logger"
"github.com/douyu/jupiter/pkg/metric"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/executor/xxl/logger"
"github.com/douyu/jupiter/pkg/core/metric"
)

// 任务执行函数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/core/executor"
)

// 测试XJob
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/xxl/util.go → pkg/core/executor/xxl/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strconv"

"github.com/douyu/jupiter/pkg/executor"
"github.com/douyu/jupiter/pkg/executor/xxl/logger"
"github.com/douyu/jupiter/pkg/core/executor"
"github.com/douyu/jupiter/pkg/core/executor/xxl/logger"
)

//int64 to str
Expand Down
Loading

0 comments on commit 82aacbe

Please sign in to comment.