backends

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	CreateUser(context.Context, *models.User) (out *models.User, err error)
	UpdateUser(context.Context, *models.User) (out *models.User, err error)
	GetUser(ctx context.Context, subject string) (out *models.User, err error)
	ListUsers(context.Context) (out []*models.User, err error)
	Ping(context.Context) error
}

type Memory

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

func NewMemoryBackend

func NewMemoryBackend(options *models.BackendOptions) *Memory

func (Memory) CreateUser

func (m Memory) CreateUser(ctx context.Context, in *pkgModels.User) (out *pkgModels.User, err error)

func (Memory) GetUser

func (m Memory) GetUser(ctx context.Context, subject string) (out *pkgModels.User, err error)

func (Memory) ListUsers

func (m Memory) ListUsers(ctx context.Context) (out []*pkgModels.User, err error)

func (Memory) Ping

func (m Memory) Ping(ctx context.Context) error

func (Memory) UpdateUser

func (m Memory) UpdateUser(ctx context.Context, in *pkgModels.User) (out *pkgModels.User, err error)

type Mongo

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

func NewMongoBackend

func NewMongoBackend(ctx context.Context, options *models.BackendOptions) (*Mongo, error)

func (Mongo) CreateUser

func (m Mongo) CreateUser(ctx context.Context, in *pkgModels.User) (out *pkgModels.User, err error)

func (Mongo) GetUser

func (m Mongo) GetUser(ctx context.Context, sub string) (out *pkgModels.User, err error)

func (Mongo) ListUsers

func (m Mongo) ListUsers(ctx context.Context) (out []*pkgModels.User, err error)

func (Mongo) Ping

func (m Mongo) Ping(ctx context.Context) error

func (Mongo) UpdateUser

func (m Mongo) UpdateUser(ctx context.Context, in *pkgModels.User) (out *pkgModels.User, err error)

Jump to

Keyboard shortcuts

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