Documentation
¶
Overview ¶
Package clip provides the clip capability for creating shareable markdown clips.
Index ¶
Constants ¶
View Source
const ( // OpCreate creates a shareable markdown clip and returns its public URL. OpCreate = "create" // OpGet loads a clip by slug. OpGet = "get" // OpHealth reports whether the clip capability is registered and ready. OpHealth = "health" )
View Source
const (
// MaxContentBytes is the maximum accepted markdown body size for create.
MaxContentBytes = 512 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register() error
Register registers the clip capability with hub and invoker registry.
func SetMetaLLMForTest ¶
func SetMetaLLMForTest(fn metaLLMFunc)
SetMetaLLMForTest overrides LLM metadata generation in unit tests.
func SetPersister ¶
func SetPersister(p Persister)
SetPersister wires the persistence backend used by clip.create.
Types ¶
type Persister ¶
type Persister interface {
// CreateClip inserts a clip row keyed by slug.
CreateClip(ctx context.Context, slug, title, description, content, createdBy string) error
// GetClipBySlug returns a clip by slug, or nil when not found.
GetClipBySlug(ctx context.Context, slug string) (*Record, error)
}
Persister stores and loads clips.
type Record ¶
type Record struct {
// Slug is the public short identifier.
Slug string
// Title is the clip title.
Title string
// Description is the short preview text.
Description string
// Content is the markdown body.
Content string
// CreatedBy is the optional creator identifier.
CreatedBy string
// CreatedAt is when the clip was created.
CreatedAt time.Time
}
Record is a persisted clip returned by get operations.
Click to show internal directories.
Click to hide internal directories.