user

package
v0.0.0-...-33050dc Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthServer

type AuthServer struct {
	JwtPrivateKey *rsa.PrivateKey
	UserManager   UserManager
}

func NewAuthServer

func NewAuthServer(rsaPrivateKey []byte, s UserManager) (*AuthServer, error)

func (*AuthServer) SignIn

func (as *AuthServer) SignIn(cx context.Context, r *pb.SignInRequest) (*pb.Token, error)

func (*AuthServer) SignUp

func (as *AuthServer) SignUp(cx context.Context, r *pb.SignUpRequest) (*pb.Token, error)

type User

type User struct {
	pb.User
	Password       string
	CreatedAt      int64
	UpdatedAt      int64
	LastActivityAt int64
}

type UserManager

type UserManager interface {
	GetUserByUsername(username string) (*User, error)
	GetUserById(id string) (*User, error)
	UpdateUser(*User) error
	CreateUser(*User) error
	FindUsersByUsernameOrName(name string) ([]*User, error)
	FindUsersByIds(ids []string) ([]*User, error)
}

UserManager represets a service for User operations

type UserService

type UserService struct {
	UserManager UserManager
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(rsaPublicKey []byte, s UserManager) (*UserService, error)

func (*UserService) ChangePassword

func (*UserService) GetUsers

func (*UserService) UpdateProfile

Directories

Path Synopsis
Package userpb is a generated protocol buffer package.
Package userpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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