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 ¶
- type Option
- type Service
- func (s *Service) ChangePin(ctx context.Context, req *v1.ChangePinRequest) (*v1.ChangePinResponse, error)
- func (s *Service) CreateAccount(ctx context.Context, req *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error)
- func (s *Service) GetAccount(ctx context.Context, _ *v1.GetAccountRequest) (*v1.GetAccountResponse, error)
- func (s *Service) ResetPin(ctx context.Context, req *v1.ResetPinRequest) (*v1.ResetPinResponse, error)
- func (s *Service) SetPin(ctx context.Context, req *v1.SetPinRequest) (*v1.SetPinResponse, error)
- func (s *Service) VerifyPin(ctx context.Context, req *v1.VerifyPinRequest) (*v1.VerifyPinResponse, error)
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.
type Service ¶
type Service struct {
apiv1connect.UnimplementedAccountServiceHandler
// contains filtered or unexported fields
}
Service is the AccountService on the database api.
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 ¶
func (s *Service) GetAccount(ctx context.Context, _ *v1.GetAccountRequest) (*v1.GetAccountResponse, error)
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.