šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

github.com/onsdigital/dp-redis

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/onsdigital/dp-redis

v1.0.0
Source
Go
Version published
Created
Source

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:        "user@email.com",
        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.

FAQs

Package last updated on 06 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts