account

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package account is api's AccountService of the contract novatrail.api.v1: the account and its invite code, and, task by task, its PIN, profiles and deletion (R04, R34, R35). Its methods run after the checks of architecture 3.1, which give them the caller (rpc.CallerFrom); a method it has no handler for yet answers unimplemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.1.6

type Option func(*Service)

Option is a choice of New's that a test makes.

func WithClock added in v0.1.6

func WithClock(now func() time.Time) Option

WithClock is the clock the PIN's count goes by, the system's by default.

type Service

type Service struct {
	apiv1connect.UnimplementedAccountServiceHandler
	// contains filtered or unexported fields
}

Service is the AccountService on the database api.

func New

func New(db rpc.DB, options ...Option) *Service

New is the AccountService on db.

func (*Service) ChangePin added in v0.1.6

func (s *Service) ChangePin(ctx context.Context, req *v1.ChangePinRequest) (*v1.ChangePinResponse, error)

ChangePin changes the PIN by the PIN before it, which counts as VerifyPin counts it; a wrong one changes nothing.

func (*Service) CreateAccount

func (s *Service) CreateAccount(ctx context.Context, req *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error)

CreateAccount creates the caller's account by an invite code and the owner's statement that they are 18 or older. A caller with an account already gets CAUSE_ALREADY_EXISTS before the statement and the code are looked at, so that a repeat after a lost answer gets that rather than a code redeemed (contract, CreateAccount).

func (*Service) GetAccount

GetAccount gives the account of the caller: whether its PIN is set, its profiles and its consents for a child with no profile. Open attempts and lesson runs come with epic E3, which keeps them.

func (*Service) ResetPin added in v0.1.6

func (s *Service) ResetPin(ctx context.Context, req *v1.ResetPinRequest) (*v1.ResetPinResponse, error)

ResetPin changes a forgotten PIN by a fresh sign-in, which the checks have held last (R20): it sets the new PIN whether there was one or not, and opens the input.

func (*Service) SetPin added in v0.1.6

func (s *Service) SetPin(ctx context.Context, req *v1.SetPinRequest) (*v1.SetPinResponse, error)

SetPin sets the PIN of the section for adults, while the account has none.

func (*Service) VerifyPin added in v0.1.6

func (s *Service) VerifyPin(ctx context.Context, req *v1.VerifyPinRequest) (*v1.VerifyPinResponse, error)

VerifyPin checks a PIN: a wrong one counts toward closing the input.

Jump to

Keyboard shortcuts

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