Skip to content

Commit

Permalink
Revert "Revert "refactor: v1 to 2.x init (#47)" (#48)"
Browse files Browse the repository at this point in the history
This reverts commit 60c5929.
  • Loading branch information
flc1125 authored Jan 5, 2024
1 parent 60c5929 commit 2420595
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Go Test
on:
push:
branches: [ 1.x, feature/* ]
branches: [ 1.x, 2.x, feature/* ]
pull_request:
branches: [ 1.x ]
branches: [ 1.x, 2.x ]
env:
GOPROXY: "https://proxy.golang.org"

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
vendor/
.idea
_backup
example
example
.todo
14 changes: 0 additions & 14 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Installation

```bash
go get github.com/go-packagist/go-kratos-components
go get github.com/go-kratos-ecosystem/components/v2
```

## Components
Expand Down
5 changes: 0 additions & 5 deletions contract/generator/generator.go

This file was deleted.

4 changes: 2 additions & 2 deletions crontab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/redis/go-redis/v9"
"github.com/robfig/cron/v3"

"github.com/go-packagist/go-kratos-components/crontab"
redisMutex "github.com/go-packagist/go-kratos-components/crontab/mutex/redis"
"github.com/go-kratos-ecosystem/components/v2/crontab"
redisMutex "github.com/go-kratos-ecosystem/components/v2/crontab/mutex/redis"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion crontab/mutex/redis/mutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/google/uuid"
"github.com/redis/go-redis/v9"

"github.com/go-packagist/go-kratos-components/crontab"
"github.com/go-kratos-ecosystem/components/v2/crontab"
)

type Mutex struct {
Expand Down
2 changes: 1 addition & 1 deletion crontab/mutex/redis/mutex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"

"github.com/go-packagist/go-kratos-components/crontab"
"github.com/go-kratos-ecosystem/components/v2/crontab"
)

var (
Expand Down
3 changes: 0 additions & 3 deletions crontab/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ import (
"sync"
"time"

"github.com/go-kratos/kratos/v2/transport"
"github.com/robfig/cron/v3"
)

var _ transport.Server = (*Server)(nil)

type Server struct {
cron *cron.Cron

Expand Down
3 changes: 2 additions & 1 deletion generator/uuid/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package uuid
import (
"testing"

"github.com/go-packagist/go-kratos-components/strable"
"github.com/stretchr/testify/assert"

"github.com/go-kratos-ecosystem/components/v2/strable"
)

func TestGenerate(t *testing.T) {
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/go-packagist/go-kratos-components
module github.com/go-kratos-ecosystem/components/v2

go 1.20

Expand All @@ -18,12 +18,13 @@ require (
github.com/go-kratos/aegis v0.2.0 // indirect
github.com/go-playground/form/v4 v4.2.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sync v0.3.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
27 changes: 14 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -38,21 +38,22 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g=
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos=
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
5 changes: 3 additions & 2 deletions hashing/hashing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package hashing_test
import (
"testing"

"github.com/go-packagist/go-kratos-components/hashing"
_ "github.com/go-packagist/go-kratos-components/hashing/md5"
"github.com/stretchr/testify/assert"

"github.com/go-kratos-ecosystem/components/v2/hashing"
_ "github.com/go-kratos-ecosystem/components/v2/hashing/md5"
)

func TestHasher_New(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion hashing/md5/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/md5"
"fmt"

"github.com/go-packagist/go-kratos-components/hashing"
"github.com/go-kratos-ecosystem/components/v2/hashing"
)

type hasher struct{}
Expand Down
2 changes: 1 addition & 1 deletion serializer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package serializer_test
import (
"log"

"github.com/go-packagist/go-kratos-components/serializer/json"
"github.com/go-kratos-ecosystem/components/v2/serializer/json"
)

var j = json.Serializer
Expand Down
2 changes: 1 addition & 1 deletion serializer/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package serializer_test
import (
"log"

"github.com/go-packagist/go-kratos-components/serializer/json"
"github.com/go-kratos-ecosystem/components/v2/serializer/json"
)

var j = json.Serializer
Expand Down
2 changes: 1 addition & 1 deletion serializer/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package json
import (
"encoding/json"

"github.com/go-packagist/go-kratos-components/serializer"
"github.com/go-kratos-ecosystem/components/v2/serializer"
)

var Serializer serializer.Serializable = &jsonSerializer{}
Expand Down
2 changes: 1 addition & 1 deletion udp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/go-kratos/kratos/v2"

"github.com/go-packagist/go-kratos-components/udp"
"github.com/go-kratos-ecosystem/components/v2/udp"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions x/cache/redis/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/redis/go-redis/v9"

"github.com/go-packagist/go-kratos-components/serializer"
"github.com/go-packagist/go-kratos-components/serializer/json"
"github.com/go-packagist/go-kratos-components/x/cache"
"github.com/go-kratos-ecosystem/components/v2/serializer"
"github.com/go-kratos-ecosystem/components/v2/serializer/json"
"github.com/go-kratos-ecosystem/components/v2/x/cache"
)

type Store struct {
Expand Down
2 changes: 1 addition & 1 deletion x/cache/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"github.com/go-packagist/go-kratos-components/helper"
"github.com/go-kratos-ecosystem/components/v2/helper"
)

type Repository interface {
Expand Down

0 comments on commit 2420595

Please sign in to comment.