api

package
v0.0.0-...-1d59f67 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID     uuid.UUID
	Email  string
	Person *Person
}

Account: an actor in the system. e.g. service account or user accoun

type AccountsApi

type AccountsApi interface {
	GetUserById(id uuid.UUID) (*Account, error)
	GetUserByEmail(email string) (*Account, error)
	CreateAccount(email string) (uuid.UUID, error)
	CreateUser(input UserCreateInput) (uuid.UUID, error)
}

AccountsApi: interfaces for working with accounts and users

func NewAccountsApi

func NewAccountsApi(querier dbc.Querier, ctx *context.Context) AccountsApi

NewAccountsApi: factor for an instance of AccountsApi

type AccountsApiFactory

type AccountsApiFactory func(querier dbc.Querier, ctx *context.Context) AccountsApi

AccountsApiFactory: injected into context so testing can mock the api.

type Person

type Person struct {
	ID        uuid.UUID
	AccountID uuid.UUID
	FirstName string
	LastName  string
}

Person: a person in the system. When an account has a person, then it is a user account

type UserCreateInput

type UserCreateInput struct {
	Email     string
	FirstName string
	LastName  string
}

UserCreateInput: input type for creating a user

Jump to

Keyboard shortcuts

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