Documentation
¶
Index ¶
- type App
- type AppApiKey
- type Auth
- type AuthProvider
- type CreateAppAPIKeyParams
- type CreateAppParams
- type CreateAuthParams
- type CreateAuthProviderParams
- type CreateMovieParams
- type CreateOrgKindParams
- type CreateOrgParams
- type CreatePermissionParams
- type CreatePersonParams
- type CreateRoleParams
- type CreateRolePermissionParams
- type CreateUserLanguagePreferenceParams
- type CreateUserParams
- type CreateUsersOrgParams
- type CreateUsersRoleParams
- type DBTX
- type FindAppAPIKeysByAppExtlIDRow
- type FindAppByExternalIDRow
- type FindAppByExternalIDWithAuditRow
- type FindAppByIDRow
- type FindAppByIDWithAuditRow
- type FindAppByNameParams
- type FindAppByNameRow
- type FindAppByProviderClientIDRow
- type FindAppsWithAuditRow
- type FindAuthByProviderUserIDParams
- type FindMovieByExternalIDWithAuditRow
- type FindMoviesRow
- type FindOrgByExtlIDRow
- type FindOrgByExtlIDWithAuditRow
- type FindOrgByIDRow
- type FindOrgByIDWithAuditRow
- type FindOrgByNameRow
- type FindOrgByNameWithAuditRow
- type FindOrgsByKindExtlIDRow
- type FindOrgsRow
- type FindOrgsWithAuditRow
- type FindPermissionByResourceOperationParams
- type FindPersonByUserExternalIDRow
- type FindPersonByUserIDRow
- type FindUsersByOrgRoleParams
- type IsAuthorizedParams
- type Movie
- type Org
- type OrgKind
- type Permission
- type Person
- type Queries
- func (q *Queries) CreateApp(ctx context.Context, arg CreateAppParams) (int64, error)
- func (q *Queries) CreateAppAPIKey(ctx context.Context, arg CreateAppAPIKeyParams) (int64, error)
- func (q *Queries) CreateAuth(ctx context.Context, arg CreateAuthParams) (int64, error)
- func (q *Queries) CreateAuthProvider(ctx context.Context, arg CreateAuthProviderParams) (int64, error)
- func (q *Queries) CreateMovie(ctx context.Context, arg CreateMovieParams) (pgconn.CommandTag, error)
- func (q *Queries) CreateOrg(ctx context.Context, arg CreateOrgParams) (int64, error)
- func (q *Queries) CreateOrgKind(ctx context.Context, arg CreateOrgKindParams) (int64, error)
- func (q *Queries) CreatePermission(ctx context.Context, arg CreatePermissionParams) (int64, error)
- func (q *Queries) CreatePerson(ctx context.Context, arg CreatePersonParams) (int64, error)
- func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (int64, error)
- func (q *Queries) CreateRolePermission(ctx context.Context, arg CreateRolePermissionParams) (int64, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (int64, error)
- func (q *Queries) CreateUserLanguagePreference(ctx context.Context, arg CreateUserLanguagePreferenceParams) (int64, error)
- func (q *Queries) CreateUsersOrg(ctx context.Context, arg CreateUsersOrgParams) (int64, error)
- func (q *Queries) CreateUsersRole(ctx context.Context, arg CreateUsersRoleParams) (int64, error)
- func (q *Queries) DeleteAllPermissions4Role(ctx context.Context, roleID uuid.UUID) (int64, error)
- func (q *Queries) DeleteApp(ctx context.Context, appID uuid.UUID) (int64, error)
- func (q *Queries) DeleteAppAPIKey(ctx context.Context, apiKey string) (int64, error)
- func (q *Queries) DeleteAppAPIKeys(ctx context.Context, appID uuid.UUID) (int64, error)
- func (q *Queries) DeleteMovie(ctx context.Context, movieID uuid.UUID) (int64, error)
- func (q *Queries) DeleteOrg(ctx context.Context, orgID uuid.UUID) (int64, error)
- func (q *Queries) DeletePermissionByExternalID(ctx context.Context, permissionExtlID string) (int64, error)
- func (q *Queries) DeletePerson(ctx context.Context, personID uuid.UUID) (int64, error)
- func (q *Queries) DeleteUserByID(ctx context.Context, userID uuid.UUID) (int64, error)
- func (q *Queries) DeleteUserLanguagePreferences(ctx context.Context, userID uuid.UUID) (int64, error)
- func (q *Queries) FindAPIKeysByAppID(ctx context.Context, appID uuid.UUID) ([]AppApiKey, error)
- func (q *Queries) FindAllPermissions(ctx context.Context) ([]Permission, error)
- func (q *Queries) FindAppAPIKeysByAppExtlID(ctx context.Context, appExtlID string) ([]FindAppAPIKeysByAppExtlIDRow, error)
- func (q *Queries) FindAppByExternalID(ctx context.Context, appExtlID string) (FindAppByExternalIDRow, error)
- func (q *Queries) FindAppByExternalIDWithAudit(ctx context.Context, appExtlID string) (FindAppByExternalIDWithAuditRow, error)
- func (q *Queries) FindAppByID(ctx context.Context, appID uuid.UUID) (FindAppByIDRow, error)
- func (q *Queries) FindAppByIDWithAudit(ctx context.Context, appID uuid.UUID) (FindAppByIDWithAuditRow, error)
- func (q *Queries) FindAppByName(ctx context.Context, arg FindAppByNameParams) (FindAppByNameRow, error)
- func (q *Queries) FindAppByProviderClientID(ctx context.Context, authProviderClientID sql.NullString) (FindAppByProviderClientIDRow, error)
- func (q *Queries) FindApps(ctx context.Context) ([]App, error)
- func (q *Queries) FindAppsByOrg(ctx context.Context, orgID uuid.UUID) ([]App, error)
- func (q *Queries) FindAppsWithAudit(ctx context.Context) ([]FindAppsWithAuditRow, error)
- func (q *Queries) FindAuthByAccessToken(ctx context.Context, authProviderAccessToken string) (Auth, error)
- func (q *Queries) FindAuthByProviderUserID(ctx context.Context, arg FindAuthByProviderUserIDParams) (Auth, error)
- func (q *Queries) FindMovieByExternalID(ctx context.Context, extlID string) (Movie, error)
- func (q *Queries) FindMovieByExternalIDWithAudit(ctx context.Context, extlID string) (FindMovieByExternalIDWithAuditRow, error)
- func (q *Queries) FindMovies(ctx context.Context) ([]FindMoviesRow, error)
- func (q *Queries) FindMoviesByTitle(ctx context.Context, title string) ([]Movie, error)
- func (q *Queries) FindOrgByExtlID(ctx context.Context, orgExtlID string) (FindOrgByExtlIDRow, error)
- func (q *Queries) FindOrgByExtlIDWithAudit(ctx context.Context, orgExtlID string) (FindOrgByExtlIDWithAuditRow, error)
- func (q *Queries) FindOrgByID(ctx context.Context, orgID uuid.UUID) (FindOrgByIDRow, error)
- func (q *Queries) FindOrgByIDWithAudit(ctx context.Context, orgID uuid.UUID) (FindOrgByIDWithAuditRow, error)
- func (q *Queries) FindOrgByName(ctx context.Context, orgName string) (FindOrgByNameRow, error)
- func (q *Queries) FindOrgByNameWithAudit(ctx context.Context, orgName string) (FindOrgByNameWithAuditRow, error)
- func (q *Queries) FindOrgKindByExtlID(ctx context.Context, orgKindExtlID string) (OrgKind, error)
- func (q *Queries) FindOrgKinds(ctx context.Context) ([]OrgKind, error)
- func (q *Queries) FindOrgs(ctx context.Context) ([]FindOrgsRow, error)
- func (q *Queries) FindOrgsByKindExtlID(ctx context.Context, orgKindExtlID string) ([]FindOrgsByKindExtlIDRow, error)
- func (q *Queries) FindOrgsWithAudit(ctx context.Context) ([]FindOrgsWithAuditRow, error)
- func (q *Queries) FindPermissionByExternalID(ctx context.Context, permissionExtlID string) (Permission, error)
- func (q *Queries) FindPermissionByResourceOperation(ctx context.Context, arg FindPermissionByResourceOperationParams) (Permission, error)
- func (q *Queries) FindPersonByUserExternalID(ctx context.Context, userExtlID string) (FindPersonByUserExternalIDRow, error)
- func (q *Queries) FindPersonByUserID(ctx context.Context, userID uuid.UUID) (FindPersonByUserIDRow, error)
- func (q *Queries) FindRoleByCode(ctx context.Context, roleCd string) (Role, error)
- func (q *Queries) FindRolePermissionsByRoleID(ctx context.Context, roleID uuid.UUID) ([]Permission, error)
- func (q *Queries) FindUserByExternalID(ctx context.Context, userExtlID string) (User, error)
- func (q *Queries) FindUserByID(ctx context.Context, userID uuid.UUID) (User, error)
- func (q *Queries) FindUserLanguagePreferencesByUserID(ctx context.Context, userID uuid.UUID) ([]UsersLangPref, error)
- func (q *Queries) FindUsersByOrgRole(ctx context.Context, arg FindUsersByOrgRoleParams) ([]UsersRole, error)
- func (q *Queries) IsAuthorized(ctx context.Context, arg IsAuthorizedParams) (uuid.UUID, error)
- func (q *Queries) UpdateApp(ctx context.Context, arg UpdateAppParams) (int64, error)
- func (q *Queries) UpdateMovie(ctx context.Context, arg UpdateMovieParams) error
- func (q *Queries) UpdateOrg(ctx context.Context, arg UpdateOrgParams) (int64, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Role
- type RolePermission
- type UpdateAppParams
- type UpdateMovieParams
- type UpdateOrgParams
- type User
- type UsersLangPref
- type UsersOrg
- type UsersRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// The Unique ID for the table.
AppID uuid.UUID
// The unique application External ID to be given to outside callers.
AppExtlID string
// The Foreign key for the organization that the app belongs to.
OrgID uuid.UUID
// The application name is a short name for the application.
AppName string
// The application description is several sentences to describe the application.
AppDescription string
// unique identifier representing authorization provider (e.g. Google, Github, etc.)
AuthProviderID sql.NullInt32
// Unique identifer of client ID given by an authentication provider. For example, GCP supports cross-client identity - see https://developers.google.com/identity/protocols/oauth2/cross-client-identity for a great explanation.
AuthProviderClientID sql.NullString
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
app stores data about applications that interact with the system
type AppApiKey ¶
type AppApiKey struct {
// app_key is a hash of a key given to an person for an app
ApiKey string
// foreign key to app table
AppID uuid.UUID
DeactvDate time.Time
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type Auth ¶
type Auth struct {
// The unique id given to the authorization.
AuthID uuid.UUID
UserID uuid.UUID
// Unique ID given to an authorization provider.
AuthProviderID int64
// Unique code given to an authorization provider (e.g. google).
AuthProviderCd string
// External ID (given by authorization provider) which represents the Oauth2 client which authenticated the user
AuthProviderClientID sql.NullString
// Unique ID given by the authorization provider which represents the person.
AuthProviderPersonID string
// Oauth2 access token given by the authorization provider.
AuthProviderAccessToken string
// OAuth2 refresh token given by the authorization provider.
AuthProviderRefreshToken sql.NullString
// Expiration of access token given by the authorization provider. Is not a perfect precision instrument as some providers do not give an exact time, but rather seconds until expiration, which means the value is calculated relative to the server time.
AuthProviderAccessTokenExpiry time.Time
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The auth table stores which user has authenticated through an Oauth2 provider.
type AuthProvider ¶
type AuthProvider struct {
// Unique ID representing the authentication provider.
AuthProviderID int64
// Short code representing the authentication provider (e.g., google, github, apple, etc.)
AuthProviderCd string
// Longer description of authentication provider
AuthProviderDesc string
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
Authentication Provider (e.g. Google, Github, Apple, Facebook, etc.)
type CreateAppAPIKeyParams ¶
type CreateAppParams ¶
type CreateAppParams struct {
AppID uuid.UUID
OrgID uuid.UUID
AppExtlID string
AppName string
AppDescription string
AuthProviderID sql.NullInt32
AuthProviderClientID sql.NullString
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreateAuthParams ¶
type CreateAuthParams struct {
AuthID uuid.UUID
UserID uuid.UUID
AuthProviderID int64
AuthProviderCd string
AuthProviderClientID sql.NullString
AuthProviderPersonID string
AuthProviderAccessToken string
AuthProviderRefreshToken sql.NullString
AuthProviderAccessTokenExpiry time.Time
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreateMovieParams ¶
type CreateMovieParams struct {
MovieID uuid.UUID
ExtlID string
Title string
Rated sql.NullString
Released sql.NullTime
RunTime sql.NullInt32
Director sql.NullString
Writer sql.NullString
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreateOrgKindParams ¶
type CreateOrgParams ¶
type CreatePermissionParams ¶
type CreatePermissionParams struct {
PermissionID uuid.UUID
PermissionExtlID string
Resource string
Operation string
PermissionDescription string
Active bool
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreatePersonParams ¶
type CreateRoleParams ¶
type CreateUserParams ¶
type CreateUserParams struct {
UserID uuid.UUID
UserExtlID string
PersonID uuid.UUID
NamePrefix sql.NullString
FirstName string
MiddleName sql.NullString
LastName string
NameSuffix sql.NullString
Nickname sql.NullString
Email sql.NullString
CompanyName sql.NullString
CompanyDept sql.NullString
JobTitle sql.NullString
BirthDate sql.NullTime
BirthYear sql.NullInt64
BirthMonth sql.NullInt64
BirthDay sql.NullInt64
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreateUsersOrgParams ¶
type CreateUsersRoleParams ¶
type FindAppByExternalIDRow ¶
type FindAppByExternalIDWithAuditRow ¶
type FindAppByExternalIDWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
AppID uuid.UUID
AppExtlID string
AppName string
AppDescription string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName sql.NullString
CreateUserLastName sql.NullString
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName sql.NullString
UpdateUserLastName sql.NullString
UpdateTimestamp time.Time
}
type FindAppByIDRow ¶
type FindAppByIDWithAuditRow ¶
type FindAppByIDWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
AppID uuid.UUID
AppExtlID string
AppName string
AppDescription string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName sql.NullString
CreateUserLastName sql.NullString
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName sql.NullString
UpdateUserLastName sql.NullString
UpdateTimestamp time.Time
}
type FindAppByNameParams ¶
type FindAppByNameRow ¶
type FindAppsWithAuditRow ¶
type FindAppsWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
AppID uuid.UUID
AppExtlID string
AppName string
AppDescription string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName sql.NullString
CreateUserLastName sql.NullString
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName sql.NullString
UpdateUserLastName sql.NullString
UpdateTimestamp time.Time
}
type FindMovieByExternalIDWithAuditRow ¶
type FindMovieByExternalIDWithAuditRow struct {
MovieID uuid.UUID
ExtlID string
Title string
Rated sql.NullString
Released sql.NullTime
RunTime sql.NullInt32
Director sql.NullString
Writer sql.NullString
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName sql.NullString
CreateUserLastName sql.NullString
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName sql.NullString
UpdateUserLastName sql.NullString
UpdateTimestamp time.Time
}
type FindMoviesRow ¶
type FindMoviesRow struct {
MovieID uuid.UUID
ExtlID string
Title string
Rated sql.NullString
Released sql.NullTime
RunTime sql.NullInt32
Director sql.NullString
Writer sql.NullString
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName sql.NullString
CreateUserLastName sql.NullString
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName sql.NullString
UpdateUserLastName sql.NullString
UpdateTimestamp time.Time
}
type FindOrgByExtlIDRow ¶
type FindOrgByExtlIDWithAuditRow ¶
type FindOrgByExtlIDWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName string
CreateUserLastName string
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName string
UpdateUserLastName string
UpdateTimestamp time.Time
}
type FindOrgByIDRow ¶
type FindOrgByIDWithAuditRow ¶
type FindOrgByIDWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName string
CreateUserLastName string
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName string
UpdateUserLastName string
UpdateTimestamp time.Time
}
type FindOrgByNameRow ¶
type FindOrgByNameWithAuditRow ¶
type FindOrgByNameWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName string
CreateUserLastName string
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName string
UpdateUserLastName string
UpdateTimestamp time.Time
}
type FindOrgsByKindExtlIDRow ¶
type FindOrgsRow ¶
type FindOrgsWithAuditRow ¶
type FindOrgsWithAuditRow struct {
OrgID uuid.UUID
OrgExtlID string
OrgName string
OrgDescription string
OrgKindID uuid.UUID
OrgKindExtlID string
OrgKindDesc string
CreateAppID uuid.UUID
CreateAppOrgID uuid.UUID
CreateAppExtlID string
CreateAppName string
CreateAppDescription string
CreateUserID uuid.NullUUID
CreateUserFirstName string
CreateUserLastName string
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateAppOrgID uuid.UUID
UpdateAppExtlID string
UpdateAppName string
UpdateAppDescription string
UpdateUserID uuid.NullUUID
UpdateUserFirstName string
UpdateUserLastName string
UpdateTimestamp time.Time
}
type FindPersonByUserExternalIDRow ¶
type FindPersonByUserExternalIDRow struct {
PersonID uuid.UUID
PersonExtlID string
UserID uuid.UUID
UserExtlID string
NamePrefix sql.NullString
FirstName string
MiddleName sql.NullString
LastName string
NameSuffix sql.NullString
Nickname sql.NullString
Email sql.NullString
CompanyName sql.NullString
CompanyDept sql.NullString
JobTitle sql.NullString
BirthDate sql.NullTime
BirthYear sql.NullInt64
BirthMonth sql.NullInt64
BirthDay sql.NullInt64
}
type FindPersonByUserIDRow ¶
type FindPersonByUserIDRow struct {
PersonID uuid.UUID
PersonExtlID string
UserID uuid.UUID
UserExtlID string
NamePrefix sql.NullString
FirstName string
MiddleName sql.NullString
LastName string
NameSuffix sql.NullString
Nickname sql.NullString
Email sql.NullString
CompanyName sql.NullString
CompanyDept sql.NullString
JobTitle sql.NullString
BirthDate sql.NullTime
BirthYear sql.NullInt64
BirthMonth sql.NullInt64
BirthDay sql.NullInt64
}
type IsAuthorizedParams ¶
type Movie ¶
type Movie struct {
// The unique ID given to the movie.
MovieID uuid.UUID
// A unique ID given to the movie which can be used externally.
ExtlID string
// The title of the movie.
Title string
// The movie rating (PG, PG-13, R, etc.)
Rated sql.NullString
// The date the movie was released.
Released sql.NullTime
// The movie run time in minutes.
RunTime sql.NullInt32
// The movie director.
Director sql.NullString
// The movie writer.
Writer sql.NullString
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The movie table stores details about a movie.
type Org ¶
type Org struct {
// Organization ID - Unique ID for table
OrgID uuid.UUID
// Organization Unique External ID to be given to outside callers.
OrgExtlID string
// Organization Name - a short name for the organization
OrgName string
// Organization Description - several sentences to describe the organization
OrgDescription string
// Foreign Key to org_kind table.
OrgKindID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
type OrgKind ¶
type OrgKind struct {
// Organization Kind ID - pk for table
OrgKindID uuid.UUID
// A short code denoting the organization kind
OrgKindExtlID string
// A longer descriptor of the organization kind
OrgKindDesc string
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
Organization Kind is a reference table denoting an organization's (org) classification. Examples are Genesis, Test, Standard
type Permission ¶
type Permission struct {
// The unique ID for the table.
PermissionID uuid.UUID
// Unique External ID to be given to outside callers.
PermissionExtlID string
// A human-readable string which represents a resource (e.g. an HTTP route or document, etc.).
Resource string
// A string representing the action taken on the resource (e.g. POST, GET, edit, etc.)
Operation string
// A description of what the permission is granting, e.g. "grants ability to edit a billing document".
PermissionDescription string
// A boolean denoting whether the permission is active (true) or not (false).
Active bool
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The permission table stores an approval of a mode of access to a resource.
type Person ¶
type Person struct {
// The user ID is the unique ID for user (pk for table)
PersonID uuid.UUID
// The unique user external ID to be given to outside callers.
PersonExtlID string
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateAppAPIKey ¶
func (*Queries) CreateAuth ¶
func (*Queries) CreateAuthProvider ¶
func (*Queries) CreateMovie ¶
func (q *Queries) CreateMovie(ctx context.Context, arg CreateMovieParams) (pgconn.CommandTag, error)
func (*Queries) CreateOrgKind ¶
func (*Queries) CreatePermission ¶
func (*Queries) CreatePerson ¶
func (*Queries) CreateRole ¶
func (*Queries) CreateRolePermission ¶
func (*Queries) CreateUser ¶
func (*Queries) CreateUserLanguagePreference ¶
func (*Queries) CreateUsersOrg ¶
func (*Queries) CreateUsersRole ¶
func (*Queries) DeleteAllPermissions4Role ¶
func (*Queries) DeleteAppAPIKey ¶
func (*Queries) DeleteAppAPIKeys ¶
func (*Queries) DeleteMovie ¶
func (*Queries) DeletePermissionByExternalID ¶
func (*Queries) DeletePerson ¶
func (*Queries) DeleteUserByID ¶
func (*Queries) DeleteUserLanguagePreferences ¶
func (*Queries) FindAPIKeysByAppID ¶
func (*Queries) FindAllPermissions ¶
func (q *Queries) FindAllPermissions(ctx context.Context) ([]Permission, error)
func (*Queries) FindAppAPIKeysByAppExtlID ¶
func (*Queries) FindAppByExternalID ¶
func (*Queries) FindAppByExternalIDWithAudit ¶
func (*Queries) FindAppByID ¶
func (*Queries) FindAppByIDWithAudit ¶
func (*Queries) FindAppByName ¶
func (q *Queries) FindAppByName(ctx context.Context, arg FindAppByNameParams) (FindAppByNameRow, error)
func (*Queries) FindAppByProviderClientID ¶
func (q *Queries) FindAppByProviderClientID(ctx context.Context, authProviderClientID sql.NullString) (FindAppByProviderClientIDRow, error)
func (*Queries) FindAppsByOrg ¶
func (*Queries) FindAppsWithAudit ¶
func (q *Queries) FindAppsWithAudit(ctx context.Context) ([]FindAppsWithAuditRow, error)
func (*Queries) FindAuthByAccessToken ¶
func (*Queries) FindAuthByProviderUserID ¶
func (*Queries) FindMovieByExternalID ¶
func (*Queries) FindMovieByExternalIDWithAudit ¶
func (*Queries) FindMovies ¶
func (q *Queries) FindMovies(ctx context.Context) ([]FindMoviesRow, error)
func (*Queries) FindMoviesByTitle ¶
func (*Queries) FindOrgByExtlID ¶
func (*Queries) FindOrgByExtlIDWithAudit ¶
func (*Queries) FindOrgByID ¶
func (*Queries) FindOrgByIDWithAudit ¶
func (*Queries) FindOrgByName ¶
func (*Queries) FindOrgByNameWithAudit ¶
func (*Queries) FindOrgKindByExtlID ¶
func (*Queries) FindOrgKinds ¶
--------------------------------------------------------------------------------------------------------------------- Org Kind ---------------------------------------------------------------------------------------------------------------------
func (*Queries) FindOrgsByKindExtlID ¶
func (*Queries) FindOrgsWithAudit ¶
func (q *Queries) FindOrgsWithAudit(ctx context.Context) ([]FindOrgsWithAuditRow, error)
func (*Queries) FindPermissionByExternalID ¶
func (*Queries) FindPermissionByResourceOperation ¶
func (q *Queries) FindPermissionByResourceOperation(ctx context.Context, arg FindPermissionByResourceOperationParams) (Permission, error)
func (*Queries) FindPersonByUserExternalID ¶
func (*Queries) FindPersonByUserID ¶
func (*Queries) FindRoleByCode ¶
func (*Queries) FindRolePermissionsByRoleID ¶
func (*Queries) FindUserByExternalID ¶
func (*Queries) FindUserByID ¶
func (*Queries) FindUserLanguagePreferencesByUserID ¶
func (*Queries) FindUsersByOrgRole ¶
func (*Queries) IsAuthorized ¶
func (*Queries) UpdateMovie ¶
func (q *Queries) UpdateMovie(ctx context.Context, arg UpdateMovieParams) error
type Role ¶
type Role struct {
// The unique ID for the table.
RoleID uuid.UUID
// Unique External ID to be given to outside callers.
RoleExtlID string
// A human-readable code which represents the role.
RoleCd string
// A longer description of the role.
RoleDescription string
// A boolean denoting whether the role is active (true) or not (false).
Active bool
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The role table stores a job function or title which defines an authority level.
type RolePermission ¶
type RolePermission struct {
// The unique role which can have 1 to many permissions set in this table.
RoleID uuid.UUID
// The unique permission that is being given to the role.
PermissionID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The role_permission table stores which roles have which permissions.
type UpdateAppParams ¶
type UpdateMovieParams ¶
type UpdateOrgParams ¶
type User ¶
type User struct {
UserID uuid.UUID
UserExtlID string
PersonID uuid.UUID
NamePrefix sql.NullString
FirstName string
MiddleName sql.NullString
LastName string
NameSuffix sql.NullString
Nickname sql.NullString
// Primary email for the user
Email sql.NullString
CompanyName sql.NullString
CompanyDept sql.NullString
JobTitle sql.NullString
BirthDate sql.NullTime
BirthYear sql.NullInt64
BirthMonth sql.NullInt64
BirthDay sql.NullInt64
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
users stores data about users that interact with the system. A user is a person who utilizes a computer or network service." In the context of this project, given that we allow Persons to authenticate with multiple providers, a User is akin to a user (Wikipedia - "The word persona derives from Latin, where it originally referred to a theatrical mask. On the social web, users develop virtual personas as online identities.") and as such, a Person can have one to many Users (for instance, I can have a GitHub user and a Google user, but I am just one Person). As a general, practical matter, most operations are considered at the User level. For instance, roles are assigned at the user level instead of the Person level, which allows for more fine-grained access control. Architecture note: All tables are to be singular, however, because user is a reserved word, the rules are broken here. It is unfortunate, but the alternatives are no better.
type UsersLangPref ¶
type UsersLangPref struct {
// The user having a language tag preference.
UserID uuid.UUID
// The BCP 47 Language Tag which identifies a language both spoken and written.
LanguageTag string
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The users_lang_prefs table stores the list of language tag preferences for the user.
type UsersOrg ¶
type UsersOrg struct {
// Unique identifier for a user's association with an organization
UsersOrgID uuid.UUID
// Organization ID foreign key to org table
OrgID uuid.UUID
// User ID foreign key to users table
UserID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
type UsersRole ¶
type UsersRole struct {
// The user which is being given a role (within an organization).
UserID uuid.UUID
// The role which can have one to many users set in this table.
RoleID uuid.UUID
// The organization to which the role and user are associated.
OrgID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The users_role table stores which users have which role(s) in which organization(s).