Documentation
¶
Overview ¶
Package onboarding is a new instance's first run: the claim code that makes the first owner, the getting-started checklist, and the sample data.
Index ¶
- Constants
- func MarkSynced(ctx context.Context, pool *pgxpool.Pool)
- func RegisterRoutes(api huma.API, pool *pgxpool.Pool, sample *Sample, facts func() SetupFacts)
- func RegisterSetupRoutes(api huma.API, claim *Claim, enforced bool, cookieSecure bool)
- func SendPing(ctx context.Context, client *http.Client, url string, p Ping) error
- type Claim
- type OnboardingStatus
- type Ping
- type Sample
- type SetupBody
- type SetupClaimBody
- type SetupFacts
- type Step
Constants ¶
const ClaimCookie = "skael_claim"
ClaimCookie carries a verified claim code through sign-up, including an OAuth round trip.
const PingInterval = 24 * time.Hour
PingInterval is how often the leader sends the ping.
const PingURL = "https://telemetry.skael.dev/v1/ping"
PingURL receives the anonymous install ping.
const SampleDomain = "@sample.skael.invalid"
SampleDomain marks the sample people.
const SampleSuite = "sample:onboarding"
SampleSuite marks the sample scores and the sample contest.
Variables ¶
This section is empty.
Functions ¶
func MarkSynced ¶
MarkSynced records the first sync from a CLI.
func RegisterRoutes ¶
RegisterRoutes serves the checklist to everyone signed in, and the sample actions to owners and admins.
func RegisterSetupRoutes ¶
RegisterSetupRoutes serves a fresh instance before anyone signs in. enforced is false where no claim code is required, such as in tests.
Types ¶
type Claim ¶
type Claim struct {
// contains filtered or unexported fields
}
Claim guards a fresh instance: until a person exists, signing up needs the code the server prints to its log.
func (*Claim) Ensure ¶
Ensure returns the claim code while the instance has no person, creating it once. It returns "" once someone has signed up.
type OnboardingStatus ¶
type OnboardingStatus struct {
Steps []Step `json:"steps"`
Setup []Step `json:"setup"`
SampleLoaded bool `json:"sample_loaded"`
// PublicURL is the saved public URL, empty when none is set.
PublicURL string `json:"public_url"`
}
OnboardingStatus is the checklist toward the first activation and the setup card, which blocks nothing.
func Status ¶
func Status(ctx context.Context, pool *pgxpool.Pool, facts SetupFacts) (*OnboardingStatus, error)
Status reads the checklist. Sample rows never complete a step.
type Ping ¶
type Ping struct {
InstallID string `json:"install_id"`
Version string `json:"version"`
PostgresVersion string `json:"postgres_version"`
Workers int `json:"workers"`
EvalsConfigured bool `json:"evals_configured"`
}
Ping is everything the install ping sends. Nothing in it names a person, a company, a skill or a host.
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Sample loads and removes the sample workspace.
func NewSample ¶
func NewSample(pool *pgxpool.Pool, skills *skill.Store, publisher *skill.Publisher, q *quality.Store, storage platform.Storage) *Sample
NewSample returns the loader.
func (*Sample) Load ¶
Load adds the sample skills, scores, a contest verdict, six sample people and 30 days of activations. It refuses when sample data exists.
type SetupClaimBody ¶
type SetupClaimBody struct {
Code string `json:"code" minLength:"1" maxLength:"32"`
}
type SetupFacts ¶
SetupFacts are the settings the setup card reads.