server

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostHogAPIKey  = "phc_CGzEmfPURHyNWrG49yNJA7wY5io8URFu3sazRYTAXw6Z"
	PostHogAPIHost = "https://app.posthog.com"
)

Hardcoded PostHog project credentials. These are baked into the binary — users have no control over analytics configuration.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostHogClient added in v0.14.0

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

PostHogClient captures server-side analytics events to a PostHog project. Events are sent via the /capture REST endpoint — no SDK dependency required. All calls are fire-and-forget with a bounded worker goroutine so they never block request handlers.

func NewPostHogClient added in v0.14.0

func NewPostHogClient(apiKey, host string) *PostHogClient

NewPostHogClient returns an active client that starts a background worker. Returns nil if apiKey is empty.

func (*PostHogClient) Capture added in v0.14.0

func (c *PostHogClient) Capture(event, distinctID string, props map[string]any)

Capture enqueues an event. Properties are merged with the default server-side properties (os, arch, version). The call is non-blocking — if the queue is full the event is dropped silently.

func (*PostHogClient) Stop added in v0.14.0

func (c *PostHogClient) Stop()

Stop drains the queue and shuts down the worker.

type Server

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

func New

func New(port int, dir string, mode ServerMode) *Server

func (*Server) Start

func (s *Server) Start() error

type ServerMode

type ServerMode string

ServerMode determines the operational mode of the server.

const (
	ModeBuild ServerMode = "build"
	ModePlan  ServerMode = "plan"
)

type Theme

type Theme struct {
	Directory    string `json:"directory"`
	PrimaryColor string `json:"primaryColor"` // hex input from user, e.g. "#6366f1"
	Accent       string `json:"accent"`       // --accent
	AccentHover  string `json:"accentHover"`  // --accent-hover
	AccentSoft   string `json:"accentSoft"`   // --accent-soft (rgba)
	AccentRing   string `json:"accentRing"`   // --accent-ring (rgba)
	OnPrimary    string `json:"onPrimary"`    // text color on accent bg
	Glow         string `json:"glow"`         // --glow (rgba, for background accents)
	Tint         string `json:"tint"`         // --tint (rgba, ~5% for sidebar/header)
}

Theme holds a per-directory color palette derived from a user-chosen primary color.

Jump to

Keyboard shortcuts

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