userserver

package
v0.0.0-...-eb9f531 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Securer

type Securer interface {
	Hash(string) string
	Password(string, ...string) bool
}

Securer represents password securing service

type Server

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

Server implements the UserService

func New

func New(db *pg.DB, sec Securer) *Server

New creates an instance of our server

func (*Server) AddUser

func (s *Server) AddUser(ctx context.Context, user *pbUser.AddUserRequest) (*pbUser.Empty, error)

AddUser gets a user to the in-memory store.

func (*Server) DeleteUser

func (s *Server) DeleteUser(ctx context.Context, user *pbUser.UserRequest) (*pbUser.Empty, error)

DeleteUser Deletes a user from the DB

func (*Server) GetUser

GetUser Gets a user from the DB

func (*Server) GetUserRestricted

func (s *Server) GetUserRestricted(ctx context.Context, user *pbUser.UserRequest) (*pbUser.UserPrivateResponse, error)

GetUserRestricted intended for privileged roles only supplies more detailed, private info about user.

func (*Server) ListUsers

func (s *Server) ListUsers(ctx context.Context, Empty *pbUser.Empty) (*pbUser.UserListResponse, error)

ListUsers lists all users in the store.

func (*Server) ResetUserPassword

func (s *Server) ResetUserPassword(ctx context.Context, ResetUserPasswordRequest *pbUser.ResetUserPasswordRequest) (*pbUser.Empty, error)

ResetUserPassword reset's a user's password

func (*Server) UpdateUser

func (s *Server) UpdateUser(ctx context.Context, updateUserRequest *pbUser.UpdateUserRequest) (*pbUser.Empty, error)

UpdateUser gets a user to the in-memory store.

func (*Server) UpdateUserRestricted

func (s *Server) UpdateUserRestricted(ctx context.Context, updateUserRestrictedRequest *pbUser.UpdateUserRestrictedRequest) (*pbUser.Empty, error)

UpdateUser gets a user to the in-memory store.

Jump to

Keyboard shortcuts

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