Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewHTTPHandler ¶
Types ¶
type Reader ¶
type Reader interface { FindInstitution(ctx context.Context, shortName string) (*entity.Institution, error) FindInstitutions(ctx context.Context) ([]*entity.Institution, error) FindInstitutionWithInvites(ctx context.Context, shortName string) (*entity.Institution, error) FindInviteLinkWithInstitution(ctx context.Context, code string) (*entity.InstitutionInviteLink, error) FindInviteLinks(ctx context.Context, id int) ([]*entity.InstitutionInviteLink, error) FindUser(ctx context.Context, principal string) (*entity.User, error) }
type Repository ¶
type Repository interface { Reader Writer transactor.Transactor }
func NewEntRepository ¶
func NewEntRepository(l logger.AppLogger, c *ent.Client) Repository
type UseCase ¶
type UseCase interface { ListInstitutions(ctx context.Context) ([]*entity.Institution, error) CreateInstitution(ctx context.Context, name, shortName, description string) (*entity.Institution, error) // UpdateInstitution modifies an institution which has a short name identified by the principal argument. UpdateInstitution(ctx context.Context, principal, name, shortName, description string) (*entity.Institution, error) DeleteInstitution(ctx context.Context, shortName string) error // ListInviteLinks shows invite links for an institution identified by shortName. // If the user (identified by principal), has God mode enabled, then all links will be accessible. // Else, only users with a role of Admin can list links for the institution they are associated with. ListInviteLinks(ctx context.Context, principal, shortName string) ([]*entity.InstitutionInviteLink, error) // CreateInviteLink creates a link an institution identified by shortName. // If the user (identified by principal) has God mode enabled, any shortName is accepted. // ELse, only users with a role of Admin can create links for the institution they are associated with. CreateInviteLink(ctx context.Context, principal, shortName string, role institution.Role) (*entity.InstitutionInviteLink, error) // DeleteInviteLink deletes a link. // If the user (identified by principal) has God mode enabled, any shortName is accepted. // ELse, only users with a role of Admin can delete links for the institution they are associated with. DeleteInviteLink(ctx context.Context, principal, shortName, code string) error }
func NewUseCase ¶
func NewUseCase(r Repository) UseCase
type Writer ¶
type Writer interface { CreateInstitution(ctx context.Context, name, shortName, description string) (*entity.Institution, error) UpdateInstitution(ctx context.Context, id int, name, shortName, description string) (*entity.Institution, error) DeleteInstitution(ctx context.Context, id int) error CreateInviteLink(ctx context.Context, id int, code string, role institution.Role) (*entity.InstitutionInviteLink, error) DeleteInviteLink(ctx context.Context, id int) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.