Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can support incrdecr and keys #102

Open
Luoxin opened this issue Jul 11, 2021 · 1 comment
Open

can support incrdecr and keys #102

Luoxin opened this issue Jul 11, 2021 · 1 comment

Comments

@Luoxin
Copy link

Luoxin commented Jul 11, 2021

No description provided.

@Luoxin Luoxin changed the title can support incr and decr and keys can support incrdecr and keys Jul 11, 2021
@GwynethLlewelyn
Copy link

GwynethLlewelyn commented Aug 22, 2021

Hello,

Is this a question?

As far as I know, gokv supports Get(), Set() and Delete() (and Close() at the end).

See https://github.com/philippgille/gokv/#simple-interface:

type Store interface {
    Set(k string, v interface{}) error
    Get(k string, v interface{}) (found bool, err error)
    Delete(k string) error
    Close() error
}

where v is basically whatever structure/type you wish.

Everything else it's up to you to write! You can use int for v, and write an incr(k string) function that gets the value for a key, increments it, and sets it again with the new value (and similarly for decr(k string)). I'm not sure what you mean with keys — a list of keys that store a specific value? Well, again, you'll have to do all that by yourself...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants