Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID int64 `json:"id"` Email string `json:"email"` Password string `json:"password"` }
User represent a system account
func (*User) SetPassword ¶
SetPassword sets and hashes the given password
type UserMemoryRepository ¶
type UserMemoryRepository struct {
// contains filtered or unexported fields
}
UserMemoryRepository is an in memory repository
func NewUserMemoryRepository ¶
func NewUserMemoryRepository() *UserMemoryRepository
NewUserMemoryRepository instantiates a new in memory database
func (*UserMemoryRepository) GetUserByEmail ¶
func (repo *UserMemoryRepository) GetUserByEmail(email string) *User
GetUserByEmail ...
func (*UserMemoryRepository) GetUserByID ¶
func (repo *UserMemoryRepository) GetUserByID(id int64) *User
GetUserByID ...
func (*UserMemoryRepository) InsertUser ¶
func (repo *UserMemoryRepository) InsertUser(user User) (*User, error)
InsertUser ...
type UserRepository ¶
type UserRepository interface { GetUserByEmail(email string) *User GetUserByID(id int64) *User InsertUser(user User) (*User, error) }
UserRepository is the Data Abstraction Layer for the User Server
type UserServer ¶
UserServer ...
func NewServer ¶
func NewServer(addr, privKeyPath string) *UserServer
NewServer creates a new server
func NewServerless ¶
func NewServerless(key *rsa.PrivateKey) *UserServer
NewServerless creates a UserServer without http server
func (*UserServer) StartServer ¶
func (us *UserServer) StartServer() error
StartServer creates and starts a UserServer
Click to show internal directories.
Click to hide internal directories.