backend_mongo

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 8 Imported by: 0

README

Identity Mongo DB backend Impl

mongod --smallfiles --bind_ip_all --replSet rs0 --dbpath=$HOME/mongodb

mongo> rs.initiate({_id: "rs0", members: [{_id: 0, host: "127.0.0.1:27017"}] })
mongo> db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func New

func New(ops Options) (*Backend, error)

func (*Backend) Cleanup

func (b *Backend) Cleanup(ctx context.Context) error

func (*Backend) CreateAuthentication

func (b *Backend) CreateAuthentication(ctx context.Context, id string, objective identity.AuthenticationObjective, userID string) (*identity.Authentication, error)

func (*Backend) CreateUser

func (b *Backend) CreateUser(ctx context.Context, user *identity.User) (*identity.User, error)

func (*Backend) GetAuthentication

func (b *Backend) GetAuthentication(ctx context.Context, id string) (*identity.Authentication, error)

func (*Backend) GetUser

func (b *Backend) GetUser(ctx context.Context, id string) (*identity.User, error)

func (*Backend) GetUserByIdentity

func (b *Backend) GetUserByIdentity(ctx context.Context, idnName, idn string) (*identity.User, error)

func (*Backend) RemoveAuthentication

func (b *Backend) RemoveAuthentication(ctx context.Context, id string) error

func (*Backend) SaveAuthentication

func (b *Backend) SaveAuthentication(ctx context.Context, auth *identity.Authentication) (result *identity.Authentication, err error)

func (*Backend) SaveUser

func (b *Backend) SaveUser(ctx context.Context, user *identity.User) (result *identity.User, err error)

type Options

type Options struct {
	DBName           string
	CollectionPrefix string
	URI              string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL