# README
dp-redis
Getting started
- Add dp-redis to your project using
go get github.com/ONSdigital/dp-redis
Dependencies
- No further dependencies other than those defined in go.mod
Usage
Sample use of GetByID()
:
s represents a Session in all examples
s, err := cache.GetByID(ID)
if err != nil {
panic(err)
return
}
Sample use of SetSession()
:
s := &session.Session{
ID: "1234",
Email: "[email protected]",
Start: time.Time{},
LastAccessed: time.Time{},
}
if err := cache.Set(s); err != nil {
panic(err)
return
}
Sample use of DeleteAll()
:
if err := cache.DeleteAll(); err != nil {
panic(err)
return
}
Contributing
See CONTRIBUTING for details.
License
Copyright © 2020, Office for National Statistics (https://www.ons.gov.uk)
Released under MIT license, see LICENSE for details.
# Functions
NewClient - returns new redis client with provided config options.
# Constants
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Client - structure for the redis client.
Config - config options for the redis client.
RedisClienterMock is a mock implementation of RedisClienter.
# Interfaces
RedisClienter - interface for redis.