Skip to content

Commit

Permalink
add dag
Browse files Browse the repository at this point in the history
  • Loading branch information
daijunkai authored and day253 committed Dec 13, 2024
1 parent 20dd864 commit fc5a1c0
Show file tree
Hide file tree
Showing 85 changed files with 173 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ compile-proto: proto
PATH=$(GOBIN):$$PATH && \
cd $$idl && \
find . -maxdepth 10 ! -name "prediction.thrift" -type f -exec rm -rf {} \; && \
kitex -module github.com/ishumei/krpc -service $$idl prediction.thrift && \
kitex -module github.com/day253/krpc -service $$idl prediction.thrift && \
cd -; \
done

Expand Down
2 changes: 1 addition & 1 deletion asyncwriter/async_write_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/ishumei/krpc/bufferpool"
"github.com/day253/krpc/bufferpool"
"go.uber.org/zap/zapcore"
)

Expand Down
12 changes: 6 additions & 6 deletions boilerplate/cmd/press/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"github.com/bytedance/gopkg/util/gopool"
json "github.com/bytedance/sonic"
"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/conf"
"github.com/ishumei/krpc/kclient"
"github.com/ishumei/krpc/kserver"
"github.com/ishumei/krpc/objects"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/ishumei/krpc/zookeeper"
"github.com/day253/krpc/conf"
"github.com/day253/krpc/kclient"
"github.com/day253/krpc/kserver"
"github.com/day253/krpc/objects"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/zookeeper"
"go.uber.org/ratelimit"
)

Expand Down
6 changes: 3 additions & 3 deletions boilerplate/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"flag"

"github.com/ishumei/krpc/boilerplate/pkg/handler"
"github.com/ishumei/krpc/kserver"
"github.com/ishumei/krpc/kserver/arbiter"
"github.com/day253/krpc/boilerplate/pkg/handler"
"github.com/day253/krpc/kserver"
"github.com/day253/krpc/kserver/arbiter"
"github.com/samber/do"
)

Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/apollo/enviroment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package apollo

import (
"github.com/cloudwego/kitex/pkg/klog"
"github.com/day253/krpc/objects"
"github.com/expr-lang/expr/vm"
"github.com/ishumei/krpc/objects"
"github.com/sourcegraph/conc/pool"
"gorm.io/gorm"
)
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package conf

import (
"github.com/creasty/defaults"
"github.com/ishumei/krpc/conf"
"github.com/ishumei/krpc/zookeeper"
"github.com/day253/krpc/conf"
"github.com/day253/krpc/zookeeper"
"github.com/samber/do"
)

Expand Down
6 changes: 3 additions & 3 deletions boilerplate/pkg/global/apollo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package global

import (
json "github.com/bytedance/sonic"
"github.com/ishumei/krpc/deepcopy"
"github.com/ishumei/krpc/objects"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/deepcopy"
"github.com/day253/krpc/objects"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/jinzhu/copier"
"github.com/samber/lo"
)
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/global/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package global
import (
"context"

"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
)

type strategyKeyType struct{}
Expand Down
14 changes: 7 additions & 7 deletions boilerplate/pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"github.com/bytedance/gopkg/util/gopool"
json "github.com/bytedance/sonic"
"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/kclient"
"github.com/ishumei/krpc/kserver"
"github.com/ishumei/krpc/logging"
"github.com/ishumei/krpc/objects"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/ishumei/krpc/zookeeper"
"github.com/day253/krpc/kclient"
"github.com/day253/krpc/kserver"
"github.com/day253/krpc/logging"
"github.com/day253/krpc/objects"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/day253/krpc/zookeeper"
"github.com/jncornett/doublebuf"
"github.com/samber/do"
"github.com/samber/lo"
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/models/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/objects"
)

type DetailsHook interface {
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/models/diff.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

import (
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/objects"
"github.com/wI2L/jsondiff"
)

Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/models/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/objects"
)

