Compare commits

...

9 Commits

Author SHA1 Message Date
re 742df17fb8 Merge remote-tracking branch 'upstream/v8' into v8 2023-01-10 14:16:04 +03:00
Monkey 6c688c7e9f
Merge pull request #2341 from monkey92t/v8
test(action): add tests to the v8 branch
2023-01-06 01:50:19 +08:00
monkey92t 57918584b8 test(github-action): update v8 test services-redis version, to redis6
Signed-off-by: monkey92t <golang@88.com>
2023-01-06 01:35:23 +08:00
monkey92t 92fb134b81 test: update the go version of the v8 branch test
Signed-off-by: monkey92t <golang@88.com>
2023-01-05 19:20:57 +08:00
monkey92t 2556b76824 test(action): add tests to the v8 branch
Signed-off-by: monkey92t <golang@88.com>
2023-01-05 19:19:08 +08:00
Monkey 6a0c42198f
Merge pull request #2340 from monkey92t/v8
feat: v8 remove redis7 command
2023-01-05 19:17:35 +08:00
monkey92t 0a57079ece feat: v8 remove redis7 command
Signed-off-by: monkey92t <golang@88.com>
2023-01-05 19:14:20 +08:00
Monkey 5c486cf98a
Merge pull request #2335 from monkey92t/issue_2319
fix: hook.process.fn should return error instead of cmd.SetErr().
2022-12-29 19:22:29 +08:00
monkey92t 0358ca4bfe fix: hook.process.fn should return error instead of cmd.SetErr()
Signed-off-by: monkey92t <golang@88.com>
2022-12-29 17:04:57 +08:00
4 changed files with 17 additions and 39 deletions

View File

@ -2,9 +2,9 @@ name: Go
on: on:
push: push:
branches: [master] branches: [master, v8]
pull_request: pull_request:
branches: [master] branches: [master, v8]
jobs: jobs:
build: build:
@ -13,11 +13,11 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
go-version: [1.17.x, 1.18.x] go-version: [1.18.x, 1.19.x]
services: services:
redis: redis:
image: redis image: redis:6.2.8
options: >- options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports: ports:

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
*.rdb *.rdb
testdata/*/ testdata/*
.idea/ .idea/

View File

@ -18,11 +18,12 @@ func (c *ClusterClient) DBSize(ctx context.Context) *IntCmd {
atomic.AddInt64(&size, n) atomic.AddInt64(&size, n)
return nil return nil
}) })
if err != nil { if err != nil {
cmd.SetErr(err) return err
} else {
cmd.val = size
} }
cmd.val = size
return nil return nil
}) })
return cmd return cmd
@ -46,10 +47,8 @@ func (c *ClusterClient) ScriptLoad(ctx context.Context, script string) *StringCm
return nil return nil
}) })
if err != nil {
cmd.SetErr(err) return err
}
return nil
}) })
return cmd return cmd
} }
@ -60,10 +59,8 @@ func (c *ClusterClient) ScriptFlush(ctx context.Context) *StatusCmd {
err := c.ForEachShard(ctx, func(ctx context.Context, shard *Client) error { err := c.ForEachShard(ctx, func(ctx context.Context, shard *Client) error {
return shard.ScriptFlush(ctx).Err() return shard.ScriptFlush(ctx).Err()
}) })
if err != nil {
cmd.SetErr(err) return err
}
return nil
}) })
return cmd return cmd
} }
@ -98,11 +95,12 @@ func (c *ClusterClient) ScriptExists(ctx context.Context, hashes ...string) *Boo
return nil return nil
}) })
if err != nil { if err != nil {
cmd.SetErr(err) return err
} else {
cmd.val = result
} }
cmd.val = result
return nil return nil
}) })
return cmd return cmd

View File

@ -96,10 +96,6 @@ type Cmdable interface {
Exists(ctx context.Context, keys ...string) *IntCmd Exists(ctx context.Context, keys ...string) *IntCmd
Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
Keys(ctx context.Context, pattern string) *StringSliceCmd Keys(ctx context.Context, pattern string) *StringSliceCmd
Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
Move(ctx context.Context, key string, db int) *BoolCmd Move(ctx context.Context, key string, db int) *BoolCmd
@ -534,22 +530,6 @@ func (c cmdable) Expire(ctx context.Context, key string, expiration time.Duratio
return c.expire(ctx, key, expiration, "") return c.expire(ctx, key, expiration, "")
} }
func (c cmdable) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
return c.expire(ctx, key, expiration, "NX")
}
func (c cmdable) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
return c.expire(ctx, key, expiration, "XX")
}
func (c cmdable) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
return c.expire(ctx, key, expiration, "GT")
}
func (c cmdable) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
return c.expire(ctx, key, expiration, "LT")
}
func (c cmdable) expire( func (c cmdable) expire(
ctx context.Context, key string, expiration time.Duration, mode string, ctx context.Context, key string, expiration time.Duration, mode string,
) *BoolCmd { ) *BoolCmd {