Documentation
¶
Overview ¶
Package dbtools provides tools to help with interacting with the database, including all of our utilities for database integration testing
Index ¶
- func AuditApplicationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditApplicationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditApplicationTypeCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditApplicationTypeDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditApplicationTypeUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditApplicationUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupApplicationApproved(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) ([]*models.AuditEvent, error)
- func AuditGroupApplicationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupApplicationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupApplicationDenied(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupApplicationRequestCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupApplicationRequestRevoked(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMemberDemoted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMemberPromoted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipApproved(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) ([]*models.AuditEvent, error)
- func AuditGroupMembershipCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipDenied(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipRequestCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipRevoked(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupMembershipUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupOrganizationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupOrganizationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditGroupUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditOrganizationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditOrganizationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, ...) (*models.AuditEvent, error)
- func AuditUserCreatedWithActor(ctx context.Context, exec boil.ContextExecutor, pID string, ...) (*models.AuditEvent, error)
- func AuditUserDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, ...) (*models.AuditEvent, error)
- func AuditUserUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, ...) (*models.AuditEvent, error)
- func RegisterHooks()
- func SetApplicationSlug(a *models.Application)
- func SetApplicationTypeSlug(a *models.ApplicationType)
- func SetGroupSlug(g *models.Group)
- func SetOrganizationSlug(o *models.Organization)
- type EnumeratedMembership
- func GetAllGroupMemberships(ctx context.Context, db *sql.DB, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
- func GetMembersOfGroup(ctx context.Context, db *sql.DB, groupID string, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
- func GetMembershipsForUser(ctx context.Context, db *sql.DB, userID string, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditApplicationCreated ¶
func AuditApplicationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, a *models.Application) (*models.AuditEvent, error)
AuditApplicationCreated inserts an event representing an application being created
func AuditApplicationDeleted ¶
func AuditApplicationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, a *models.Application) (*models.AuditEvent, error)
AuditApplicationDeleted inserts an event representing an application being deleted
func AuditApplicationTypeCreated ¶
func AuditApplicationTypeCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, a *models.ApplicationType) (*models.AuditEvent, error)
AuditApplicationTypeCreated inserts an event representing an application type being created
func AuditApplicationTypeDeleted ¶
func AuditApplicationTypeDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, a *models.ApplicationType) (*models.AuditEvent, error)
AuditApplicationTypeDeleted inserts an event representing an application type being deleted
func AuditApplicationTypeUpdated ¶
func AuditApplicationTypeUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o, a *models.ApplicationType) (*models.AuditEvent, error)
AuditApplicationTypeUpdated inserts an event representing application type update into the events table
func AuditApplicationUpdated ¶
func AuditApplicationUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o, a *models.Application) (*models.AuditEvent, error)
AuditApplicationUpdated inserts an event representing application update into the events table
func AuditGroupApplicationApproved ¶
func AuditGroupApplicationApproved(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupApplication) ([]*models.AuditEvent, error)
AuditGroupApplicationApproved inserts an event representing group application approval into the events table
func AuditGroupApplicationCreated ¶
func AuditGroupApplicationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupApplication) (*models.AuditEvent, error)
AuditGroupApplicationCreated inserts an event representing group linking an application into the events table
func AuditGroupApplicationDeleted ¶
func AuditGroupApplicationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupApplication) (*models.AuditEvent, error)
AuditGroupApplicationDeleted inserts an event representing group unlinking an application into the events table
func AuditGroupApplicationDenied ¶
func AuditGroupApplicationDenied(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupApplicationRequest) (*models.AuditEvent, error)
AuditGroupApplicationDenied inserts an event representing group application denial into the events table
func AuditGroupApplicationRequestCreated ¶
func AuditGroupApplicationRequestCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupApplicationRequest) (*models.AuditEvent, error)
AuditGroupApplicationRequestCreated inserts an event representing a group application request into the events table
func AuditGroupApplicationRequestRevoked ¶
func AuditGroupApplicationRequestRevoked(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupApplicationRequest) (*models.AuditEvent, error)
AuditGroupApplicationRequestRevoked inserts an event representing group application request revokation into the events table
func AuditGroupCreated ¶
func AuditGroupCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, g *models.Group) (*models.AuditEvent, error)
AuditGroupCreated inserts an event representing group creation into the events table
func AuditGroupDeleted ¶
func AuditGroupDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o, g *models.Group) (*models.AuditEvent, error)
AuditGroupDeleted inserts an event representing group deletion into the events table
func AuditGroupMemberDemoted ¶
func AuditGroupMemberDemoted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupMembership) (*models.AuditEvent, error)
AuditGroupMemberDemoted inserts an event representing group member being demoted from admin into the events table
func AuditGroupMemberPromoted ¶
func AuditGroupMemberPromoted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupMembership) (*models.AuditEvent, error)
AuditGroupMemberPromoted inserts an event representing group member being promoted to admin into the events table
func AuditGroupMembershipApproved ¶
func AuditGroupMembershipApproved(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupMembership) ([]*models.AuditEvent, error)
AuditGroupMembershipApproved inserts an event representing group membership approval into the events table
func AuditGroupMembershipCreated ¶
func AuditGroupMembershipCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupMembership) (*models.AuditEvent, error)
AuditGroupMembershipCreated inserts an event representing group membership creation into the events table
func AuditGroupMembershipDeleted ¶
func AuditGroupMembershipDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupMembership) (*models.AuditEvent, error)
AuditGroupMembershipDeleted inserts an event representing group membership deletion into the events table
func AuditGroupMembershipDenied ¶
func AuditGroupMembershipDenied(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupMembershipRequest) (*models.AuditEvent, error)
AuditGroupMembershipDenied inserts an event representing group membership denial into the events table
func AuditGroupMembershipRequestCreated ¶
func AuditGroupMembershipRequestCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupMembershipRequest) (*models.AuditEvent, error)
AuditGroupMembershipRequestCreated inserts an event representing a group membership request into the events table
func AuditGroupMembershipRevoked ¶
func AuditGroupMembershipRevoked(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, r *models.GroupMembershipRequest) (*models.AuditEvent, error)
AuditGroupMembershipRevoked inserts an event representing group membership revokation into the events table
func AuditGroupMembershipUpdated ¶
func AuditGroupMembershipUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, original, m *models.GroupMembership) (*models.AuditEvent, error)
AuditGroupMembershipUpdated inserts an event representing group membership update into the events table
func AuditGroupOrganizationCreated ¶
func AuditGroupOrganizationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupOrganization) (*models.AuditEvent, error)
AuditGroupOrganizationCreated inserts an event representing group linking an organization into the events table
func AuditGroupOrganizationDeleted ¶
func AuditGroupOrganizationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, m *models.GroupOrganization) (*models.AuditEvent, error)
AuditGroupOrganizationDeleted inserts an event representing group unlinking an organization into the events table
func AuditGroupUpdated ¶
func AuditGroupUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o, g *models.Group) (*models.AuditEvent, error)
AuditGroupUpdated inserts an event representing group update into the events table
func AuditOrganizationCreated ¶
func AuditOrganizationCreated(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o *models.Organization) (*models.AuditEvent, error)
AuditOrganizationCreated inserts an event representing an organization being created
func AuditOrganizationDeleted ¶
func AuditOrganizationDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor *models.User, o *models.Organization) (*models.AuditEvent, error)
AuditOrganizationDeleted inserts an event representing an organization being deleted
func AuditUserCreatedWithActor ¶
func AuditUserCreatedWithActor(ctx context.Context, exec boil.ContextExecutor, pID string, actor, u *models.User) (*models.AuditEvent, error)
AuditUserCreatedWithActor inserts an event representing user creation into the event table
func AuditUserDeleted ¶
func AuditUserDeleted(ctx context.Context, exec boil.ContextExecutor, pID string, actor, original, new *models.User) (*models.AuditEvent, error)
AuditUserDeleted inserts an event representing user delete into the event table
func AuditUserUpdated ¶
func AuditUserUpdated(ctx context.Context, exec boil.ContextExecutor, pID string, actor, original, new *models.User) (*models.AuditEvent, error)
AuditUserUpdated inserts an event representing a user update request into the events table
func RegisterHooks ¶
func RegisterHooks()
RegisterHooks adds any hooks that are configured to the models library
func SetApplicationSlug ¶
func SetApplicationSlug(a *models.Application)
SetApplicationSlug assigns an Application model a slug from the Application name
func SetApplicationTypeSlug ¶
func SetApplicationTypeSlug(a *models.ApplicationType)
SetApplicationTypeSlug assigns an ApplicationType model a slug from the ApplicationType name
func SetGroupSlug ¶
SetGroupSlug assigns a Group model a slug from the Group name
func SetOrganizationSlug ¶
func SetOrganizationSlug(o *models.Organization)
SetOrganizationSlug assigns an Organization model a slug from the Organization name
Types ¶
type EnumeratedMembership ¶ added in v0.1.1
type EnumeratedMembership struct {
GroupID string
Group *models.Group
UserID string
User *models.User
IsAdmin bool
ExpiresAt null.Time
Direct bool
}
EnumeratedMembership represents a single user-to-group membership, which may be direct or indirect
func GetAllGroupMemberships ¶ added in v0.1.1
func GetAllGroupMemberships(ctx context.Context, db *sql.DB, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
GetAllGroupMemberships returns a fully enumerated list of all memberships in the database, optionally with sqlboiler's generated models populated (use with caution, potentially lots of data)
func GetMembersOfGroup ¶ added in v0.1.1
func GetMembersOfGroup(ctx context.Context, db *sql.DB, groupID string, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
GetMembersOfGroup returns a fully enumerated list of memberships in a group, optionally with sqlboiler's generated models populated
func GetMembershipsForUser ¶ added in v0.1.1
func GetMembershipsForUser(ctx context.Context, db *sql.DB, userID string, shouldPopulateAllModels bool) ([]EnumeratedMembership, error)
GetMembershipsForUser returns a fully enumerated list of memberships for a user, optionally with sqlboiler's generated models populated