Documentation ¶
Index ¶
- Variables
- func ExecuteAndConsumeResult(ctx context.Context, tx neo4j.ManagedTransaction, query string, ...) error
- func ExecuteReadAndReadAll[T any](ctx context.Context, db *Database, query string, params map[string]any, ...) ([]T, error)
- func ExecuteReadAndReadSingle[T any](ctx context.Context, db *Database, query string, params map[string]any, ...) (*T, error)
- func ExecuteWriteAndConsume(ctx context.Context, db *Database, query string, params map[string]any) error
- func ExecuteWriteAndReadAll[T any](ctx context.Context, db *Database, query string, params map[string]any, ...) ([]T, error)
- func ExecuteWriteAndReadSingle[T any](ctx context.Context, db *Database, query string, params map[string]any, ...) (*T, error)
- func NewDriver(conf *config.GraphDatabaseConfig) (neo4j.DriverWithContext, error)
- func ParseIDsFromRecord(record *neo4j.Record, key, label string) ([]model.ID, error)
- func ParseValueFromRecord[T neo4j.RecordValue](record *neo4j.Record, key string) (T, error)
- func ScanIntoStruct(n PropertyGetter, dst any, exclude []string) error
- type AssignmentRepository
- func (r *AssignmentRepository) Create(ctx context.Context, assignment *model.Assignment) error
- func (r *AssignmentRepository) Delete(ctx context.Context, id model.ID) error
- func (r *AssignmentRepository) Get(ctx context.Context, id model.ID) (*model.Assignment, error)
- func (r *AssignmentRepository) GetByResource(ctx context.Context, resourceID model.ID, offset, limit int) ([]*model.Assignment, error)
- func (r *AssignmentRepository) GetByUser(ctx context.Context, userID model.ID, offset, limit int) ([]*model.Assignment, error)
- type AttachmentRepository
- func (r *AttachmentRepository) Create(ctx context.Context, belongsTo model.ID, attachment *model.Attachment) error
- func (r *AttachmentRepository) Delete(ctx context.Context, id model.ID) error
- func (r *AttachmentRepository) Get(ctx context.Context, id model.ID) (*model.Attachment, error)
- func (r *AttachmentRepository) GetAllBelongsTo(ctx context.Context, belongsTo model.ID, offset, limit int) ([]*model.Attachment, error)
- func (r *AttachmentRepository) Update(ctx context.Context, id model.ID, name string) (*model.Attachment, error)
- type CommentRepository
- func (r *CommentRepository) Create(ctx context.Context, belongsTo model.ID, comment *model.Comment) error
- func (r *CommentRepository) Delete(ctx context.Context, id model.ID) error
- func (r *CommentRepository) Get(ctx context.Context, id model.ID) (*model.Comment, error)
- func (r *CommentRepository) GetAllBelongsTo(ctx context.Context, belongsTo model.ID, offset, limit int) ([]*model.Comment, error)
- func (r *CommentRepository) Update(ctx context.Context, id model.ID, content string) (*model.Comment, error)
- type Database
- type DatabaseOption
- type DocumentRepository
- func (r *DocumentRepository) Create(ctx context.Context, belongsTo model.ID, document *model.Document) error
- func (r *DocumentRepository) Delete(ctx context.Context, id model.ID) error
- func (r *DocumentRepository) Get(ctx context.Context, id model.ID) (*model.Document, error)
- func (r *DocumentRepository) GetAllBelongsTo(ctx context.Context, belongsTo model.ID, offset, limit int) ([]*model.Document, error)
- func (r *DocumentRepository) GetByCreator(ctx context.Context, createdBy model.ID, offset, limit int) ([]*model.Document, error)
- func (r *DocumentRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Document, error)
- type EdgeKind
- type IssueRepository
- func (r *IssueRepository) AddRelation(ctx context.Context, relation *model.IssueRelation) error
- func (r *IssueRepository) AddWatcher(ctx context.Context, issue model.ID, user model.ID) error
- func (r *IssueRepository) Create(ctx context.Context, project model.ID, issue *model.Issue) error
- func (r *IssueRepository) Delete(ctx context.Context, id model.ID) error
- func (r *IssueRepository) Get(ctx context.Context, id model.ID) (*model.Issue, error)
- func (r *IssueRepository) GetAllForIssue(ctx context.Context, issueID model.ID, offset, limit int) ([]*model.Issue, error)
- func (r *IssueRepository) GetAllForProject(ctx context.Context, projectID model.ID, offset, limit int) ([]*model.Issue, error)
- func (r *IssueRepository) GetRelations(ctx context.Context, issue model.ID) ([]*model.IssueRelation, error)
- func (r *IssueRepository) GetWatchers(ctx context.Context, issue model.ID) ([]*model.User, error)
- func (r *IssueRepository) RemoveRelation(ctx context.Context, source, target model.ID, kind model.IssueRelationKind) error
- func (r *IssueRepository) RemoveWatcher(ctx context.Context, issue model.ID, user model.ID) error
- func (r *IssueRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Issue, error)
- type LabelRepository
- func (r *LabelRepository) AttachTo(ctx context.Context, labelID, attachTo model.ID) error
- func (r *LabelRepository) Create(ctx context.Context, label *model.Label) error
- func (r *LabelRepository) Delete(ctx context.Context, id model.ID) error
- func (r *LabelRepository) DetachFrom(ctx context.Context, labelID, detachFrom model.ID) error
- func (r *LabelRepository) Get(ctx context.Context, id model.ID) (*model.Label, error)
- func (r *LabelRepository) GetAll(ctx context.Context, offset, limit int) ([]*model.Label, error)
- func (r *LabelRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Label, error)
- type LicenseRepository
- func (r *LicenseRepository) ActiveOrganizationCount(ctx context.Context) (int, error)
- func (r *LicenseRepository) ActiveUserCount(ctx context.Context) (int, error)
- func (r *LicenseRepository) DocumentCount(ctx context.Context) (int, error)
- func (r *LicenseRepository) NamespaceCount(ctx context.Context) (int, error)
- func (r *LicenseRepository) ProjectCount(ctx context.Context) (int, error)
- func (r *LicenseRepository) RoleCount(ctx context.Context) (int, error)
- type NamespaceRepository
- func (r *NamespaceRepository) Create(ctx context.Context, orgID model.ID, namespace *model.Namespace) error
- func (r *NamespaceRepository) Delete(ctx context.Context, id model.ID) error
- func (r *NamespaceRepository) Get(ctx context.Context, id model.ID) (*model.Namespace, error)
- func (r *NamespaceRepository) GetAll(ctx context.Context, orgID model.ID, offset, limit int) ([]*model.Namespace, error)
- func (r *NamespaceRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Namespace, error)
- type OrganizationRepository
- func (r *OrganizationRepository) AddMember(ctx context.Context, orgID, memberID model.ID) error
- func (r *OrganizationRepository) Create(ctx context.Context, owner model.ID, organization *model.Organization) error
- func (r *OrganizationRepository) Delete(ctx context.Context, id model.ID) error
- func (r *OrganizationRepository) Get(ctx context.Context, id model.ID) (*model.Organization, error)
- func (r *OrganizationRepository) GetAll(ctx context.Context, offset, limit int) ([]*model.Organization, error)
- func (r *OrganizationRepository) RemoveMember(ctx context.Context, orgID, memberID model.ID) error
- func (r *OrganizationRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Organization, error)
- type PermissionRepository
- func (r *PermissionRepository) Create(ctx context.Context, perm *model.Permission) error
- func (r *PermissionRepository) Delete(ctx context.Context, id model.ID) error
- func (r *PermissionRepository) Get(ctx context.Context, id model.ID) (*model.Permission, error)
- func (r *PermissionRepository) GetBySubject(ctx context.Context, id model.ID) ([]*model.Permission, error)
- func (r *PermissionRepository) GetBySubjectAndTarget(ctx context.Context, source, target model.ID) ([]*model.Permission, error)
- func (r *PermissionRepository) GetByTarget(ctx context.Context, id model.ID) ([]*model.Permission, error)
- func (r *PermissionRepository) HasAnyRelation(ctx context.Context, source, target model.ID) (bool, error)
- func (r *PermissionRepository) HasPermission(ctx context.Context, subject, target model.ID, kinds ...model.PermissionKind) (bool, error)
- func (r *PermissionRepository) HasSystemRole(ctx context.Context, source model.ID, roles ...model.SystemRole) (bool, error)
- func (r *PermissionRepository) Update(ctx context.Context, id model.ID, kind model.PermissionKind) (*model.Permission, error)
- type ProjectRepository
- func (r *ProjectRepository) Create(ctx context.Context, namespaceID model.ID, project *model.Project) error
- func (r *ProjectRepository) Delete(ctx context.Context, id model.ID) error
- func (r *ProjectRepository) Get(ctx context.Context, id model.ID) (*model.Project, error)
- func (r *ProjectRepository) GetAll(ctx context.Context, namespaceID model.ID, offset, limit int) ([]*model.Project, error)
- func (r *ProjectRepository) GetByKey(ctx context.Context, key string) (*model.Project, error)
- func (r *ProjectRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Project, error)
- type PropertyGetter
- type RepositoryOption
- type RoleRepository
- func (r *RoleRepository) AddMember(ctx context.Context, roleID, memberID, belongsToID model.ID) error
- func (r *RoleRepository) Create(ctx context.Context, createdBy, belongsTo model.ID, role *model.Role) error
- func (r *RoleRepository) Delete(ctx context.Context, id, belongsTo model.ID) error
- func (r *RoleRepository) Get(ctx context.Context, id, belongsTo model.ID) (*model.Role, error)
- func (r *RoleRepository) GetAllBelongsTo(ctx context.Context, belongsTo model.ID, offset, limit int) ([]*model.Role, error)
- func (r *RoleRepository) RemoveMember(ctx context.Context, roleID, memberID, belongsToID model.ID) error
- func (r *RoleRepository) Update(ctx context.Context, id, belongsTo model.ID, patch map[string]any) (*model.Role, error)
- type TodoRepository
- func (r *TodoRepository) Create(ctx context.Context, todo *model.Todo) error
- func (r *TodoRepository) Delete(ctx context.Context, id model.ID) error
- func (r *TodoRepository) Get(ctx context.Context, id model.ID) (*model.Todo, error)
- func (r *TodoRepository) GetByOwner(ctx context.Context, ownerID model.ID, offset, limit int, completed *bool) ([]*model.Todo, error)
- func (r *TodoRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.Todo, error)
- type UserRepository
- func (r *UserRepository) Create(ctx context.Context, user *model.User) error
- func (r *UserRepository) Delete(ctx context.Context, id model.ID) error
- func (r *UserRepository) Get(ctx context.Context, id model.ID) (*model.User, error)
- func (r *UserRepository) GetAll(ctx context.Context, offset, limit int) ([]*model.User, error)
- func (r *UserRepository) GetByEmail(ctx context.Context, email string) (*model.User, error)
- func (r *UserRepository) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.User, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoMoreRecords is returned by neo4j.Result.Next() when there are no // more records to be read, and the result has been fully consumed, but // we are still trying to read more. ErrNoMoreRecords = &neo4j.UsageError{ Message: "Result contains no more records", } )
Functions ¶
func ExecuteAndConsumeResult ¶
func ExecuteAndConsumeResult(ctx context.Context, tx neo4j.ManagedTransaction, query string, params map[string]any) error
ExecuteAndConsumeResult executes a query and consumes its result.
func ExecuteReadAndReadAll ¶
func ExecuteReadAndReadAll[T any](ctx context.Context, db *Database, query string, params map[string]any, reader func(record *neo4j.Record) (T, error)) ([]T, error)
ExecuteReadAndReadAll executes a query and reads all results.
func ExecuteReadAndReadSingle ¶
func ExecuteReadAndReadSingle[T any](ctx context.Context, db *Database, query string, params map[string]any, reader func(record *neo4j.Record) (*T, error)) (*T, error)
ExecuteReadAndReadSingle executes a query and reads a single result.
func ExecuteWriteAndConsume ¶
func ExecuteWriteAndConsume(ctx context.Context, db *Database, query string, params map[string]any) error
ExecuteWriteAndConsume executes a query and consumes its result.
func ExecuteWriteAndReadAll ¶
func ExecuteWriteAndReadAll[T any](ctx context.Context, db *Database, query string, params map[string]any, reader func(record *neo4j.Record) (T, error)) ([]T, error)
ExecuteWriteAndReadAll executes a query and reads all results.
func ExecuteWriteAndReadSingle ¶
func ExecuteWriteAndReadSingle[T any](ctx context.Context, db *Database, query string, params map[string]any, reader func(record *neo4j.Record) (*T, error)) (*T, error)
ExecuteWriteAndReadSingle executes a query and reads a single result.
func NewDriver ¶
func NewDriver(conf *config.GraphDatabaseConfig) (neo4j.DriverWithContext, error)
NewDriver creates a new Neo4j driver.
func ParseIDsFromRecord ¶
ParseIDsFromRecord parses a list of IDs from a neo4j record.
func ParseValueFromRecord ¶
ParseValueFromRecord parses a value from a neo4j record.
func ScanIntoStruct ¶
func ScanIntoStruct(n PropertyGetter, dst any, exclude []string) error
ScanIntoStruct parses a struct from a neo4j node or relationship.
Types ¶
type AssignmentRepository ¶
type AssignmentRepository struct {
// contains filtered or unexported fields
}
AssignmentRepository is a repository for managing user assignments.
func NewAssignmentRepository ¶
func NewAssignmentRepository(opts ...RepositoryOption) (*AssignmentRepository, error)
NewAssignmentRepository creates a new assignment baseRepository.
func (*AssignmentRepository) Create ¶
func (r *AssignmentRepository) Create(ctx context.Context, assignment *model.Assignment) error
func (*AssignmentRepository) Get ¶
func (r *AssignmentRepository) Get(ctx context.Context, id model.ID) (*model.Assignment, error)
func (*AssignmentRepository) GetByResource ¶
func (r *AssignmentRepository) GetByResource(ctx context.Context, resourceID model.ID, offset, limit int) ([]*model.Assignment, error)
type AttachmentRepository ¶
type AttachmentRepository struct {
// contains filtered or unexported fields
}
AttachmentRepository is a repository for managing attachments.
func NewAttachmentRepository ¶
func NewAttachmentRepository(opts ...RepositoryOption) (*AttachmentRepository, error)
NewAttachmentRepository creates a new attachment baseRepository.
func (*AttachmentRepository) Create ¶
func (r *AttachmentRepository) Create(ctx context.Context, belongsTo model.ID, attachment *model.Attachment) error
func (*AttachmentRepository) Get ¶
func (r *AttachmentRepository) Get(ctx context.Context, id model.ID) (*model.Attachment, error)
func (*AttachmentRepository) GetAllBelongsTo ¶
func (r *AttachmentRepository) GetAllBelongsTo(ctx context.Context, belongsTo model.ID, offset, limit int) ([]*model.Attachment, error)
type CommentRepository ¶
type CommentRepository struct {
// contains filtered or unexported fields
}
CommentRepository is a repository for managing comments.
func NewCommentRepository ¶
func NewCommentRepository(opts ...RepositoryOption) (*CommentRepository, error)
NewCommentRepository creates a new comment baseRepository.
func (*CommentRepository) GetAllBelongsTo ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a Neo4j database, wrapping a Neo4j driver.
func NewDatabase ¶
func NewDatabase(opts ...DatabaseOption) (*Database, error)
NewDatabase creates a new Neo4j database.
func (*Database) GetReadSession ¶
func (db *Database) GetReadSession(ctx context.Context) neo4j.SessionWithContext
GetReadSession returns a "read" session.
func (*Database) GetWriteSession ¶
func (db *Database) GetWriteSession(ctx context.Context) neo4j.SessionWithContext
GetWriteSession returns a "write" session.
type DatabaseOption ¶
type DatabaseOption func(*Database)
DatabaseOption configures a Neo4j database.
func WithDatabaseLogger ¶
func WithDatabaseLogger(logger log.Logger) DatabaseOption
WithDatabaseLogger sets the logger for a Neo4j database.
func WithDatabaseName ¶
func WithDatabaseName(name string) DatabaseOption
WithDatabaseName sets the name for a Neo4j database.
func WithDatabaseTracer ¶
func WithDatabaseTracer(tracer tracing.Tracer) DatabaseOption
WithDatabaseTracer sets the tracer for a Neo4j database.
func WithDriver ¶
func WithDriver(driver neo4j.DriverWithContext) DatabaseOption
WithDriver sets the driver for a Neo4j database.
type DocumentRepository ¶
type DocumentRepository struct {
// contains filtered or unexported fields
}
DocumentRepository is a repository for managing documents.
func NewDocumentRepository ¶
func NewDocumentRepository(opts ...RepositoryOption) (*DocumentRepository, error)
NewDocumentRepository creates a new document baseRepository.
func (*DocumentRepository) GetAllBelongsTo ¶
func (*DocumentRepository) GetByCreator ¶
type EdgeKind ¶
type EdgeKind uint8
EdgeKind is the kind of relation between two entities.
const ( EdgeKindAssignedTo EdgeKind = iota + 1 // a user is assigned to a resource EdgeKindBelongsTo // a resource belongs to another EdgeKindCommented // a user commented a resource EdgeKindCreated // a user created a resource EdgeKindHasAttachment // a resource has an attachment EdgeKindHasComment // a resource has a comment EdgeKindHasLabel // a resource is labeled by a label EdgeKindHasNamespace // an organization has a namespace EdgeKindHasPermission // a subject has permission on a resource EdgeKindHasProject // a namespace has a project EdgeKindHasTeam // an organization or project has a team EdgeKindInvited // a user invited another user EdgeKindKindOf // a resource is a kind of another EdgeKindMemberOf // a user is a member of a team EdgeKindRelatedTo // a resource is related to another EdgeKindSpeaks // a user speaks a language EdgeKindWatches // a user watches a resource )
type IssueRepository ¶
type IssueRepository struct {
// contains filtered or unexported fields
}
IssueRepository is a repository for managing user issues.
func NewIssueRepository ¶
func NewIssueRepository(opts ...RepositoryOption) (*IssueRepository, error)
NewIssueRepository creates a new issue baseRepository.
func (*IssueRepository) AddRelation ¶
func (r *IssueRepository) AddRelation(ctx context.Context, relation *model.IssueRelation) error
func (*IssueRepository) AddWatcher ¶
func (*IssueRepository) GetAllForIssue ¶
func (*IssueRepository) GetAllForProject ¶
func (*IssueRepository) GetRelations ¶
func (r *IssueRepository) GetRelations(ctx context.Context, issue model.ID) ([]*model.IssueRelation, error)
func (*IssueRepository) GetWatchers ¶
func (*IssueRepository) RemoveRelation ¶
func (r *IssueRepository) RemoveRelation(ctx context.Context, source, target model.ID, kind model.IssueRelationKind) error
func (*IssueRepository) RemoveWatcher ¶
type LabelRepository ¶
type LabelRepository struct {
// contains filtered or unexported fields
}
LabelRepository is a repository for managing labels.
func NewLabelRepository ¶
func NewLabelRepository(opts ...RepositoryOption) (*LabelRepository, error)
NewLabelRepository creates a new label baseRepository.
func (*LabelRepository) DetachFrom ¶
type LicenseRepository ¶
type LicenseRepository struct {
// contains filtered or unexported fields
}
func NewLicenseRepository ¶
func NewLicenseRepository(opts ...RepositoryOption) (*LicenseRepository, error)
NewLicenseRepository creates a new LicenseRepository
func (*LicenseRepository) ActiveOrganizationCount ¶
func (r *LicenseRepository) ActiveOrganizationCount(ctx context.Context) (int, error)
func (*LicenseRepository) ActiveUserCount ¶
func (r *LicenseRepository) ActiveUserCount(ctx context.Context) (int, error)
func (*LicenseRepository) DocumentCount ¶
func (r *LicenseRepository) DocumentCount(ctx context.Context) (int, error)
func (*LicenseRepository) NamespaceCount ¶
func (r *LicenseRepository) NamespaceCount(ctx context.Context) (int, error)
func (*LicenseRepository) ProjectCount ¶
func (r *LicenseRepository) ProjectCount(ctx context.Context) (int, error)
type NamespaceRepository ¶
type NamespaceRepository struct {
// contains filtered or unexported fields
}
NamespaceRepository is a repository for managing namespaces.
func NewNamespaceRepository ¶
func NewNamespaceRepository(opts ...RepositoryOption) (*NamespaceRepository, error)
NewNamespaceRepository creates a new namespace baseRepository.
type OrganizationRepository ¶
type OrganizationRepository struct {
// contains filtered or unexported fields
}
OrganizationRepository is a repository for managing organizations.
func NewOrganizationRepository ¶
func NewOrganizationRepository(opts ...RepositoryOption) (*OrganizationRepository, error)
NewOrganizationRepository creates a new organization baseRepository.
func (*OrganizationRepository) Create ¶
func (r *OrganizationRepository) Create(ctx context.Context, owner model.ID, organization *model.Organization) error
func (*OrganizationRepository) Get ¶
func (r *OrganizationRepository) Get(ctx context.Context, id model.ID) (*model.Organization, error)
func (*OrganizationRepository) GetAll ¶
func (r *OrganizationRepository) GetAll(ctx context.Context, offset, limit int) ([]*model.Organization, error)
func (*OrganizationRepository) RemoveMember ¶
type PermissionRepository ¶
type PermissionRepository struct {
// contains filtered or unexported fields
}
PermissionRepository is a repository for managing permissions.
func NewPermissionRepository ¶
func NewPermissionRepository(opts ...RepositoryOption) (*PermissionRepository, error)
NewPermissionRepository creates a new permission baseRepository.
func (*PermissionRepository) Create ¶
func (r *PermissionRepository) Create(ctx context.Context, perm *model.Permission) error
Create creates a new permission if it does not already exist between the subject and target. If the permission already exists, no action is taken.
func (*PermissionRepository) Delete ¶
Delete deletes an existing permission. If the permission does not exist, no errors are returned.
func (*PermissionRepository) Get ¶
func (r *PermissionRepository) Get(ctx context.Context, id model.ID) (*model.Permission, error)
Get returns an existing permission, its subject and target. If the permission does not exist, an error is returned.
func (*PermissionRepository) GetBySubject ¶
func (r *PermissionRepository) GetBySubject(ctx context.Context, id model.ID) ([]*model.Permission, error)
GetBySubject returns all permissions for a given subject. If no permissions exist, an empty slice is returned.
func (*PermissionRepository) GetBySubjectAndTarget ¶
func (r *PermissionRepository) GetBySubjectAndTarget(ctx context.Context, source, target model.ID) ([]*model.Permission, error)
GetBySubjectAndTarget returns all permissions for a given target that the source has. If no permissions exist, an empty slice is returned.
func (*PermissionRepository) GetByTarget ¶
func (r *PermissionRepository) GetByTarget(ctx context.Context, id model.ID) ([]*model.Permission, error)
GetByTarget returns all permissions for a given target. If no permissions exist, an empty slice is returned.
func (*PermissionRepository) HasAnyRelation ¶
func (r *PermissionRepository) HasAnyRelation(ctx context.Context, source, target model.ID) (bool, error)
HasAnyRelation returns true if there is a relation between the source and target. If there is no relation, false is returned.
func (*PermissionRepository) HasPermission ¶
func (r *PermissionRepository) HasPermission(ctx context.Context, subject, target model.ID, kinds ...model.PermissionKind) (bool, error)
HasPermission returns true if the subject has the given permission on the target. If the permission does not exist, false is returned. TODO: Refactor this code. This is a mess.
func (*PermissionRepository) HasSystemRole ¶
func (r *PermissionRepository) HasSystemRole(ctx context.Context, source model.ID, roles ...model.SystemRole) (bool, error)
HasSystemRole returns true if there is a relation between the source and target that is a system role. If there is no relation, false is returned.
func (*PermissionRepository) Update ¶
func (r *PermissionRepository) Update(ctx context.Context, id model.ID, kind model.PermissionKind) (*model.Permission, error)
Update updates an existing permission's kind. If the permission does not exist, an error is returned. If the permission's kind is already the same as the one provided, the kind is overwritten and the updated_at timestamp is updated.
type ProjectRepository ¶
type ProjectRepository struct {
// contains filtered or unexported fields
}
ProjectRepository is a repository for managing projects.
func NewProjectRepository ¶
func NewProjectRepository(opts ...RepositoryOption) (*ProjectRepository, error)
NewProjectRepository creates a new project baseRepository.
type PropertyGetter ¶
PropertyGetter is an interface for getting properties from a node or relationship.
type RepositoryOption ¶
type RepositoryOption func(*baseRepository) error
RepositoryOption configures a baseRepository for a Neo4j baseRepository.
func WithDatabase ¶
func WithDatabase(db *Database) RepositoryOption
WithDatabase sets the baseRepository for a baseRepository.
func WithRepositoryLogger ¶
func WithRepositoryLogger(logger log.Logger) RepositoryOption
WithRepositoryLogger sets the logger for a baseRepository.
func WithRepositoryTracer ¶
func WithRepositoryTracer(tracer tracing.Tracer) RepositoryOption
WithRepositoryTracer sets the tracer for a baseRepository.
type RoleRepository ¶
type RoleRepository struct {
// contains filtered or unexported fields
}
RoleRepository is a repository for managing roles.
func NewRoleRepository ¶
func NewRoleRepository(opts ...RepositoryOption) (*RoleRepository, error)
NewRoleRepository creates a new role baseRepository.
func (*RoleRepository) GetAllBelongsTo ¶
func (*RoleRepository) RemoveMember ¶
type TodoRepository ¶
type TodoRepository struct {
// contains filtered or unexported fields
}
TodoRepository is a repository for managing todos.
func NewTodoRepository ¶
func NewTodoRepository(opts ...RepositoryOption) (*TodoRepository, error)
NewTodoRepository creates a new todo baseRepository.
func (*TodoRepository) GetByOwner ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is a repository for managing users.
func NewUserRepository ¶
func NewUserRepository(opts ...RepositoryOption) (*UserRepository, error)
NewUserRepository creates a new user baseRepository.
func (*UserRepository) Create ¶
Create creates a new user if it does not already exist. Also, create all missing languages and user-language relationships.
func (*UserRepository) GetByEmail ¶
GetByEmail returns a user by its email.