contentpage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHashFromURL

func ExtractHashFromURL(rawURL string) string

Types

type ContentPageHandler

type ContentPageHandler struct {
	// contains filtered or unexported fields
}

func NewContentPageHandler

func NewContentPageHandler(
	contentService ContentService,
	postTypeResolver PostTypeResolver,
	userFieldResolver UserFieldResolver,
	userProvider UserProvider,
	templates *tpl.Templates,
	renderer tiptap.Renderer,
	mediaRepo mediadomain.Repository,
	languages []string,
) *ContentPageHandler

func (*ContentPageHandler) ServeHTTP

func (h *ContentPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ContentService

type ContentService interface {
	GetPublished(ctx context.Context, limit int, offset int) ([]*contentdomain.Content, error)
	GetPublishedBySlugAny(ctx context.Context, slug string) (*contentdomain.Content, error)
	GetPublishedByID(ctx context.Context, id int) (*contentdomain.Content, error)
	GetPublishedByAuthorUsername(ctx context.Context, username string, limit int, offset int) ([]*contentdomain.Content, error)
	AuthorExists(ctx context.Context, username string) (bool, error)
	GetPublishedPages(ctx context.Context) ([]*contentdomain.Content, error)
	GetPublishedCustomPostTypes(ctx context.Context) ([]string, error)
	GetPublishedByPostType(ctx context.Context, postType string, limit int, offset int) ([]*contentdomain.Content, error)
	GetPublishedByTag(ctx context.Context, tag string, limit int, offset int) ([]*contentdomain.Content, error)
	GetCommentsForContent(ctx context.Context, contentID int) ([]*contentdomain.Comment, error)
	GetTranslations(ctx context.Context, translationGroupID int, excludeID int) ([]*contentdomain.Content, error)
}

type PostTypeResolver

type PostTypeResolver interface {
	GetBySlug(slug string) (posttype.PostType, error)
}

type UserBasicInfo

type UserBasicInfo struct {
	Name           string
	Username       string
	CustomFields   map[string]any
	ProfilePicture string
}

type UserFieldResolver

type UserFieldResolver interface {
	GetUserFields() []customfield.FieldSchema
}

type UserProvider

type UserProvider interface {
	GetUserByUsername(ctx context.Context, username string) (*UserBasicInfo, error)
}

func NewUserRepoAdapter

func NewUserRepoAdapter(getUser func(ctx context.Context, username string) (*UserBasicInfo, error)) UserProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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