type FeaturesHook interface {
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/models/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/cloudwego/kitex/transport"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/objects"
"github.com/samber/do"
"github.com/samber/lo"
)
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/models/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package models
import (
"context"

"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/objects"
)

type Move struct {
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/models/move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/boilerplate/pkg/conf"
)

func TestMove_Run(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions boilerplate/pkg/models/predictor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (

json "github.com/bytedance/sonic"
"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/boilerplate/pkg/global"
"github.com/ishumei/krpc/deepcopy"
"github.com/ishumei/krpc/objects"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/boilerplate/pkg/global"
"github.com/day253/krpc/deepcopy"
"github.com/day253/krpc/objects"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/samber/do"
)

Expand Down
8 changes: 4 additions & 4 deletions boilerplate/pkg/models/predictor_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/cloudwego/kitex/pkg/discovery"
"github.com/cloudwego/kitex/pkg/retry"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/kserver"
"github.com/ishumei/krpc/monitor"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/kserver"
"github.com/day253/krpc/monitor"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/kitex-contrib/obs-opentelemetry/tracing"
"github.com/samber/do"
)
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/models/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package models
import (
"context"

"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/objects"
"github.com/jinzhu/copier"
)

Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/models/send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/boilerplate/pkg/conf"
)

func TestSend_Run(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions boilerplate/pkg/strategies/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"time"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/dag"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/boilerplate/pkg/models"
"github.com/day253/dag"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/boilerplate/pkg/models"
"github.com/jinzhu/copier"
)

Expand Down
2 changes: 1 addition & 1 deletion boilerplate/pkg/strategies/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/boilerplate/pkg/models"
"github.com/day253/krpc/boilerplate/pkg/models"
"github.com/samber/do"
"github.com/stretchr/testify/assert"
)
Expand Down
10 changes: 5 additions & 5 deletions boilerplate/pkg/strategies/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"path/filepath"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/boilerplate/pkg/conf"
"github.com/ishumei/krpc/boilerplate/pkg/models"
"github.com/ishumei/krpc/kserver"
"github.com/ishumei/krpc/objects"
"github.com/ishumei/krpc/zookeeper"
"github.com/day253/krpc/boilerplate/pkg/conf"
"github.com/day253/krpc/boilerplate/pkg/models"
"github.com/day253/krpc/kserver"
"github.com/day253/krpc/objects"
"github.com/day253/krpc/zookeeper"
"github.com/samber/do"
)

Expand Down
4 changes: 2 additions & 2 deletions boilerplate/pkg/strategies/flow.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package strategies

import (
"github.com/ishumei/krpc/boilerplate/pkg/models"
"github.com/ishumei/krpc/objects"
"github.com/day253/krpc/boilerplate/pkg/models"
"github.com/day253/krpc/objects"
"github.com/jinzhu/copier"
)

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ishumei/krpc
module github.com/day253/krpc

go 1.19

