command

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFirstAccount added in v1.0.1

func CreateFirstAccount(
	reader domain.UsersReader,
	writer domain.UsersWriter,
	hasher domain.PasswordHasher,
	generator domain.KeyGenerator,
) func(context.Context, CreateFirstAccountCommand) error

Creates the first user account if no one exists yet.

func Login

func Login(
	reader domain.UsersReader,
	hasher domain.PasswordHasher,
) func(context.Context, LoginCommand) (string, error)

func UpdateUser

func UpdateUser(
	reader domain.UsersReader,
	writer domain.UsersWriter,
	hasher domain.PasswordHasher,
) func(context.Context, UpdateUserCommand) error

Update user profile.

Types

type CreateFirstAccountCommand added in v1.0.1

type CreateFirstAccountCommand struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginCommand

type LoginCommand struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type UpdateUserCommand

type UpdateUserCommand struct {
	ID       string              `json:"-"`
	Email    monad.Maybe[string] `json:"email"`
	Password monad.Maybe[string] `json:"password"`
}

Jump to

Keyboard shortcuts

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