Documentation
¶
Index ¶
- func CreateMockResponse(statusCode int, body string, headers map[string]string) *http.Response
- func NewMockAuthConfig() *auth.Config
- type AuthClientInterface
- type AuthUser
- type HTTPClientInterface
- type MockAuthClient
- func (m *MockAuthClient) CheckPermissions(ctx context.Context, userID string, orgID string, permission string) (bool, error)
- func (m *MockAuthClient) CreateUser(ctx context.Context, email string, password string, metadata map[string]any) (*AuthUser, error)
- func (m *MockAuthClient) GetUserClaims(ctx context.Context, token string) (*UserClaims, error)
- func (m *MockAuthClient) RefreshToken(ctx context.Context, refreshToken string) (*TokenResponse, error)
- func (m *MockAuthClient) SignIn(ctx context.Context, email string, password string) (*TokenResponse, error)
- func (m *MockAuthClient) SignOut(ctx context.Context, token string) error
- func (m *MockAuthClient) ValidateToken(ctx context.Context, token string) (*AuthUser, error)
- type MockAuthMiddleware
- type MockCrawler
- func (m *MockCrawler) DiscoverSitemapsAndRobots(ctx context.Context, domain string) (*crawler.SitemapDiscoveryResult, error)
- func (m *MockCrawler) FilterURLs(urls []string, includePaths, excludePaths []string) []string
- func (m *MockCrawler) GetUserAgent() string
- func (m *MockCrawler) ParseSitemap(ctx context.Context, sitemapURL string) ([]string, error)
- func (m *MockCrawler) WarmURL(ctx context.Context, url string, findLinks bool) (*crawler.CrawlResult, error)
- type MockDB
- func (m *MockDB) AcceptOrganisationInvite(ctx context.Context, token, userID string) (*db.OrganisationInvite, error)
- func (m *MockDB) AddOrganisationMember(userID, organisationID, role string) error
- func (m *MockDB) Close() error
- func (m *MockDB) CountOrganisationAdmins(ctx context.Context, organisationID string) (int, error)
- func (m *MockDB) CreateGoogleConnection(ctx context.Context, conn *db.GoogleAnalyticsConnection) error
- func (m *MockDB) CreateOrUpdateSiteSetting(ctx context.Context, setting *db.WebflowSiteSetting) error
- func (m *MockDB) CreateOrganisation(name string) (*db.Organisation, error)
- func (m *MockDB) CreateOrganisationInvite(ctx context.Context, invite *db.OrganisationInvite) (*db.OrganisationInvite, error)
- func (m *MockDB) CreateScheduler(ctx context.Context, scheduler *db.Scheduler) error
- func (m *MockDB) CreateSlackConnection(ctx context.Context, conn *db.SlackConnection) error
- func (m *MockDB) CreateSlackUserLink(ctx context.Context, link *db.SlackUserLink) error
- func (m *MockDB) CreateUser(userID, email string, firstName, lastName, fullName *string, orgName string) (*db.User, *db.Organisation, error)
- func (m *MockDB) CreateWebflowConnection(ctx context.Context, conn *db.WebflowConnection) error
- func (m *MockDB) DeleteGoogleConnection(ctx context.Context, connectionID, organisationID string) error
- func (m *MockDB) DeleteScheduler(ctx context.Context, schedulerID string) error
- func (m *MockDB) DeleteSiteSetting(ctx context.Context, orgID, siteID string) error
- func (m *MockDB) DeleteSiteSettingsByConnection(ctx context.Context, connectionID string) error
- func (m *MockDB) DeleteSlackConnection(ctx context.Context, connectionID, organisationID string) error
- func (m *MockDB) DeleteSlackUserLink(ctx context.Context, userID, connectionID string) error
- func (m *MockDB) DeleteWebflowConnection(ctx context.Context, connectionID, organisationID string) error
- func (m *MockDB) GetActivePlans(ctx context.Context) ([]db.Plan, error)
- func (m *MockDB) GetConfig() *db.Config
- func (m *MockDB) GetDB() *sql.DB
- func (m *MockDB) GetDomainNameByID(ctx context.Context, domainID int) (string, error)
- func (m *MockDB) GetDomainNames(ctx context.Context, domainIDs []int) (map[int]string, error)
- func (m *MockDB) GetDomainsForOrganisation(ctx context.Context, organisationID string) ([]db.OrganisationDomain, error)
- func (m *MockDB) GetEffectiveOrganisationID(user *db.User) string
- func (m *MockDB) GetExternalRedirects(organisationID string, startDate, endDate *time.Time) ([]db.ExternalRedirect, error)
- func (m *MockDB) GetGoogleConnection(ctx context.Context, connectionID string) (*db.GoogleAnalyticsConnection, error)
- func (m *MockDB) GetGoogleToken(ctx context.Context, connectionID string) (string, error)
- func (m *MockDB) GetJobActivity(organisationID string, startDate, endDate *time.Time) ([]db.ActivityPoint, error)
- func (m *MockDB) GetJobStats(organisationID string, startDate, endDate *time.Time) (*db.JobStats, error)
- func (m *MockDB) GetLastJobStartTimeForScheduler(ctx context.Context, schedulerID string) (*time.Time, error)
- func (m *MockDB) GetOrCreateDomainID(ctx context.Context, domain string) (int, error)
- func (m *MockDB) GetOrCreateUser(userID, email string, orgID *string) (*db.User, error)
- func (m *MockDB) GetOrganisation(organisationID string) (*db.Organisation, error)
- func (m *MockDB) GetOrganisationInviteByToken(ctx context.Context, token string) (*db.OrganisationInvite, error)
- func (m *MockDB) GetOrganisationMemberRole(ctx context.Context, userID, organisationID string) (string, error)
- func (m *MockDB) GetOrganisationPlanID(ctx context.Context, organisationID string) (string, error)
- func (m *MockDB) GetOrganisationUsageStats(ctx context.Context, orgID string) (*db.UsageStats, error)
- func (m *MockDB) GetPlatformOrgMapping(ctx context.Context, platform, platformID string) (*db.PlatformOrgMapping, error)
- func (m *MockDB) GetScheduler(ctx context.Context, schedulerID string) (*db.Scheduler, error)
- func (m *MockDB) GetSchedulersReadyToRun(ctx context.Context, limit int) ([]*db.Scheduler, error)
- func (m *MockDB) GetSiteSetting(ctx context.Context, orgID, siteID string) (*db.WebflowSiteSetting, error)
- func (m *MockDB) GetSiteSettingByID(ctx context.Context, settingID string) (*db.WebflowSiteSetting, error)
- func (m *MockDB) GetSiteSettingBySiteID(ctx context.Context, orgID, webflowSiteID string) (*db.WebflowSiteSetting, error)
- func (m *MockDB) GetSlackConnection(ctx context.Context, connectionID string) (*db.SlackConnection, error)
- func (m *MockDB) GetSlackToken(ctx context.Context, connectionID string) (string, error)
- func (m *MockDB) GetSlackUserLink(ctx context.Context, userID, connectionID string) (*db.SlackUserLink, error)
- func (m *MockDB) GetSlowPages(organisationID string, startDate, endDate *time.Time) ([]db.SlowPage, error)
- func (m *MockDB) GetUnreadNotificationCount(ctx context.Context, organisationID string) (int, error)
- func (m *MockDB) GetUser(userID string) (*db.User, error)
- func (m *MockDB) GetUserByWebhookToken(token string) (*db.User, error)
- func (m *MockDB) GetWebflowConnection(ctx context.Context, connectionID string) (*db.WebflowConnection, error)
- func (m *MockDB) GetWebflowToken(ctx context.Context, connectionID string) (string, error)
- func (m *MockDB) IsOrganisationMemberEmail(ctx context.Context, organisationID, email string) (bool, error)
- func (m *MockDB) ListAllSiteSettings(ctx context.Context, orgID string) ([]*db.WebflowSiteSetting, error)
- func (m *MockDB) ListConfiguredSiteSettings(ctx context.Context, orgID string) ([]*db.WebflowSiteSetting, error)
- func (m *MockDB) ListDailyUsage(ctx context.Context, organisationID string, startDate, endDate time.Time) ([]db.DailyUsageEntry, error)
- func (m *MockDB) ListGoogleConnections(ctx context.Context, organisationID string) ([]*db.GoogleAnalyticsConnection, error)
- func (m *MockDB) ListJobs(organisationID string, limit, offset int, status, dateRange, timezone string) ([]db.JobWithDomain, int, error)
- func (m *MockDB) ListJobsWithOffset(organisationID string, limit, offset int, status, dateRange string, ...) ([]db.JobWithDomain, int, error)
- func (m *MockDB) ListNotifications(ctx context.Context, organisationID string, limit, offset int, unreadOnly bool) ([]*db.Notification, int, error)
- func (m *MockDB) ListOrganisationInvites(ctx context.Context, organisationID string) ([]db.OrganisationInvite, error)
- func (m *MockDB) ListOrganisationMembers(ctx context.Context, organisationID string) ([]db.OrganisationMember, error)
- func (m *MockDB) ListSchedulers(ctx context.Context, organisationID string) ([]*db.Scheduler, error)
- func (m *MockDB) ListSiteSettingsByConnection(ctx context.Context, connectionID string) ([]*db.WebflowSiteSetting, error)
- func (m *MockDB) ListSlackConnections(ctx context.Context, organisationID string) ([]*db.SlackConnection, error)
- func (m *MockDB) ListUserOrganisations(userID string) ([]db.UserOrganisation, error)
- func (m *MockDB) ListWebflowConnections(ctx context.Context, organisationID string) ([]*db.WebflowConnection, error)
- func (m *MockDB) MarkAllNotificationsRead(ctx context.Context, organisationID string) error
- func (m *MockDB) MarkNotificationRead(ctx context.Context, notificationID, organisationID string) error
- func (m *MockDB) RecalculateJobStats(ctx context.Context, jobID string) error
- func (m *MockDB) RemoveOrganisationMember(ctx context.Context, userID, organisationID string) error
- func (m *MockDB) ResetDataOnly() error
- func (m *MockDB) ResetSchema() error
- func (m *MockDB) RevokeOrganisationInvite(ctx context.Context, inviteID, organisationID string) error
- func (m *MockDB) SetActiveOrganisation(userID, organisationID string) error
- func (m *MockDB) SetOrganisationPlan(ctx context.Context, organisationID, planID string) error
- func (m *MockDB) StoreGoogleToken(ctx context.Context, connectionID, token string) error
- func (m *MockDB) StoreSlackToken(ctx context.Context, connectionID, token string) error
- func (m *MockDB) StoreWebflowToken(ctx context.Context, connectionID, token string) error
- func (m *MockDB) UpdateGoogleConnectionStatus(ctx context.Context, connectionID, organisationID, status string) error
- func (m *MockDB) UpdateOrganisationMemberRole(ctx context.Context, userID, organisationID, role string) error
- func (m *MockDB) UpdateScheduler(ctx context.Context, schedulerID string, updates *db.Scheduler, ...) error
- func (m *MockDB) UpdateSchedulerNextRun(ctx context.Context, schedulerID string, nextRun time.Time) error
- func (m *MockDB) UpdateSiteAutoPublish(ctx context.Context, orgID, siteID string, enabled bool, webhookID string) error
- func (m *MockDB) UpdateSiteSchedule(ctx context.Context, orgID, siteID string, intervalHours *int, ...) error
- func (m *MockDB) UpdateSlackUserLinkNotifications(ctx context.Context, userID, connectionID string, dmNotifications bool) error
- func (m *MockDB) UpdateUserNames(userID string, firstName, lastName, fullName *string) error
- func (m *MockDB) UpsertOrganisationDomain(ctx context.Context, organisationID string, domainID int) error
- func (m *MockDB) UpsertPlatformOrgMapping(ctx context.Context, mapping *db.PlatformOrgMapping) error
- func (m *MockDB) ValidateOrganisationMembership(userID, organisationID string) (bool, error)
- type MockDbQueue
- func (m *MockDbQueue) CleanupStuckJobs(ctx context.Context) error
- func (m *MockDbQueue) CreatePageRecords(ctx context.Context, dbQueue *db.DbQueue, domainID int, domain string, ...) ([]int, []string, error)
- func (m *MockDbQueue) EnqueueURLs(ctx context.Context, jobID string, pages []db.Page, sourceType string, ...) error
- func (m *MockDbQueue) Execute(ctx context.Context, fn func(*sql.Tx) error) error
- func (m *MockDbQueue) ExecuteMaintenance(ctx context.Context, fn func(*sql.Tx) error) error
- func (m *MockDbQueue) GetNextTask(ctx context.Context, jobID string) (*db.Task, error)
- func (m *MockDbQueue) UpdateTaskStatus(ctx context.Context, task *db.Task) error
- type MockHTTPClient
- func (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error)
- func (m *MockHTTPClient) Get(url string) (*http.Response, error)
- func (m *MockHTTPClient) Head(url string) (*http.Response, error)
- func (m *MockHTTPClient) Post(url, contentType string, body any) (*http.Response, error)
- func (m *MockHTTPClient) PostForm(url string, data any) (*http.Response, error)
- type MockRoundTripper
- type MockSupabaseClient
- type MockTransport
- type MockWorkerPool
- type TokenResponse
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMockResponse ¶
CreateMockResponse creates a mock HTTP response for testing
func NewMockAuthConfig ¶
NewMockAuthConfig creates a mock auth configuration for testing
Types ¶
type AuthClientInterface ¶
type AuthClientInterface interface {
ValidateToken(ctx context.Context, token string) (*AuthUser, error)
RefreshToken(ctx context.Context, refreshToken string) (*TokenResponse, error)
GetUserClaims(ctx context.Context, token string) (*UserClaims, error)
CheckPermissions(ctx context.Context, userID string, orgID string, permission string) (bool, error)
CreateUser(ctx context.Context, email string, password string, metadata map[string]any) (*AuthUser, error)
SignIn(ctx context.Context, email string, password string) (*TokenResponse, error)
SignOut(ctx context.Context, token string) error
}
AuthClientInterface defines the interface for authentication client operations
type AuthUser ¶
type AuthUser struct {
ID string `json:"id"`
Email string `json:"email"`
FullName string `json:"full_name,omitempty"`
Metadata map[string]any `json:"user_metadata,omitempty"`
AppMetadata map[string]any `json:"app_metadata,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
LastSignInAt string `json:"last_sign_in_at,omitempty"`
}
AuthUser represents an authenticated user for testing
type HTTPClientInterface ¶
type HTTPClientInterface interface {
Do(req *http.Request) (*http.Response, error)
Get(url string) (*http.Response, error)
Post(url, contentType string, body any) (*http.Response, error)
PostForm(url string, data any) (*http.Response, error)
Head(url string) (*http.Response, error)
}
HTTPClientInterface defines the interface for HTTP client operations
type MockAuthClient ¶
MockAuthClient is a mock implementation of an authentication client
func (*MockAuthClient) CheckPermissions ¶
func (m *MockAuthClient) CheckPermissions(ctx context.Context, userID string, orgID string, permission string) (bool, error)
CheckPermissions mocks organisation role permission checks
func (*MockAuthClient) CreateUser ¶
func (m *MockAuthClient) CreateUser(ctx context.Context, email string, password string, metadata map[string]any) (*AuthUser, error)
CreateUser mocks user registration functionality
func (*MockAuthClient) GetUserClaims ¶
func (m *MockAuthClient) GetUserClaims(ctx context.Context, token string) (*UserClaims, error)
GetUserClaims mocks extracting user claims from JWT token
func (*MockAuthClient) RefreshToken ¶
func (m *MockAuthClient) RefreshToken(ctx context.Context, refreshToken string) (*TokenResponse, error)
RefreshToken mocks token refresh functionality
func (*MockAuthClient) SignIn ¶
func (m *MockAuthClient) SignIn(ctx context.Context, email string, password string) (*TokenResponse, error)
SignIn mocks user sign-in functionality
func (*MockAuthClient) SignOut ¶
func (m *MockAuthClient) SignOut(ctx context.Context, token string) error
SignOut mocks user sign-out functionality
func (*MockAuthClient) ValidateToken ¶
ValidateToken mocks JWT token validation
type MockAuthMiddleware ¶
MockAuthMiddleware is a mock for authentication middleware testing
func (*MockAuthMiddleware) ExtractTokenFromRequest ¶
func (m *MockAuthMiddleware) ExtractTokenFromRequest(r *http.Request) (string, error)
ExtractTokenFromRequest mocks token extraction from HTTP request
func (*MockAuthMiddleware) Middleware ¶
func (m *MockAuthMiddleware) Middleware(next http.Handler) http.Handler
Middleware mocks the authentication middleware handler
func (*MockAuthMiddleware) SetUserInContext ¶
SetUserInContext mocks setting user context in HTTP request
type MockCrawler ¶
MockCrawler is a mock implementation of the Crawler
func (*MockCrawler) DiscoverSitemapsAndRobots ¶
func (m *MockCrawler) DiscoverSitemapsAndRobots(ctx context.Context, domain string) (*crawler.SitemapDiscoveryResult, error)
DiscoverSitemapsAndRobots mocks the DiscoverSitemapsAndRobots method
func (*MockCrawler) FilterURLs ¶
func (m *MockCrawler) FilterURLs(urls []string, includePaths, excludePaths []string) []string
FilterURLs mocks the FilterURLs method
func (*MockCrawler) GetUserAgent ¶
func (m *MockCrawler) GetUserAgent() string
GetUserAgent mocks the GetUserAgent method
func (*MockCrawler) ParseSitemap ¶
ParseSitemap mocks the ParseSitemap method
func (*MockCrawler) WarmURL ¶
func (m *MockCrawler) WarmURL(ctx context.Context, url string, findLinks bool) (*crawler.CrawlResult, error)
WarmURL mocks the WarmURL method
type MockDB ¶
MockDB is a mock implementation of the database interface
func (*MockDB) AcceptOrganisationInvite ¶
func (m *MockDB) AcceptOrganisationInvite(ctx context.Context, token, userID string) (*db.OrganisationInvite, error)
AcceptOrganisationInvite mocks invite acceptance
func (*MockDB) AddOrganisationMember ¶
AddOrganisationMember mocks the AddOrganisationMember method
func (*MockDB) CountOrganisationAdmins ¶
CountOrganisationAdmins mocks admin counting
func (*MockDB) CreateGoogleConnection ¶
func (*MockDB) CreateOrUpdateSiteSetting ¶
func (*MockDB) CreateOrganisation ¶
func (m *MockDB) CreateOrganisation(name string) (*db.Organisation, error)
CreateOrganisation mocks the CreateOrganisation method
func (*MockDB) CreateOrganisationInvite ¶
func (m *MockDB) CreateOrganisationInvite(ctx context.Context, invite *db.OrganisationInvite) (*db.OrganisationInvite, error)
CreateOrganisationInvite mocks invite creation
func (*MockDB) CreateScheduler ¶
CreateScheduler mocks the CreateScheduler method
func (*MockDB) CreateSlackConnection ¶
func (*MockDB) CreateSlackUserLink ¶
func (*MockDB) CreateUser ¶
func (m *MockDB) CreateUser(userID, email string, firstName, lastName, fullName *string, orgName string) (*db.User, *db.Organisation, error)
CreateUser mocks creating a user and organisation
func (*MockDB) CreateWebflowConnection ¶
Webflow integration mock methods
func (*MockDB) DeleteGoogleConnection ¶
func (*MockDB) DeleteScheduler ¶
DeleteScheduler mocks the DeleteScheduler method
func (*MockDB) DeleteSiteSetting ¶
func (*MockDB) DeleteSiteSettingsByConnection ¶
func (*MockDB) DeleteSlackConnection ¶
func (*MockDB) DeleteSlackUserLink ¶
func (*MockDB) DeleteWebflowConnection ¶
func (*MockDB) GetActivePlans ¶
func (*MockDB) GetDomainNameByID ¶
GetDomainNameByID mocks the GetDomainNameByID method
func (*MockDB) GetDomainNames ¶
GetDomainNames mocks the GetDomainNames method
func (*MockDB) GetDomainsForOrganisation ¶
func (m *MockDB) GetDomainsForOrganisation(ctx context.Context, organisationID string) ([]db.OrganisationDomain, error)
GetDomainsForOrganisation mocks the GetDomainsForOrganisation method
func (*MockDB) GetEffectiveOrganisationID ¶
GetEffectiveOrganisationID mocks the GetEffectiveOrganisationID method
func (*MockDB) GetExternalRedirects ¶
func (m *MockDB) GetExternalRedirects(organisationID string, startDate, endDate *time.Time) ([]db.ExternalRedirect, error)
GetExternalRedirects mocks the GetExternalRedirects method
func (*MockDB) GetGoogleConnection ¶
func (*MockDB) GetGoogleToken ¶
func (*MockDB) GetJobActivity ¶
func (m *MockDB) GetJobActivity(organisationID string, startDate, endDate *time.Time) ([]db.ActivityPoint, error)
GetJobActivity mocks the GetJobActivity method
func (*MockDB) GetJobStats ¶
func (m *MockDB) GetJobStats(organisationID string, startDate, endDate *time.Time) (*db.JobStats, error)
GetJobStats mocks the GetJobStats method
func (*MockDB) GetLastJobStartTimeForScheduler ¶
func (m *MockDB) GetLastJobStartTimeForScheduler(ctx context.Context, schedulerID string) (*time.Time, error)
GetLastJobStartTimeForScheduler mocks the GetLastJobStartTimeForScheduler method
func (*MockDB) GetOrCreateDomainID ¶
GetOrCreateDomainID mocks the GetOrCreateDomainID method
func (*MockDB) GetOrCreateUser ¶
GetOrCreateUser mocks the GetOrCreateUser method
func (*MockDB) GetOrganisation ¶
func (m *MockDB) GetOrganisation(organisationID string) (*db.Organisation, error)
GetOrganisation mocks retrieving an organisation by ID
func (*MockDB) GetOrganisationInviteByToken ¶
func (m *MockDB) GetOrganisationInviteByToken(ctx context.Context, token string) (*db.OrganisationInvite, error)
GetOrganisationInviteByToken mocks invite lookup
func (*MockDB) GetOrganisationMemberRole ¶
func (m *MockDB) GetOrganisationMemberRole(ctx context.Context, userID, organisationID string) (string, error)
GetOrganisationMemberRole mocks role lookups
func (*MockDB) GetOrganisationPlanID ¶
GetOrganisationPlanID mocks plan retrieval
func (*MockDB) GetOrganisationUsageStats ¶
func (*MockDB) GetPlatformOrgMapping ¶
func (*MockDB) GetScheduler ¶
GetScheduler mocks the GetScheduler method
func (*MockDB) GetSchedulersReadyToRun ¶
GetSchedulersReadyToRun mocks the GetSchedulersReadyToRun method
func (*MockDB) GetSiteSetting ¶
func (*MockDB) GetSiteSettingByID ¶
func (*MockDB) GetSiteSettingBySiteID ¶
func (*MockDB) GetSlackConnection ¶
func (*MockDB) GetSlackToken ¶
func (*MockDB) GetSlackUserLink ¶
func (*MockDB) GetSlowPages ¶
func (m *MockDB) GetSlowPages(organisationID string, startDate, endDate *time.Time) ([]db.SlowPage, error)
GetSlowPages mocks the GetSlowPages method
func (*MockDB) GetUnreadNotificationCount ¶
func (*MockDB) GetUserByWebhookToken ¶
GetUserByWebhookToken mocks the GetUserByWebhookToken method
func (*MockDB) GetWebflowConnection ¶
func (*MockDB) GetWebflowToken ¶
func (*MockDB) IsOrganisationMemberEmail ¶
func (m *MockDB) IsOrganisationMemberEmail(ctx context.Context, organisationID, email string) (bool, error)
IsOrganisationMemberEmail mocks email membership checks
func (*MockDB) ListAllSiteSettings ¶
func (*MockDB) ListConfiguredSiteSettings ¶
func (*MockDB) ListDailyUsage ¶
func (m *MockDB) ListDailyUsage(ctx context.Context, organisationID string, startDate, endDate time.Time) ([]db.DailyUsageEntry, error)
ListDailyUsage mocks daily usage history
func (*MockDB) ListGoogleConnections ¶
func (*MockDB) ListJobs ¶
func (m *MockDB) ListJobs(organisationID string, limit, offset int, status, dateRange, timezone string) ([]db.JobWithDomain, int, error)
ListJobs mocks listing jobs with pagination and filters
func (*MockDB) ListJobsWithOffset ¶
func (*MockDB) ListNotifications ¶
func (*MockDB) ListOrganisationInvites ¶
func (m *MockDB) ListOrganisationInvites(ctx context.Context, organisationID string) ([]db.OrganisationInvite, error)
ListOrganisationInvites mocks invite listing
func (*MockDB) ListOrganisationMembers ¶
func (m *MockDB) ListOrganisationMembers(ctx context.Context, organisationID string) ([]db.OrganisationMember, error)
ListOrganisationMembers mocks member listing
func (*MockDB) ListSchedulers ¶
func (m *MockDB) ListSchedulers(ctx context.Context, organisationID string) ([]*db.Scheduler, error)
ListSchedulers mocks the ListSchedulers method
func (*MockDB) ListSiteSettingsByConnection ¶
func (*MockDB) ListSlackConnections ¶
func (*MockDB) ListUserOrganisations ¶
func (m *MockDB) ListUserOrganisations(userID string) ([]db.UserOrganisation, error)
ListUserOrganisations mocks the ListUserOrganisations method
func (*MockDB) ListWebflowConnections ¶
func (*MockDB) MarkAllNotificationsRead ¶
func (*MockDB) MarkNotificationRead ¶
func (*MockDB) RecalculateJobStats ¶
RecalculateJobStats mocks the RecalculateJobStats method
func (*MockDB) RemoveOrganisationMember ¶
RemoveOrganisationMember mocks member removal
func (*MockDB) ResetDataOnly ¶
ResetDataOnly mocks the ResetDataOnly method for testing data-only resets
func (*MockDB) ResetSchema ¶
ResetSchema mocks the ResetSchema method for testing database resets
func (*MockDB) RevokeOrganisationInvite ¶
func (m *MockDB) RevokeOrganisationInvite(ctx context.Context, inviteID, organisationID string) error
RevokeOrganisationInvite mocks invite revocation
func (*MockDB) SetActiveOrganisation ¶
SetActiveOrganisation mocks the SetActiveOrganisation method
func (*MockDB) SetOrganisationPlan ¶
SetOrganisationPlan mocks plan updates
func (*MockDB) StoreGoogleToken ¶
func (*MockDB) StoreSlackToken ¶
func (*MockDB) StoreWebflowToken ¶
func (*MockDB) UpdateGoogleConnectionStatus ¶
func (*MockDB) UpdateOrganisationMemberRole ¶
func (m *MockDB) UpdateOrganisationMemberRole(ctx context.Context, userID, organisationID, role string) error
UpdateOrganisationMemberRole mocks member role updates
func (*MockDB) UpdateScheduler ¶
func (m *MockDB) UpdateScheduler(ctx context.Context, schedulerID string, updates *db.Scheduler, expectedIsEnabled *bool) error
UpdateScheduler mocks the UpdateScheduler method
func (*MockDB) UpdateSchedulerNextRun ¶
func (m *MockDB) UpdateSchedulerNextRun(ctx context.Context, schedulerID string, nextRun time.Time) error
UpdateSchedulerNextRun mocks the UpdateSchedulerNextRun method
func (*MockDB) UpdateSiteAutoPublish ¶
func (*MockDB) UpdateSiteSchedule ¶
func (*MockDB) UpdateSlackUserLinkNotifications ¶
func (*MockDB) UpdateUserNames ¶
UpdateUserNames mocks updating user name fields
func (*MockDB) UpsertOrganisationDomain ¶
func (m *MockDB) UpsertOrganisationDomain(ctx context.Context, organisationID string, domainID int) error
UpsertOrganisationDomain mocks the UpsertOrganisationDomain method
func (*MockDB) UpsertPlatformOrgMapping ¶
type MockDbQueue ¶
MockDbQueue is a mock implementation of DbQueueProvider
func (*MockDbQueue) CleanupStuckJobs ¶
func (m *MockDbQueue) CleanupStuckJobs(ctx context.Context) error
CleanupStuckJobs mocks the CleanupStuckJobs method
func (*MockDbQueue) CreatePageRecords ¶
func (m *MockDbQueue) CreatePageRecords(ctx context.Context, dbQueue *db.DbQueue, domainID int, domain string, urls []string) ([]int, []string, error)
CreatePageRecords mocks the CreatePageRecords method
func (*MockDbQueue) EnqueueURLs ¶
func (m *MockDbQueue) EnqueueURLs(ctx context.Context, jobID string, pages []db.Page, sourceType string, sourceURL string) error
EnqueueURLs mocks the EnqueueURLs method
func (*MockDbQueue) ExecuteMaintenance ¶
ExecuteMaintenance mocks the ExecuteMaintenance method
func (*MockDbQueue) GetNextTask ¶
GetNextTask mocks the GetNextTask method
func (*MockDbQueue) UpdateTaskStatus ¶
UpdateTaskStatus mocks the UpdateTaskStatus method
type MockHTTPClient ¶
MockHTTPClient is a mock implementation of HTTP client interface
func NewMockHTTPClientWithTimeout ¶
func NewMockHTTPClientWithTimeout(timeout time.Duration) *MockHTTPClient
NewMockHTTPClientWithTimeout creates a mock HTTP client with timeout configuration
func (*MockHTTPClient) Get ¶
func (m *MockHTTPClient) Get(url string) (*http.Response, error)
Get mocks the Get method of http.Client
func (*MockHTTPClient) Head ¶
func (m *MockHTTPClient) Head(url string) (*http.Response, error)
Head mocks the Head method of http.Client
type MockRoundTripper ¶
MockRoundTripper is a mock implementation of http.RoundTripper interface
type MockSupabaseClient ¶
MockSupabaseClient is a mock for Supabase authentication client
func (*MockSupabaseClient) Auth ¶
func (m *MockSupabaseClient) Auth() *MockAuthClient
Auth mocks the Auth method to return auth client
type MockTransport ¶
MockTransport is a mock implementation for HTTP transport testing
type MockWorkerPool ¶
MockWorkerPool is a mock implementation of WorkerPool
func (*MockWorkerPool) CancelJobTasks ¶
func (m *MockWorkerPool) CancelJobTasks(jobID string) error
CancelJobTasks mocks the CancelJobTasks method
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token,omitempty"`
User *AuthUser `json:"user,omitempty"`
}
TokenResponse represents authentication tokens for testing
type UserClaims ¶
type UserClaims struct {
Sub string `json:"sub"` // User ID
Email string `json:"email"` // User email
EmailVerified bool `json:"email_verified"`
Role string `json:"role,omitempty"`
UserMetadata map[string]any `json:"user_metadata,omitempty"`
AppMetadata map[string]any `json:"app_metadata,omitempty"`
Aud string `json:"aud"` // Audience
Iss string `json:"iss"` // Issuer
Iat int64 `json:"iat"` // Issued at
Exp int64 `json:"exp"` // Expires at
}
UserClaims represents JWT token claims for testing