Expand All @@ -12,11 +12,11 @@ require (
github.com/cloudwego/gopkg v0.1.2
github.com/cloudwego/kitex v0.11.3
github.com/creasty/defaults v1.8.0
github.com/day253/dag v0.0.0-20241213080416-d0dbc5d98825
github.com/day253/lumberjack v0.0.0-20241212112149-cb6d952ed6b0
github.com/expr-lang/expr v1.16.9
github.com/go-zookeeper/zk v1.0.4
github.com/huandu/go-clone v1.7.2
github.com/ishumei/dag v0.0.0-20241018081312-9f658ddc8807
github.com/ishumei/lumberjack v0.0.0-20241017112125-0307cf67c51c
github.com/jinzhu/copier v0.4.0
github.com/jncornett/doublebuf v0.2.0
github.com/kitex-contrib/obs-opentelemetry v0.2.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/day253/dag v0.0.0-20241213080416-d0dbc5d98825 h1:/nStGUP+CuD35QjCFiGOz4E3DW0ruQMPJO63b9NMOjg=
github.com/day253/dag v0.0.0-20241213080416-d0dbc5d98825/go.mod h1:7THxwsYadB6fWX/kE3FsAoFytpTYepnWkUFtiDKUaXE=
github.com/day253/lumberjack v0.0.0-20241212112149-cb6d952ed6b0 h1:W339cQh6qmf+xsUVgPvwerMF2Xx/W2W3f3pjgA4Q2wc=
github.com/day253/lumberjack v0.0.0-20241212112149-cb6d952ed6b0/go.mod h1:WE4TbzHc+rKSpMp9cq0+9UmDi7x1xg8m82B+qmv63WY=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
Expand Down Expand Up @@ -343,10 +347,6 @@ github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/ishumei/dag v0.0.0-20241018081312-9f658ddc8807 h1:/Tm+k2BF5FGb/061zIMI3BpxE3xXl+lv5zzySg1B8jU=
github.com/ishumei/dag v0.0.0-20241018081312-9f658ddc8807/go.mod h1:3L0hjobNR6FSB1E/6jNBE5bZxpTpVNB1jGKHTT3GZ9o=
github.com/ishumei/lumberjack v0.0.0-20241017112125-0307cf67c51c h1:6XjxbkPaLCIdsV1EwD/OxYcuEGnneR+gvq20WTpGKjM=
github.com/ishumei/lumberjack v0.0.0-20241017112125-0307cf67c51c/go.mod h1:hYOdx4ajVy9Mzo7tBPGTfLu94Tb/3iUAqXRqp/KJ8IQ=
github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0=
github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
Expand Down
2 changes: 1 addition & 1 deletion kclient/arbiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kclient
import (
"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/discovery"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"github.com/samber/do"
)

Expand Down
2 changes: 1 addition & 1 deletion kclient/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kclient
import (
"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/discovery"
"github.com/ishumei/krpc/protocols/audio/kitex_gen/shumei/strategy/re/audiopredictor"
"github.com/day253/krpc/protocols/audio/kitex_gen/shumei/strategy/re/audiopredictor"
"github.com/samber/do"
)

Expand Down
2 changes: 1 addition & 1 deletion kclient/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/cloudwego/kitex/pkg/retry"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/cloudwego/kitex/transport"
"github.com/ishumei/krpc/monitor"
"github.com/day253/krpc/monitor"
"github.com/kitex-contrib/obs-opentelemetry/tracing"
)

Expand Down
2 changes: 1 addition & 1 deletion kclient/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kclient

import (
"github.com/cloudwego/kitex/pkg/connpool"
"github.com/ishumei/krpc/zookeeper"
"github.com/day253/krpc/zookeeper"
"github.com/samber/do"
)

Expand Down
2 changes: 1 addition & 1 deletion kclient/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kclient
import (
"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/discovery"
"github.com/ishumei/krpc/protocols/event/kitex_gen/shumei/strategy/re/eventpredictor"
"github.com/day253/krpc/protocols/event/kitex_gen/shumei/strategy/re/eventpredictor"
"github.com/samber/do"
)

Expand Down
4 changes: 2 additions & 2 deletions kclient/example/cmd/arbiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/kclient"
"github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
"github.com/day253/krpc/kclient"
"github.com/day253/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
)

func arbiter() {
Expand Down
4 changes: 2 additions & 2 deletions kclient/example/cmd/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/kclient"
"github.com/ishumei/krpc/protocols/audio/kitex_gen/shumei/strategy/re"
"github.com/day253/krpc/kclient"
"github.com/day253/krpc/protocols/audio/kitex_gen/shumei/strategy/re"
)

func audio() {
Expand Down
4 changes: 2 additions & 2 deletions kclient/example/cmd/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/ishumei/krpc/kclient"
"github.com/ishumei/krpc/protocols/event/kitex_gen/shumei/strategy/re"
"github.com/day253/krpc/kclient"
"github.com/day253/krpc/protocols/event/kitex_gen/shumei/strategy/re"
)

func event() {
Expand Down
Loading

0 comments on commit fc5a1c0

Please sign in to comment.