users

package
v0.0.0-...-2cf57f6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserIDDuplicates means user ids duplicate
	ErrUserIDDuplicates = xerrors.New("user ids duplicate")

	// ErrUnknownUser means user is unknown
	ErrUnknownUser = xerrors.New("unknown user")

	// ErrUnknownRoleBinding means role binding is unknown
	ErrUnknownRoleBinding = xerrors.New("unknown role binding")
)

Functions

This section is empty.

Types

type RoleBindingsStore

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

func NewRoleBindingsStore

func NewRoleBindingsStore(db sqlx.ExtContext) *RoleBindingsStore

func (*RoleBindingsStore) GetRoleBinding

func (s *RoleBindingsStore) GetRoleBinding(userSeqID, targetSeqID int) (*roles.Role, error)

func (*RoleBindingsStore) RegisterRoleBinding

func (s *RoleBindingsStore) RegisterRoleBinding(userSeqID, targetSeqID int, roleName string) (int, error)

RegisterRoleBinding registers or updated role binding MUST BE CALLED IN TRANSACTION

type UserStore

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

func NewUserStore

func NewUserStore(db sqlx.ExtContext) *UserStore

func (*UserStore) AddUser

func (s *UserStore) AddUser(id, name string, userType types.UserTypeEnum, systemRole string) (seqID int, err error)

func (*UserStore) FindUserByID

func (s *UserStore) FindUserByID(id string) (*types.User, error)

func (*UserStore) GetUser

func (s *UserStore) GetUser(seq int) (*types.User, error)

Jump to

Keyboard shortcuts

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