Skip to main content
gFly v1.15.1
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Redis

Create a new Caching connection.

caching, err := gfly.Caching()
if err != nil {
    return nil, err
}

Get from Caching.

val, err := caching.Get(context.Background(), userID.String()).Result()
if err != nil {
    return nil, err
}

Update to Caching.

err := caching.Set(context.Background(), userID.String(), tokens.Refresh, 0).Err()
if err != nil {
    return nil, err
}