Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ type Cmdable interface {
GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd

FunctionKill(ctx context.Context) *StringCmd
}

type StatefulCmdable interface {
Expand Down Expand Up @@ -3587,3 +3589,10 @@ func (c cmdable) GeoPos(ctx context.Context, key string, members ...string) *Geo
_ = c(ctx, cmd)
return cmd
}

// FunctionKill kills the current running function
func (c cmdable) FunctionKill(ctx context.Context) *StringCmd {
cmd := NewStringCmd(ctx, "FUNCTION KILL")
_ = c(ctx, cmd)
return cmd
}
11 changes: 11 additions & 0 deletions commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6034,6 +6034,17 @@ var _ = Describe("Commands", func() {
Expect(len(result)).NotTo(BeZero())
})
})

Describe("Functions", func() {
It("should FUNCTION KILL", func() {
fKill := client.FunctionKill(ctx)
Expect(fKill.Err()).Should(Equal("No scripts in execution right now."))

/**
* as other function commands are added, more test cases are to be added
*/
})
})
})

type numberStruct struct {
Expand Down