query

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 22

Documentation

Index

Constants

View Source
const MaxSearchPostsLimit = 1000

MaxSearchPostsLimit is the largest number of posts that can be requested over HTTP. There is no offset parameter: the home page and roadmap "show more" links work by increasing the limit, so this is deliberately generous.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountPostPerStatus

type CountPostPerStatus struct {
	Result map[enum.PostStatus]int
}

type CountUnreadNotifications

type CountUnreadNotifications struct {
	Result int
}

type CountUsers

type CountUsers struct {
	Result int
}

type CreateEditWebhook added in v0.20.0

type CreateEditWebhook struct {
	ID          int
	Name        string
	Type        enum.WebhookType
	Status      enum.WebhookStatus
	Url         string
	Content     string
	HttpMethod  string
	HttpHeaders entity.HttpHeaders

	Result int
}

type DeleteWebhook added in v0.20.0

type DeleteWebhook struct {
	ID int
}

type FetchRecentSupressions added in v0.20.0

type FetchRecentSupressions struct {
	StartTime time.Time

	//Output
	EmailAddresses []string
}

type FindSimilarPosts added in v0.28.0

type FindSimilarPosts struct {
	Query string

	Result []*entity.Post
}

type GetActiveNotifications

type GetActiveNotifications struct {
	Result []*entity.Notification
}

type GetActiveSubscribers

type GetActiveSubscribers struct {
	Number  int
	Channel enum.NotificationChannel
	Event   enum.NotificationEvent

	Result []*entity.User
}

type GetActiveVerificationByEmail added in v0.35.0

type GetActiveVerificationByEmail struct {
	Email string
	Kind  enum.EmailVerificationKind

	// Output
	Result *entity.EmailVerification
}

type GetAllPosts

type GetAllPosts struct {
	Result []*entity.Post
}

type GetAllTags

type GetAllTags struct {
	Result []*entity.Tag
}

type GetAllUsers

type GetAllUsers struct {
	Result []*entity.User
}

type GetAllUsersNames added in v0.25.0

type GetAllUsersNames struct {
	Result []*dto.UserNames
}

type GetAssignedTags

type GetAssignedTags struct {
	Post *entity.Post

	Result []*entity.Tag
}

type GetAttachments

type GetAttachments struct {
	Post    *entity.Post
	Comment *entity.Comment

	Result []string
}

type GetBillingSubscription added in v0.20.0

type GetBillingSubscription struct {
	SubscriptionID string

	// Output
	Result *entity.BillingSubscription
}

type GetBlobByKey

type GetBlobByKey struct {
	Key string

	Result *dto.Blob
}

type GetCommentByID

type GetCommentByID struct {
	CommentID int
	// PostID, when set, restricts the lookup to comments on that post
	PostID int

	Result *entity.Comment
}

type GetCommentsByPost

type GetCommentsByPost struct {
	Post *entity.Post

	Result []*entity.Comment
}

type GetCurrentUserSettings

type GetCurrentUserSettings struct {
	Result map[string]string
}

type GetCustomOAuthConfigByProvider

type GetCustomOAuthConfigByProvider struct {
	Provider string

	Result *entity.OAuthConfig
}

type GetFirstTenant

type GetFirstTenant struct {

	// Output
	Result *entity.Tenant
}

type GetMentionNotifications added in v0.25.0

type GetMentionNotifications struct {
	CommentID int
	PostID    int

	Result []*entity.MentionNotification
}

type GetModerationCount added in v0.33.0

type GetModerationCount struct {
	Result int
}

type GetModerationItems added in v0.33.0

type GetModerationItems struct {
	Result []*ModerationItem
}

type GetNotificationByID

type GetNotificationByID struct {
	ID     int
	Result *entity.Notification
}

type GetOAuthAuthorizationURL

type GetOAuthAuthorizationURL struct {
	Provider   string
	Redirect   string
	Identifier string
	// Code is optional, used to store code of the draft post in the state that is passed through the OAuth flow
	Code string

	Result string
}

type GetOAuthProfile

type GetOAuthProfile struct {
	Provider string
	Code     string

	Result *dto.OAuthUserProfile
}

type GetOAuthRawProfile

type GetOAuthRawProfile struct {
	Provider string
	Code     string

	Result string
}

type GetPendingSignUpVerification added in v0.31.0

type GetPendingSignUpVerification struct {
	// Output
	Result *entity.EmailVerification
}

type GetPostByID

type GetPostByID struct {
	PostID int

	Result *entity.Post
}

type GetPostByNumber

type GetPostByNumber struct {
	Number int

	Result *entity.Post
}

type GetPostBySlug

type GetPostBySlug struct {
	Slug string

	Result *entity.Post
}

type GetStripeBillingState added in v0.33.0

type GetStripeBillingState struct {
	// Output
	Result *entity.StripeBillingState
}

type GetSystemSettings added in v0.20.0

type GetSystemSettings struct {
	Key string

	// Output
	Value string
}

type GetTagBySlug

type GetTagBySlug struct {
	Slug string

	Result *entity.Tag
}

type GetTenantByCancelKey added in v0.36.0

type GetTenantByCancelKey struct {
	Key string

	// Output
	Result *entity.Tenant
}

