kindsroute

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package kindsroute serves the site's public content model: the part of kinds.Config clients render content and entity kinds with. Domain policy, restrictions and token claims stay on the server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(c kinds.Config, signals func() bool, avatars *media.PresetRule) (http.Handler, error)

Handler serves GET /kinds from c and the avatar preset, rendered once, and whether signals are recorded, asked per request.

Types

type ContentModel

type ContentModel struct {
	Languages  []string                   `json:"languages"`
	Tiers      []string                   `json:"tiers"`
	Kinds      map[string]kinds.Kind      `json:"kinds"`
	GroupKinds map[string]kinds.GroupKind `json:"entity_kinds"`
	// Signals: the site records signals and exposures now. Without, clients
	// send none and read the model again later: a configured signal plane
	// that is down comes back (history, similar and recommendations answer
	// unavailable meanwhile), one never configured answers not_configured.
	Signals bool `json:"signals"`
	// Avatars is people's avatar preset (Stable): an avatar's URLs are its
	// names at {base}/v1/{namespace}/{kind}/{user id}/public/, and its
	// uploads target {kind, user id}. Absent: people have none.
	Avatars *media.PresetRule `json:"avatars,omitempty"`
}

ContentModel is the public part of kinds.Config.

func Public

func Public(c kinds.Config, signals bool, avatars *media.PresetRule) ContentModel

Public is c's public part, with empty lists and maps rather than null and each kind's locked view spelled out.

Jump to

Keyboard shortcuts

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