repo

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 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 GroupRepo

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

func NewGroupRepo

func NewGroupRepo(store database.Storer, db *database.Database) *GroupRepo

func (GroupRepo) All

func (p GroupRepo) All() ([]core.Group, error)

func (GroupRepo) Delete

func (p GroupRepo) Delete(name string) error

func (GroupRepo) Exists

func (p GroupRepo) Exists(name string) (bool, error)

func (GroupRepo) Get

func (p GroupRepo) Get(name string) (core.Group, error)

func (GroupRepo) GroupsFor

func (p GroupRepo) GroupsFor(userID store.Identity) ([]core.Group, error)

func (GroupRepo) Set

func (p GroupRepo) Set(group core.Group) error

type SessionRepo

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

func NewSessionRepo

func NewSessionRepo(store database.Storer, db *database.Database) *SessionRepo

func (SessionRepo) All

func (p SessionRepo) All() ([]core.Session, error)

func (SessionRepo) Delete

func (p SessionRepo) Delete(token string) error

func (SessionRepo) DoLogin added in v0.4.0

DoLogin executes a login request. It returns a user, session (possibly both empty) and a LoginResult. The error will be nil if (and only if) the result is LoginResultError.

func (SessionRepo) Exists

func (p SessionRepo) Exists(token string) (bool, error)

Exists checks whether a specific core.Session exists

func (SessionRepo) GenerateFor

func (p SessionRepo) GenerateFor(userID store.Identity, ip string) core.Session

GenerateFor makes a new core.Session for the specified userID but does not check if the id exists or persist anything to the database.

func (SessionRepo) Get

func (p SessionRepo) Get(token string) (core.Session, error)

func (SessionRepo) PurgeAll

func (p SessionRepo) PurgeAll() error

func (SessionRepo) Set

func (p SessionRepo) Set(session core.Session) error

Set saves a core.Session to the database

func (SessionRepo) UpdateHeartbeat

func (p SessionRepo) UpdateHeartbeat(session *core.Session, ip string) error

type UserGroupRepo

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

func NewUserGroupRepo

func NewUserGroupRepo(store database.Storer, db *database.Database) *UserGroupRepo

func (UserGroupRepo) All

func (p UserGroupRepo) All() ([]core.UserGroup, error)

func (UserGroupRepo) Delete

func (p UserGroupRepo) Delete(userID store.Identity, groupName string) error

func (UserGroupRepo) Exists

func (p UserGroupRepo) Exists(userID store.Identity, groupName string) (bool, error)

func (UserGroupRepo) Get

func (p UserGroupRepo) Get(userID store.Identity, groupName string) (core.UserGroup, error)

func (UserGroupRepo) Set

func (p UserGroupRepo) Set(userGroup core.UserGroup) error

type UserRepo

type UserRepo struct {
	core.UserSearcher
	// contains filtered or unexported fields
}

func NewUserRepo

func NewUserRepo(store database.Storer, db *database.Database, search core.UserSearcher) *UserRepo

func (UserRepo) All

func (p UserRepo) All() ([]core.User, error)

func (UserRepo) Count

func (p UserRepo) Count() (int, error)

func (UserRepo) Delete

func (p UserRepo) Delete(userID store.Identity) error

func (UserRepo) Exists

func (p UserRepo) Exists(userID store.Identity) (bool, error)

func (UserRepo) Get

func (p UserRepo) Get(userID store.Identity) (core.User, error)

func (UserRepo) PurgeAll

func (p UserRepo) PurgeAll() error

func (UserRepo) Set

func (p UserRepo) Set(user core.User) error

func (UserRepo) UsersFor

func (p UserRepo) UsersFor(groupName string) ([]core.User, error)

Jump to

Keyboard shortcuts

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