GetTenantByCancelKey looks up the tenant holding the given deletion cancel key.

type GetTenantByDomain

type GetTenantByDomain struct {
	Domain string

	// Output
	Result *entity.Tenant
}

type GetTenantOwner added in v0.36.0

type GetTenantOwner struct {
	TenantID int

	// Output
	Result *entity.User
}

GetTenantOwner returns the account owner: the active Administrator with the lowest users.id (the user that created the tenant at signup).

type GetTenantProviderStatus added in v0.30.0

type GetTenantProviderStatus struct {
	Provider string

	Result *entity.TenantProvider
}

type GetTenantsPendingDeletion added in v0.36.0

type GetTenantsPendingDeletion struct {
	// Output
	Result []*entity.Tenant
}

GetTenantsPendingDeletion returns tenants whose scheduled_deletion_at has passed, ordered oldest-first. Consumed by the deletion cron job.

type GetUserByAPIKey

type GetUserByAPIKey struct {
	APIKey string

	Result *entity.User
}

type GetUserByEmail

type GetUserByEmail struct {
	Email string

	Result *entity.User
}

type GetUserByID

type GetUserByID struct {
	UserID   int
	TenantID int

	Result *entity.User
}

type GetUserByProvider

type GetUserByProvider struct {
	Provider string
	UID      string

	Result *entity.User
}

type GetVerificationByEmailAndCode added in v0.31.0

type GetVerificationByEmailAndCode struct {
	Email string
	Code  string
	Kind  enum.EmailVerificationKind

	// Output
	Result *entity.EmailVerification
}

type GetVerificationByKey

type GetVerificationByKey struct {
	Kind enum.EmailVerificationKind
	Key  string

	// Output
	Result *entity.EmailVerification
}

type GetWebhook added in v0.20.0

type GetWebhook struct {
	ID int

	Result *entity.Webhook
}

type IsCNAMEAvailable

type IsCNAMEAvailable struct {
	CNAME string

	// Output
	Result bool
}

type IsSubdomainAvailable

type IsSubdomainAvailable struct {
	Subdomain string

	// Output
	Result bool
}

type ListActiveOAuthProviders

type ListActiveOAuthProviders struct {
	Result []*dto.OAuthProviderOption
}

type ListActiveWebhooksByType added in v0.20.0

type ListActiveWebhooksByType struct {
	Type enum.WebhookType

	Result []*entity.Webhook
}

type ListAllOAuthProviders

type ListAllOAuthProviders struct {
	Result []*dto.OAuthProviderOption
}

type ListAllWebhooks added in v0.20.0

type ListAllWebhooks struct {
	Result []*entity.Webhook
}

type ListAllWebhooksByType added in v0.20.0

type ListAllWebhooksByType struct {
	Type string

	Result []*entity.Webhook
}

type ListBlobs

type ListBlobs struct {
	Prefix string

	Result []string
}

type ListCustomOAuthConfig

type ListCustomOAuthConfig struct {
	Result []*entity.OAuthConfig
}

type ListPostVotes

type ListPostVotes struct {
	PostID       int
	Limit        int
	IncludeEmail bool

	Result []*entity.Vote
}

type MarkWebhookAsFailed added in v0.20.0

type MarkWebhookAsFailed struct {
	ID int
}

type ModerationItem added in v0.33.0

type ModerationItem struct {
	Type       string                `json:"type"` // "post" or "comment"
	ID         int                   `json:"id"`
	PostID     int                   `json:"postId,omitempty"`
	PostNumber int                   `json:"postNumber,omitempty"`
	PostSlug   string                `json:"postSlug,omitempty"`
	Title      string                `json:"title,omitempty"`
	Content    string                `json:"content"`
	User       *entity.UserWithEmail `json:"user"`
	CreatedAt  time.Time             `json:"createdAt"`
	PostTitle  string                `json:"postTitle,omitempty"`
}

type PostIsReferenced

type PostIsReferenced struct {
	PostID int

	Result bool
}

type SearchPosts

type SearchPosts struct {
	Query            string
	View             string
	Limit            string
	Statuses         []enum.PostStatus
	Tags             []string
	MyVotesOnly      bool
	NoTagsOnly       bool
	MyPostsOnly      bool
	ModerationFilter string // "pending", "approved", or empty (all)

	Result []*entity.Post
}

func (*SearchPosts) SetLimitFromString added in v0.38.2

func (q *SearchPosts) SetLimitFromString(limit string, unlimited bool)

SetLimitFromString sets Limit from an untrusted value such as a query string parameter. Invalid or non-positive values fall back to the default limit. Unless unlimited is true, larger values are clamped to MaxSearchPostsLimit and "all" means MaxSearchPostsLimit rather than no limit at all.

func (*SearchPosts) SetStatusesFromStrings added in v0.25.0

func (q *SearchPosts) SetStatusesFromStrings(statuses []string)

type SearchUsers added in v0.33.0

type SearchUsers struct {
	Query string
	Roles []string
	Page  int
	Limit int

	Result     []*entity.User
	TotalCount int
}

type UserSubscribedTo

type UserSubscribedTo struct {
	PostID int

	Result bool
}

Jump to

Keyboard shortcuts

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