Documentation
¶
Overview ¶
Package bbolt provides a BBolt database driver implementation for the Apito system. It uses the ApitoBolt SDK (github.com/apito-io/apitoBolt) to provide a MongoDB-like interface on top of BBolt for system-level operations like user management, project management, team management, webhooks, audit logs, and more.
Index ¶
- type MigrationStatus
- type ProBBoltSystemDriver
- func (d *ProBBoltSystemDriver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
- func (d *ProBBoltSystemDriver) AddSystemUserMetaInfo(ctx context.Context, doc *types.DefaultDocumentStructure) (*types.DefaultDocumentStructure, error)
- func (d *ProBBoltSystemDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) AddWebhookToProject(ctx context.Context, doc *models.Webhook) (*models.Webhook, error)
- func (d *ProBBoltSystemDriver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error
- func (d *ProBBoltSystemDriver) AssignTeamToOrganization(ctx context.Context, orgId, userId, teamId string) error
- func (d *ProBBoltSystemDriver) BackupDatabase(backupPath string) error
- func (d *ProBBoltSystemDriver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error
- func (d *ProBBoltSystemDriver) CheckProjectName(ctx context.Context, name string) error
- func (d *ProBBoltSystemDriver) CheckProjectWithRoles(ctx context.Context, userId, projectId string) (*models.ProjectWithRoles, error)
- func (d *ProBBoltSystemDriver) CheckTeamMemberExists(ctx context.Context, projectId string, memberID string) error
- func (d *ProBBoltSystemDriver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error
- func (d *ProBBoltSystemDriver) Close() error
- func (d *ProBBoltSystemDriver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)
- func (d *ProBBoltSystemDriver) CreateProject(ctx context.Context, userId string, project *models.Project) (*models.Project, error)
- func (d *ProBBoltSystemDriver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) CreateTeam(ctx context.Context, team *models.Team) (*models.Team, error)
- func (d *ProBBoltSystemDriver) DeleteProjectFromSystem(ctx context.Context, projectId string) error
- func (d *ProBBoltSystemDriver) DeleteWebhook(ctx context.Context, projectId, hookId string) error
- func (d *ProBBoltSystemDriver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)
- func (d *ProBBoltSystemDriver) FindUserProjects(ctx context.Context, userId string) ([]*models.Project, error)
- func (d *ProBBoltSystemDriver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
- func (d *ProBBoltSystemDriver) FindUserTeams(ctx context.Context, userId string) ([]*models.Team, error)
- func (d *ProBBoltSystemDriver) GetDatabaseStats() (map[string]interface{}, error)
- func (d *ProBBoltSystemDriver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)
- func (d *ProBBoltSystemDriver) GetProject(ctx context.Context, id string) (*models.Project, error)
- func (d *ProBBoltSystemDriver) GetProjectTeams(ctx context.Context, projectId string) (*models.Team, error)
- func (d *ProBBoltSystemDriver) GetProjects(ctx context.Context, keys []string) ([]*models.Project, error)
- func (d *ProBBoltSystemDriver) GetSystemUser(ctx context.Context, id string) (*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) GetSystemUsers(ctx context.Context, keys []string) ([]*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) GetTeams(ctx context.Context, userId string) ([]*models.Team, error)
- func (d *ProBBoltSystemDriver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) GetWebHook(ctx context.Context, projectId, hookId string) (*models.Webhook, error)
- func (d *ProBBoltSystemDriver) ListAllProjects(ctx context.Context, userId string) ([]*models.Project, error)
- func (d *ProBBoltSystemDriver) ListAllUsers(ctx context.Context) ([]*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) ListTeams(ctx context.Context, projectId string) ([]*models.SystemUser, error)
- func (d *ProBBoltSystemDriver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error
- func (d *ProBBoltSystemDriver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error
- func (d *ProBBoltSystemDriver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error
- func (d *ProBBoltSystemDriver) RunMigration(ctx context.Context) error
- func (d *ProBBoltSystemDriver) SaveAuditLog(ctx context.Context, auditLog *models.AuditLogs) error
- func (d *ProBBoltSystemDriver) SaveRawData(ctx context.Context, collectionName string, data map[string]interface{}) error
- func (d *ProBBoltSystemDriver) SearchAuditLogs(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.AuditLogs], error)
- func (d *ProBBoltSystemDriver) SearchFunctions(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ApitoFunction], error)
- func (d *ProBBoltSystemDriver) SearchProjects(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Project], error)
- func (d *ProBBoltSystemDriver) SearchResource(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[any], error)
- func (d *ProBBoltSystemDriver) SearchUsers(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.SystemUser], error)
- func (d *ProBBoltSystemDriver) SearchWebHooks(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Webhook], error)
- func (d *ProBBoltSystemDriver) TransferSchema(ctx context.Context, from, to string) error
- func (d *ProBBoltSystemDriver) UpdateProject(ctx context.Context, project *models.Project, replace bool) error
- func (d *ProBBoltSystemDriver) UpdateSystemUser(ctx context.Context, user *models.SystemUser, replace bool) error
- type TeamMembership
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrationStatus ¶
type MigrationStatus struct { ID string `json:"id"` XKey string `json:"_key"` Completed bool `json:"completed"` Version string `json:"version"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
MigrationStatus represents the migration state in the database
type ProBBoltSystemDriver ¶
type ProBBoltSystemDriver struct { DB *apitobolt.Store CacheDriver oci.CacheDBInterface // contains filtered or unexported fields }
func GetSystemBBoltDriver ¶
func GetSystemBBoltDriver(driverCred *models.DriverCredentials, cacheDriver oci.CacheDBInterface) (*ProBBoltSystemDriver, error)
func (*ProBBoltSystemDriver) AddATeamMemberToProject ¶
func (d *ProBBoltSystemDriver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
func (*ProBBoltSystemDriver) AddSystemUserMetaInfo ¶
func (d *ProBBoltSystemDriver) AddSystemUserMetaInfo(ctx context.Context, doc *types.DefaultDocumentStructure) (*types.DefaultDocumentStructure, error)
AddSystemUserMetaInfo is deprecated according to interface comments
func (*ProBBoltSystemDriver) AddTeamMetaInfo ¶
func (d *ProBBoltSystemDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
func (*ProBBoltSystemDriver) AddWebhookToProject ¶
func (*ProBBoltSystemDriver) AssignProjectToOrganization ¶
func (d *ProBBoltSystemDriver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error
func (*ProBBoltSystemDriver) AssignTeamToOrganization ¶
func (d *ProBBoltSystemDriver) AssignTeamToOrganization(ctx context.Context, orgId, userId, teamId string) error
func (*ProBBoltSystemDriver) BackupDatabase ¶
func (d *ProBBoltSystemDriver) BackupDatabase(backupPath string) error
Helper function to backup database
func (*ProBBoltSystemDriver) BlacklistAToken ¶
func (d *ProBBoltSystemDriver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error
func (*ProBBoltSystemDriver) CheckProjectName ¶
func (d *ProBBoltSystemDriver) CheckProjectName(ctx context.Context, name string) error
func (*ProBBoltSystemDriver) CheckProjectWithRoles ¶
func (d *ProBBoltSystemDriver) CheckProjectWithRoles(ctx context.Context, userId, projectId string) (*models.ProjectWithRoles, error)
func (*ProBBoltSystemDriver) CheckTeamMemberExists ¶
func (*ProBBoltSystemDriver) CheckTokenBlacklisted ¶
func (d *ProBBoltSystemDriver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error
func (*ProBBoltSystemDriver) Close ¶
func (d *ProBBoltSystemDriver) Close() error
func (*ProBBoltSystemDriver) CreateOrganization ¶
func (d *ProBBoltSystemDriver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)
func (*ProBBoltSystemDriver) CreateProject ¶
func (*ProBBoltSystemDriver) CreateSystemUser ¶
func (d *ProBBoltSystemDriver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)
func (*ProBBoltSystemDriver) CreateTeam ¶
func (*ProBBoltSystemDriver) DeleteProjectFromSystem ¶
func (d *ProBBoltSystemDriver) DeleteProjectFromSystem(ctx context.Context, projectId string) error
func (*ProBBoltSystemDriver) DeleteWebhook ¶
func (d *ProBBoltSystemDriver) DeleteWebhook(ctx context.Context, projectId, hookId string) error
func (*ProBBoltSystemDriver) FindOrganizationAdmin ¶
func (d *ProBBoltSystemDriver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)
func (*ProBBoltSystemDriver) FindUserOrganizations ¶
func (d *ProBBoltSystemDriver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)
func (*ProBBoltSystemDriver) FindUserProjects ¶
func (*ProBBoltSystemDriver) FindUserProjectsWithRoles ¶
func (d *ProBBoltSystemDriver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
func (*ProBBoltSystemDriver) FindUserTeams ¶
func (d *ProBBoltSystemDriver) FindUserTeams(ctx context.Context, userId string) ([]*models.Team, error)
FindUserTeams retrieves all teams for a given user
func (*ProBBoltSystemDriver) GetDatabaseStats ¶
func (d *ProBBoltSystemDriver) GetDatabaseStats() (map[string]interface{}, error)
Helper function to get database statistics
func (*ProBBoltSystemDriver) GetOrganizations ¶
func (d *ProBBoltSystemDriver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)
func (*ProBBoltSystemDriver) GetProject ¶
func (*ProBBoltSystemDriver) GetProjectTeams ¶
func (*ProBBoltSystemDriver) GetProjects ¶
func (*ProBBoltSystemDriver) GetSystemUser ¶
func (d *ProBBoltSystemDriver) GetSystemUser(ctx context.Context, id string) (*models.SystemUser, error)
func (*ProBBoltSystemDriver) GetSystemUserByEmail ¶
func (d *ProBBoltSystemDriver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)
func (*ProBBoltSystemDriver) GetSystemUsers ¶
func (d *ProBBoltSystemDriver) GetSystemUsers(ctx context.Context, keys []string) ([]*models.SystemUser, error)
func (*ProBBoltSystemDriver) GetTeamsMembers ¶
func (d *ProBBoltSystemDriver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)
func (*ProBBoltSystemDriver) GetWebHook ¶
func (*ProBBoltSystemDriver) ListAllProjects ¶
func (d *ProBBoltSystemDriver) ListAllProjects(ctx context.Context, userId string) ([]*models.Project, error)
ListAllProjects returns all projects (admin only)
func (*ProBBoltSystemDriver) ListAllUsers ¶
func (d *ProBBoltSystemDriver) ListAllUsers(ctx context.Context) ([]*models.SystemUser, error)
func (*ProBBoltSystemDriver) ListTeams ¶
func (d *ProBBoltSystemDriver) ListTeams(ctx context.Context, projectId string) ([]*models.SystemUser, error)
ListTeams retrieves teams for a project
func (*ProBBoltSystemDriver) RemoveATeamFromOrganization ¶
func (d *ProBBoltSystemDriver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error
func (*ProBBoltSystemDriver) RemoveATeamMemberFromProject ¶
func (*ProBBoltSystemDriver) RemoveProjectFromOrganization ¶
func (d *ProBBoltSystemDriver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error
func (*ProBBoltSystemDriver) RunMigration ¶
func (d *ProBBoltSystemDriver) RunMigration(ctx context.Context) error
RunMigration creates the necessary collections/buckets for the system with migration tracking
func (*ProBBoltSystemDriver) SaveAuditLog ¶
func (*ProBBoltSystemDriver) SaveRawData ¶
func (*ProBBoltSystemDriver) SearchAuditLogs ¶
func (d *ProBBoltSystemDriver) SearchAuditLogs(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.AuditLogs], error)
func (*ProBBoltSystemDriver) SearchFunctions ¶
func (d *ProBBoltSystemDriver) SearchFunctions(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ApitoFunction], error)
func (*ProBBoltSystemDriver) SearchProjects ¶
func (d *ProBBoltSystemDriver) SearchProjects(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Project], error)
func (*ProBBoltSystemDriver) SearchResource ¶
func (d *ProBBoltSystemDriver) SearchResource(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[any], error)
SearchResource searches for any type of resource
func (*ProBBoltSystemDriver) SearchUsers ¶
func (d *ProBBoltSystemDriver) SearchUsers(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.SystemUser], error)
func (*ProBBoltSystemDriver) SearchWebHooks ¶
func (d *ProBBoltSystemDriver) SearchWebHooks(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Webhook], error)
func (*ProBBoltSystemDriver) TransferSchema ¶
func (d *ProBBoltSystemDriver) TransferSchema(ctx context.Context, from, to string) error
func (*ProBBoltSystemDriver) UpdateProject ¶
func (*ProBBoltSystemDriver) UpdateSystemUser ¶
func (d *ProBBoltSystemDriver) UpdateSystemUser(ctx context.Context, user *models.SystemUser, replace bool) error
type TeamMembership ¶
type TeamMembership struct { ID string `json:"id"` XKey string `json:"_key"` ProjectID string `json:"project_id"` UserID string `json:"user_id"` Role string `json:"role"` Permissions []string `json:"permissions"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
TeamMembership represents a user's membership in a project team