user

package
v0.0.0-...-02b4537 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(router *gin.Engine, authenticator *authentication.Authenticator, manager *Manager) *Handler

func (*Handler) Register

func (h *Handler) Register()

type Manager

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

func NewManager

func NewManager(organizationManager *organization.Manager, authenticator *authentication.Authenticator) *Manager

func (*Manager) Add

func (*Manager) Authenticate

func (m *Manager) Authenticate(ctx context.Context, authenticationRequest *user.AuthenticationRequest) (*user.AuthenticationResponse, error)

func (*Manager) ChangeAdmin

func (m *Manager) ChangeAdmin(ctx context.Context, userID string, changeAdminRequest user.AdminChangeRequest, organizationID string) (*User, error)

func (*Manager) ChangePassword

func (m *Manager) ChangePassword(ctx context.Context, userID string, passwordChangeRequest *user.PasswordChangeRequest) (*User, error)

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, userID string, organizationID string) (*User, error)

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, userID string) (*User, error)

func (*Manager) GetByOrganization

func (m *Manager) GetByOrganization(ctx context.Context, userID string, organizationID string) (*User, error)

func (*Manager) List

func (m *Manager) List(ctx context.Context, organizationID string, page int64, size int64) ([]*User, error)

func (*Manager) ResetPassword

func (m *Manager) ResetPassword(ctx context.Context, userID string, organizationID string) (*user.PasswordResponse, error)

func (*Manager) SignUp

func (m *Manager) SignUp(ctx context.Context, signUpRequest *user.SignUpRequest) (*User, error)

type User

type User struct {
	mgm.DefaultModel `bson:",inline"`
	Username         string     `json:"username" bson:"username"`
	Password         string     `json:"-" bson:"password"`
	OrganizationID   string     `json:"organization_id" bson:"organization_id"`
	Admin            bool       `json:"admin" bson:"admin"`
	CreatorType      actor.Type `json:"creator_type" bson:"creator_type"`
	CreatorID        string     `json:"creator_id" bson:"creator_id"`
	Deleted          bool       `json:"deleted" bson:"deleted"`
}

Jump to

Keyboard shortcuts

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