repositories

package
v0.0.0-...-d625e3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokensRepository

type AccessTokensRepository interface {
	Create(userID int64, name, tokenHash string) (*models.AccessToken, error)
	FindByID(id int64) (*models.AccessToken, error)
	FindByTokenHash(tokenHash string) (*models.AccessToken, error)
	FindByUserID(userID int64) ([]*models.AccessToken, error)
	UpdateLastUsed(id int64) error
	Delete(id int64) error
}

func NewAccessTokensRepository

func NewAccessTokensRepository(db *sql.DB) AccessTokensRepository

type ContributorsRepository

type ContributorsRepository interface {
	Create(repositoryID, userID int64, role string) (*models.Contributor, error)
	FindByID(id int64) (*models.Contributor, error)
	FindByRepositoryAndUser(repositoryID, userID int64) (*models.Contributor, error)
	FindAllByRepository(repositoryID int64) ([]*models.Contributor, error)
	FindAllByUser(userID int64) ([]*models.Contributor, error)
	UpdateRole(id int64, role string) error
	Delete(id int64) error
	DeleteByRepositoryAndUser(repositoryID, userID int64) error
}

func NewContributorsRepository

func NewContributorsRepository(db *sql.DB) ContributorsRepository

type DeviceAuthSessionsRepository

type DeviceAuthSessionsRepository interface {
	Create(id, code string, expiresAt int64) (*models.DeviceAuthSession, error)
	FindByID(id string) (*models.DeviceAuthSession, error)
	FindByCode(code string) (*models.DeviceAuthSession, error)
	Confirm(id string, userID int64, accessToken string) error
	UpdateStatus(id, status string) error
	DeleteExpired() error
}

func NewDeviceAuthSessionsRepository

func NewDeviceAuthSessionsRepository(db *sql.DB) DeviceAuthSessionsRepository

type OrganizationsRepository

type OrganizationsRepository interface {
	Create(username, displayName string) (*models.Organization, error)
	FindByID(id int64) (*models.Organization, error)
	FindByUsername(username string) (*models.Organization, error)
	FindAll() ([]*models.Organization, error)
	Update(org *models.Organization) error
	Delete(id int64) error
}

func NewOrganizationsRepository

func NewOrganizationsRepository(db *sql.DB) OrganizationsRepository

type RepositoriesRepository

type RepositoriesRepository interface {
	CreateForUser(userID int64, name, visibility, defaultBranch string, description *string) (*models.Repository, error)
	CreateForOrg(orgID int64, name, visibility, defaultBranch string, description *string) (*models.Repository, error)
	FindByID(id int64) (*models.Repository, error)
	FindByUserAndName(userID int64, name string) (*models.Repository, error)
	FindByOrgAndName(orgID int64, name string) (*models.Repository, error)
	FindByOwnerAndName(ownerUsername, repoName string) (*models.Repository, error)
	FindAllByUser(userID int64) ([]*models.Repository, error)
	FindAllByOrg(orgID int64) ([]*models.Repository, error)
	FindPublic() ([]*models.Repository, error)
	FindAll() ([]*models.Repository, error)
	Update(repo *models.Repository) error
	Delete(id int64) error
}

func NewRepositoriesRepository

func NewRepositoriesRepository(db *sql.DB) RepositoriesRepository

type StarsRepository

type StarsRepository interface {
	Create(repositoryID, userID int64) (*models.Star, error)
	Delete(repositoryID, userID int64) error
	FindByUserAndRepository(repositoryID, userID int64) (*models.Star, error)
	CountByRepository(repositoryID int64) (int64, error)
	FindStarredRepositoriesByUser(userID int64) ([]*models.Repository, error)
}

func NewStarsRepository

func NewStarsRepository(db *sql.DB) StarsRepository

type TicketsRepository

type TicketsRepository interface {
	Create(repositoryID, authorID int64, title string, body *string) (*models.Ticket, error)
	FindByID(id int64) (*models.Ticket, error)
	FindByRepositoryAndNumber(repositoryID, number int64) (*models.Ticket, error)
	FindAllByRepository(repositoryID int64, status string) ([]*models.Ticket, error)
	CountByRepository(repositoryID int64, status string) (int64, error)
	Update(ticket *models.Ticket) error
	Close(ticketID, closedByID int64) error
	Reopen(ticketID int64) error
	Delete(id int64) error

	// Comments
	CreateComment(ticketID, authorID int64, body string) (*models.TicketComment, error)
	FindCommentsByTicket(ticketID int64) ([]*models.TicketComment, error)
	UpdateComment(comment *models.TicketComment) error
	DeleteComment(id int64) error
}

func NewTicketsRepository

func NewTicketsRepository(db *sql.DB) TicketsRepository

type UsersRepository

type UsersRepository interface {
	Create(username, email, displayName, password string) (*models.User, error)
	CreateFromGitHub(username, email, displayName, githubUserID string) (*models.User, error)
	FindByID(id int64) (*models.User, error)
	FindByUsername(username string) (*models.User, error)
	FindByEmail(email string) (*models.User, error)
	FindByGitHubUserID(githubUserID string) (*models.User, error)
	FindAll() ([]*models.User, error)
	Update(user *models.User) error
	Delete(id int64) error
}

func NewUsersRepository

func NewUsersRepository(db *sql.DB) UsersRepository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL