Skip to content

How KVStore use generic to store data #1397

@libchaos

Description

@libchaos

I want to use different data type in kvstore, not only string data type, how to implement like this

type Score struct {
  level int
  time time.Time
}
err := ctx.KVStore[uint32, Score].Set(1, &Score{level:1, time: time.Now()})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions