Documentation ¶
Index ¶
- type FirestoreAdapter
- type FirestoreCRUD
- func (crud *FirestoreCRUD) CreateClient(client *models.Client) error
- func (crud *FirestoreCRUD) CreateMigration(timestamp string) error
- func (crud *FirestoreCRUD) CreateUser(user *models.User) error
- func (crud *FirestoreCRUD) CreateUserRole(role *models.UserRole) error
- func (crud *FirestoreCRUD) DeleteAllOtherUserSessions(username string, token uuid.UUID) error
- func (crud *FirestoreCRUD) DeleteAllUserRolesByClientUID(uid uuid.UUID) error
- func (crud *FirestoreCRUD) DeleteAllUserRolesByUsername(username string) error
- func (crud *FirestoreCRUD) DeleteAllUserSessions(username string) error
- func (crud *FirestoreCRUD) DeleteClient(uid uuid.UUID) (bool, error)
- func (crud *FirestoreCRUD) DeleteMigrationByTimestamp(timestamp string) error
- func (crud *FirestoreCRUD) DeleteSession(token uuid.UUID) (bool, error)
- func (crud *FirestoreCRUD) DeleteUser(username string) (bool, error)
- func (crud *FirestoreCRUD) DeleteUserRole(clientUID uuid.UUID, username string) (bool, error)
- func (crud *FirestoreCRUD) GetClientByUID(uid uuid.UUID) (*models.Client, error)
- func (crud *FirestoreCRUD) GetClients() ([]*models.Client, error)
- func (crud *FirestoreCRUD) GetLatestTimestamp() (string, bool, error)
- func (crud *FirestoreCRUD) GetMigrationByTimestamp(timestamp string) (*models.Migration, error)
- func (crud *FirestoreCRUD) GetSessionByToken(token uuid.UUID) (*models.Session, error)
- func (crud *FirestoreCRUD) GetUserByUsername(username string) (*models.User, error)
- func (crud *FirestoreCRUD) GetUserRoleByClientUIDAndUsername(clientUID uuid.UUID, username string) (*models.UserRole, error)
- func (crud *FirestoreCRUD) GetUserRolesWithLesserRankByClientUID(uid uuid.UUID, rank int) ([]*models.UserRole, error)
- func (crud *FirestoreCRUD) GetUsersWithLesserRank(rank int) ([]*models.User, error)
- func (crud *FirestoreCRUD) SaveSession(session *models.Session) error
- func (crud *FirestoreCRUD) Setup() error
- func (crud *FirestoreCRUD) UpdateClient(client *models.Client) (bool, error)
- func (crud *FirestoreCRUD) UpdateUser(user *models.User) (bool, error)
- func (crud *FirestoreCRUD) UpdateUserPassword(username string, hash []byte) (bool, error)
- func (crud *FirestoreCRUD) UpdateUserRole(role *models.UserRole) (bool, error)
- type FirestoreExecutor
- func (exec *FirestoreExecutor) Create(ref *firestore.DocumentRef, data interface{}) error
- func (exec *FirestoreExecutor) CreateTransaction() (data.Transaction, error)
- func (exec *FirestoreExecutor) Delete(ref *firestore.DocumentRef) error
- func (exec *FirestoreExecutor) Set(ref *firestore.DocumentRef, data interface{}) error
- func (exec *FirestoreExecutor) Update(ref *firestore.DocumentRef, updates []firestore.Update) error
- type FirestoreMigrationRepositoryFactory
- type FirestoreTransaction
- func (tx *FirestoreTransaction) Commit() error
- func (tx *FirestoreTransaction) Create(ref *firestore.DocumentRef, data interface{}) error
- func (tx *FirestoreTransaction) Delete(ref *firestore.DocumentRef) error
- func (*FirestoreTransaction) Rollback() error
- func (tx *FirestoreTransaction) Set(ref *firestore.DocumentRef, data interface{}) error
- func (tx *FirestoreTransaction) Update(ref *firestore.DocumentRef, updates []firestore.Update) error
- type MigrationRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirestoreAdapter ¶
type FirestoreAdapter struct { Client *firestore.Client ContextFactory data.ContextFactory // contains filtered or unexported fields }
func (*FirestoreAdapter) CleanUp ¶
func (a *FirestoreAdapter) CleanUp() error
CleanUp closes the firestore client and reset's the adapter's instance. The adapter also calls its cancel function to cancel any child requests that may still be running. Neither the adapter's client instance or context should be used after calling this function. Returns any errors.
func (*FirestoreAdapter) GetExecutor ¶
func (a *FirestoreAdapter) GetExecutor() data.DataExecutor
func (*FirestoreAdapter) Setup ¶
func (a *FirestoreAdapter) Setup() error
Setup creates a new firestore client using the firestore config. Also initializes the adapter's context and cancel function. Returns any errors.
type FirestoreCRUD ¶
type FirestoreCRUD struct { DocWriter docWriter Client *firestore.Client ContextFactory data.ContextFactory }
func (*FirestoreCRUD) CreateClient ¶
func (crud *FirestoreCRUD) CreateClient(client *models.Client) error
func (*FirestoreCRUD) CreateMigration ¶
func (crud *FirestoreCRUD) CreateMigration(timestamp string) error
func (*FirestoreCRUD) CreateUser ¶
func (crud *FirestoreCRUD) CreateUser(user *models.User) error
func (*FirestoreCRUD) CreateUserRole ¶
func (crud *FirestoreCRUD) CreateUserRole(role *models.UserRole) error
func (*FirestoreCRUD) DeleteAllOtherUserSessions ¶
func (crud *FirestoreCRUD) DeleteAllOtherUserSessions(username string, token uuid.UUID) error
func (*FirestoreCRUD) DeleteAllUserRolesByClientUID ¶
func (crud *FirestoreCRUD) DeleteAllUserRolesByClientUID(uid uuid.UUID) error
func (*FirestoreCRUD) DeleteAllUserRolesByUsername ¶
func (crud *FirestoreCRUD) DeleteAllUserRolesByUsername(username string) error
func (*FirestoreCRUD) DeleteAllUserSessions ¶
func (crud *FirestoreCRUD) DeleteAllUserSessions(username string) error
func (*FirestoreCRUD) DeleteClient ¶
func (crud *FirestoreCRUD) DeleteClient(uid uuid.UUID) (bool, error)
func (*FirestoreCRUD) DeleteMigrationByTimestamp ¶
func (crud *FirestoreCRUD) DeleteMigrationByTimestamp(timestamp string) error
func (*FirestoreCRUD) DeleteSession ¶
func (crud *FirestoreCRUD) DeleteSession(token uuid.UUID) (bool, error)
func (*FirestoreCRUD) DeleteUser ¶
func (crud *FirestoreCRUD) DeleteUser(username string) (bool, error)
func (*FirestoreCRUD) DeleteUserRole ¶
func (*FirestoreCRUD) GetClientByUID ¶
func (*FirestoreCRUD) GetClients ¶
func (crud *FirestoreCRUD) GetClients() ([]*models.Client, error)
func (*FirestoreCRUD) GetLatestTimestamp ¶
func (crud *FirestoreCRUD) GetLatestTimestamp() (string, bool, error)
func (*FirestoreCRUD) GetMigrationByTimestamp ¶
func (crud *FirestoreCRUD) GetMigrationByTimestamp(timestamp string) (*models.Migration, error)
func (*FirestoreCRUD) GetSessionByToken ¶
func (*FirestoreCRUD) GetUserByUsername ¶
func (crud *FirestoreCRUD) GetUserByUsername(username string) (*models.User, error)
func (*FirestoreCRUD) GetUserRoleByClientUIDAndUsername ¶
func (*FirestoreCRUD) GetUserRolesWithLesserRankByClientUID ¶
func (*FirestoreCRUD) GetUsersWithLesserRank ¶
func (crud *FirestoreCRUD) GetUsersWithLesserRank(rank int) ([]*models.User, error)
func (*FirestoreCRUD) SaveSession ¶
func (crud *FirestoreCRUD) SaveSession(session *models.Session) error
func (*FirestoreCRUD) Setup ¶
func (crud *FirestoreCRUD) Setup() error
func (*FirestoreCRUD) UpdateClient ¶
func (crud *FirestoreCRUD) UpdateClient(client *models.Client) (bool, error)
func (*FirestoreCRUD) UpdateUser ¶
func (crud *FirestoreCRUD) UpdateUser(user *models.User) (bool, error)
func (*FirestoreCRUD) UpdateUserPassword ¶
func (crud *FirestoreCRUD) UpdateUserPassword(username string, hash []byte) (bool, error)
func (*FirestoreCRUD) UpdateUserRole ¶
func (crud *FirestoreCRUD) UpdateUserRole(role *models.UserRole) (bool, error)
type FirestoreExecutor ¶
type FirestoreExecutor struct {
FirestoreCRUD
}
func (*FirestoreExecutor) Create ¶
func (exec *FirestoreExecutor) Create(ref *firestore.DocumentRef, data interface{}) error
func (*FirestoreExecutor) CreateTransaction ¶
func (exec *FirestoreExecutor) CreateTransaction() (data.Transaction, error)
func (*FirestoreExecutor) Delete ¶
func (exec *FirestoreExecutor) Delete(ref *firestore.DocumentRef) error
func (*FirestoreExecutor) Set ¶
func (exec *FirestoreExecutor) Set(ref *firestore.DocumentRef, data interface{}) error
func (*FirestoreExecutor) Update ¶
func (exec *FirestoreExecutor) Update(ref *firestore.DocumentRef, updates []firestore.Update) error
type FirestoreMigrationRepositoryFactory ¶
type FirestoreMigrationRepositoryFactory struct {
ScopeFactory data.ScopeFactory
}
func (FirestoreMigrationRepositoryFactory) CreateMigrationRepository ¶
func (FirestoreMigrationRepositoryFactory) CreateMigrationRepository(_ data.DataExecutor) migrationrunner.MigrationRepository
type FirestoreTransaction ¶
type FirestoreTransaction struct { FirestoreCRUD Batch *firestore.WriteBatch // contains filtered or unexported fields }
func (*FirestoreTransaction) Commit ¶
func (tx *FirestoreTransaction) Commit() error
func (*FirestoreTransaction) Create ¶
func (tx *FirestoreTransaction) Create(ref *firestore.DocumentRef, data interface{}) error
func (*FirestoreTransaction) Delete ¶
func (tx *FirestoreTransaction) Delete(ref *firestore.DocumentRef) error
func (*FirestoreTransaction) Rollback ¶
func (*FirestoreTransaction) Rollback() error
func (*FirestoreTransaction) Set ¶
func (tx *FirestoreTransaction) Set(ref *firestore.DocumentRef, data interface{}) error
func (*FirestoreTransaction) Update ¶
func (tx *FirestoreTransaction) Update(ref *firestore.DocumentRef, updates []firestore.Update) error
type MigrationRepository ¶
type MigrationRepository struct { Executor data.DataExecutor ScopeFactory data.ScopeFactory }
func (MigrationRepository) GetMigrations ¶
func (repo MigrationRepository) GetMigrations() []migrationrunner.Migration
Click to show internal directories.
Click to hide internal directories.