Launch Week Day 4: Introducing Data Exports.Learn More
Socket
Book a DemoSign in
Socket

usa001.o2oyc.com/iris-contrib/sessiondb

Package Overview
Dependencies
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usa001.o2oyc.com/iris-contrib/sessiondb

Go Modules
Version
v0.0.0-20230311211515-1b56118a18e3
Version published
Created
Source

sessiondb

Go Report

Dgraph & MongoDB stores for sessions of kataras/iris.

How to use

Full examples can be found in the examples folder.

Mongo

Mongo Reference

To include mongostore run

go get github.com/iris-contrib/sessiondb/mongostore

Example

	// replace with your running mongo server settings:
	cred := options.Credential{
		AuthSource: "admin",
		Username:   "user",
		Password:   "password",
	}

	clientOpts := options.Client().ApplyURI("mongodb://127.0.0.1:27017").SetAuth(cred)
	db, _ := mongostore.New(clientOpts, "sessions")

	sess := sessions.New(sessions.Config{Cookie: "sessionscookieid"})

	sess.UseDatabase(db)

Dgraph

Dgraph Reference

To include dgraphstore run

go get github.com/iris-contrib/sessiondb/dgraphstore

Example

	// replace with your server settings:
	conn, _ := grpc.Dial("127.0.0.1:9080", grpc.WithInsecure())
	db, _ := dgraphstore.NewFromDB(conn)

	sess := sessions.New(sessions.Config{Cookie: "sessionscookieid"})

	sess.UseDatabase(db)

Contribute

Development of each store is done on branches. If you plan to work with an existing store checkout the corresponding branch. If you intent to implement a new store then create a new branch named after the DB you are using.

The repository is using go-submodules. The rationale behind this optimisation is for user to avoid downloading unnecessary drivers/libraries but keep the maintenance tight and clean.

For releasing a new version of each individual store (submodule) you need to

  • merge from corresponding branch to main
  • tag with appropriate store name and particular store's version ie. git tag mongostore/v0.1.1

FAQs

Package last updated on 11 Mar 2023

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