Skip to content

Commit b900e3a

Browse files
lvan100lianghuan
authored andcommitted
built: adapt go-spring v1.2.3
1 parent 010bba3 commit b900e3a

File tree

8 files changed

+70
-336
lines changed

8 files changed

+70
-336
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2-
vendor
2+
vendor
3+
.idea

README.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1 @@
11
# starter-go-redis
2-
3-
[English](README_EN.md)
4-
5-
[仅发布] 该项目仅为最终发布,不要向该项目直接提交代码,开发请关注 [go-spring](https://github.com/go-spring/go-spring) 项目。
6-
7-
## Installation
8-
9-
### Prerequisites
10-
11-
- Go >= 1.12
12-
13-
### Using go get
14-
15-
```
16-
go get github.com/go-spring/starter-go-redis@v1.1.0-rc2
17-
```
18-
19-
## Quick Start
20-
21-
```
22-
import "github.com/go-spring/starter-go-redis"
23-
```
24-
25-
`main.go`
26-
27-
```
28-
package main
29-
30-
import (
31-
"errors"
32-
"fmt"
33-
34-
"github.com/go-spring/spring-base/util"
35-
"github.com/go-spring/spring-core/gs"
36-
"github.com/go-spring/spring-core/redis"
37-
38-
_ "github.com/go-spring/starter-go-redis"
39-
)
40-
41-
type runner struct {
42-
Client redis.Client `autowire:""`
43-
}
44-
45-
func (r *runner) Run(ctx gs.Context) {
46-
47-
_, err := r.Client.Get(ctx.Context(), "nonexisting")
48-
if err != redis.ErrNil {
49-
panic(errors.New("should be redis.ErrNil"))
50-
}
51-
52-
_, err = r.Client.Set(ctx.Context(), "mykey", "Hello")
53-
util.Panic(err).When(err != nil)
54-
55-
v, err := r.Client.Get(ctx.Context(), "mykey")
56-
util.Panic(err).When(err != nil)
57-
if v != "Hello" {
58-
panic(errors.New("should be \"Hello\""))
59-
}
60-
61-
fmt.Printf("GET mykey=%q\n", v)
62-
go gs.ShutDown()
63-
}
64-
65-
func main() {
66-
gs.Object(&runner{}).Export((*gs.AppRunner)(nil))
67-
fmt.Printf("program exited %v\n", gs.Web(false).Run())
68-
}
69-
```
70-
71-
## Configuration

README_EN.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1 @@
11
# starter-go-redis
2-
3-
[中文](README.md)
4-
5-
[仅发布] 该项目仅为最终发布,不要向该项目直接提交代码,开发请关注 [go-spring](https://github.com/go-spring/go-spring) 项目。
6-
7-
## Installation
8-
9-
### Prerequisites
10-
11-
- Go >= 1.12
12-
13-
### Using go get
14-
15-
```
16-
go get github.com/go-spring/starter-go-redis@v1.1.0-rc2
17-
```
18-
19-
## Quick Start
20-
21-
```
22-
import "github.com/go-spring/starter-go-redis"
23-
```
24-
25-
`main.go`
26-
27-
```
28-
package main
29-
30-
import (
31-
"errors"
32-
"fmt"
33-
34-
"github.com/go-spring/spring-base/util"
35-
"github.com/go-spring/spring-core/gs"
36-
"github.com/go-spring/spring-core/redis"
37-
38-
_ "github.com/go-spring/starter-go-redis"
39-
)
40-
41-
type runner struct {
42-
Client redis.Client `autowire:""`
43-
}
44-
45-
func (r *runner) Run(ctx gs.Context) {
46-
47-
_, err := r.Client.Get(ctx.Context(), "nonexisting")
48-
if err != redis.ErrNil {
49-
panic(errors.New("should be redis.ErrNil"))
50-
}
51-
52-
_, err = r.Client.Set(ctx.Context(), "mykey", "Hello")
53-
util.Panic(err).When(err != nil)
54-
55-
v, err := r.Client.Get(ctx.Context(), "mykey")
56-
util.Panic(err).When(err != nil)
57-
if v != "Hello" {
58-
panic(errors.New("should be \"Hello\""))
59-
}
60-
61-
fmt.Printf("GET mykey=%q\n", v)
62-
go gs.ShutDown()
63-
}
64-
65-
func main() {
66-
gs.Object(&runner{}).Export((*gs.AppRunner)(nil))
67-
fmt.Printf("program exited %v\n", gs.Web(false).Run())
68-
}
69-
```
70-
71-
## Configuration

example/config/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/example.go

Lines changed: 0 additions & 56 deletions
This file was deleted.

go.mod

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
module github.com/go-spring/starter-go-redis
22

3-
go 1.14
3+
go 1.24
44

55
require (
6-
github.com/go-spring/spring-base v1.1.3
7-
github.com/go-spring/spring-core v1.1.3
8-
github.com/go-spring/spring-go-redis v1.1.3
6+
github.com/go-spring/spring-core v1.2.3
7+
github.com/redis/go-redis/v9 v9.12.1
98
)
109

11-
//replace (
12-
// github.com/go-spring/spring-base => ../../spring/spring-base
13-
// github.com/go-spring/spring-core => ../../spring/spring-core
14-
// github.com/go-spring/spring-go-redis => ../../spring/spring-go-redis
15-
//)
10+
require (
11+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
12+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
13+
github.com/expr-lang/expr v1.17.5 // indirect
14+
github.com/go-spring/barky v1.0.3 // indirect
15+
github.com/go-spring/gs-mock v0.0.4 // indirect
16+
github.com/go-spring/log v0.0.6 // indirect
17+
github.com/magiconair/properties v1.8.10 // indirect
18+
github.com/pelletier/go-toml v1.9.5 // indirect
19+
github.com/spf13/cast v1.9.2 // indirect
20+
gopkg.in/yaml.v2 v2.4.0 // indirect
21+
)

0 commit comments

Comments
 (0)