Documentation
¶
Overview ¶
Package tifa is the API of Tifa, the full-stack Go framework, that application code imports: the request context, errors and Layout data reuse.
Index ¶
- Variables
- func Bool(key string, def bool, help string) bool
- func ClearSession(c *Ctx) error
- func Duration(key string, def time.Duration, help string) time.Duration
- func Int(key string, def int, help string) int
- func Languages() []string
- func Redirect(url string, status int) error
- func Secret(key, help string) string
- func Session[S any](c *Ctx) *S
- func SetHTTPHandler(wrap func(app http.Handler) http.Handler)
- func SetSession[S any](c *Ctx, s *S) error
- func SetSessionStore(s SessionStore)
- func SetSitemap(f func(c *Ctx) (Sitemap, error))
- func ShuttingDown(ctx context.Context) <-chan struct{}
- func Size(key string, def int64, help string) int64
- func String(key, def, help string) string
- func Strings(key string, def []string, help string) []string
- func Use[T any](c *Ctx, load func(*Ctx) (T, error)) (T, error)
- func WithRenderClock(ctx context.Context, now func() time.Time) context.Context
- type Alternate
- type Ctx
- func (c *Ctx) Bind(v any) error
- func (c *Ctx) BindQuery(v any) error
- func (c *Ctx) Context() context.Context
- func (c *Ctx) Cookie(name string) (*http.Cookie, error)
- func (c *Ctx) Header(name string) string
- func (c *Ctx) IsDataRequest() bool
- func (c *Ctx) JSON(code int, v any) error
- func (c *Ctx) Language() string
- func (c *Ctx) NoContent(code int) error
- func (c *Ctx) Param(name string) string
- func (c *Ctx) Path() string
- func (c *Ctx) Pattern() string
- func (c *Ctx) Query(name string) string
- func (c *Ctx) QueryValues(name string) []string
- func (c *Ctx) Request() *http.Request
- func (c *Ctx) SetAlternates(list []Alternate)
- func (c *Ctx) SetBodyLimit(n int64) error
- func (c *Ctx) SetCookie(cookie *http.Cookie)
- func (c *Ctx) SetHeader(key, value string)
- func (c *Ctx) SetReadTimeout(d time.Duration) error
- func (c *Ctx) Text(code int, s string) error
- func (c *Ctx) WithContext(ctx context.Context) *Ctx
- func (c *Ctx) Writer() http.ResponseWriter
- type Error
- type Fields
- type HTML
- type MemoStats
- type RedirectError
- type SSRStats
- type ServerStats
- type SessionStore
- type Sitemap
- type SitemapPage
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = core.ErrNotFound
ErrNotFound makes the server answer 404 without calling OnError.
var ErrSSRBusy = core.ErrSSRBusy
ErrSSRBusy means SSR was rejected because its queue was full or its wait expired. OnRequest can match it with errors.Is. The default response is 503 with Retry-After.
Functions ¶
func Bool ¶
Bool defines an option of the app that is true or false, see String. Its flag alone, such as --shop-open, is true, and takes a value only after =: --shop-open=false.
func ClearSession ¶
ClearSession signs the request out: it deletes the record, drops the cookie, and Session returns nil from now on. It does nothing when the request has no session. When the record cannot be deleted the cookie is still dropped, and the error says the record stays valid until it expires. Where it may be called is the same as for SetSession.
func Duration ¶
Duration defines an option of the app that is a duration in Go's format, such as 3s or 1m30s, see String.
func Languages ¶ added in v0.0.5
func Languages() []string
Languages returns the languages of the site, the default language first and then the others in byte order, nil for an app without languages. They are the names of the <language>.json files of every _locales folder under app/ (a draft does not count), and the default language is i18n.default of tifa.yaml. Use it where the app lists its languages, such as the Languages of a content collection:
var Journal = content.Define[Post](content.Source{Dir: "journal", Languages: tifa.Languages()})
It works while the package initializes, so a package-level var may call it. tifa build and tifa dev build it into the program. Anywhere else, such as go test and go run, it reads those files and tifa.yaml in the module of the current folder, once.
func Redirect ¶
Redirect returns an error that makes the server redirect to url with status, such as http.StatusSeeOther. Return it from Load, a method handler or OnRequest. It panics when status is not 3xx, which is a mistake in the code and not a condition at run time.
func Secret ¶ added in v0.0.4
Secret defines an option of the app that is a secret, such as a password or an API token, and returns its value, empty when no source sets it. It comes from the environment variable, the .env file of the working directory or the file of -c, see String. A flag would show it in the process list to every user of the machine, so the program refuses one and says where to put it. config prints where a secret came from and never its value.
var SMTPPassword = tifa.Secret("smtp.password", "SMTP password")
func Session ¶
Session returns the session of the request, nil when nobody is signed in. The server reads it before OnRequest runs, so every hook, Load and method handler can call it, and the Loads that run at once share the one value: treat it as read-only. The record is decoded into S on the first call. A record that does not fit S is deleted and its cookie dropped, and the request is signed out. On a page with Cache in its route.go, GET and HEAD requests are anonymous and Session is nil.
func SetHTTPHandler ¶
SetHTTPHandler wraps the handler of the whole server with wrap, which gets tifa's handler and returns the handler to serve. Use it for plain net/http middleware, such as pprof or OpenTelemetry. The wrapper sees every request, static files and the 403 of a cross-site write included, with the original http.ResponseWriter, and does not go through OnRequest, OnError or the cross-site check. A shutdown waits for the requests it wraps. Call it in OnStart: it panics once the server listens. nil removes the wrapper. It runs outside the anonymous request of a page with Cache: the values it puts into the context of the request reach OnRequest and Load of such a page, so do not recognize visitors in it, do it in OnRequest.
func SetSession ¶
SetSession signs the request in. It stores s as the session under a new random token, deletes the session the request came with, and sets the session cookie, which lasts 30 days (session.max_age) from now and is not renewed. Session[S](c) returns the new value for the rest of the request. Every call makes a new token, so calling it again after a sign-in changes the token again.
s is encoded as JSON, and the record, with the framework's envelope, must not pass 4 KiB: keep an ID and a few display fields in it, and the rest in your database. The record is trusted: a store that others can write to can sign anyone in.
It returns an error, and changes nothing, when the store cannot be written. When the old session cannot be deleted the sign-in is not done either, so the old session is not left behind next to the new one. It also returns an error in a Load, a Layout and OnError, in OnRequest once next returned, and after the response is sent. Call it in OnRequest before next, or in a method handler.
S must be the same type in every call of SetSession and Session, or the call panics.
A page with Cache in its route.go is served anonymously: its GET and HEAD requests have no session and SetSession returns an error there. Put sign-in and OAuth callbacks on routes without Cache.
func SetSessionStore ¶
func SetSessionStore(s SessionStore)
SetSessionStore sets where sessions are kept, for example a store on Redis or SQL, in place of the in-memory one. Call it in OnStart: it panics once the server listens. nil restores the in-memory store.
func SetSitemap ¶ added in v0.1.5
SetSitemap sets the function that lists the pages of the site. With site.url set, the program answers /sitemap.xml, /robots.txt, /llms.txt and /llms-full.txt, and the Markdown version of a page whose SitemapPage has Content at its path with .md (/index.md for the home page). The pages without parameters are in the sitemap without it. The function runs on each request for those files, so pages that a date publishes show up at that date. An error it returns, a Path that matches no page and a page with parameters that is neither listed nor excluded answer 500. Call it in OnStart: it panics once the server listens. nil removes it.
func ShuttingDown ¶ added in v0.0.2
ShuttingDown returns a channel that is closed when the server that took the request starts to shut down: it has stopped taking new connections, and gives the requests in flight server.shutdown_timeout to finish. ctx is the context of the request, c.Context(), or one made from it. A handler that streams with no end of its own, such as server-sent events, returns when the channel is closed, so the program can stop at once. A request that ends by itself, such as a long upload or an answer still being written, can ignore it and finish.
For a context that no server made, as in a test, it returns nil, which never fires in a select.
func Size ¶
Size defines an option of the app that is a number of bytes, see String. It is written as a whole number with an optional unit B, KiB, MiB or GiB, such as 512KiB.
func String ¶
String defines an option of the app and returns its value. Write it in a package-level var of options.go in the root of the app, where tifa build looks for it:
var DBURL = tifa.String("db.url", "app.db", "Database file")
The key is lower case letters, digits and underscores, in at least two parts joined with dots. Its flag is --db-url and its environment variable DB_URL. The value comes from the first of these that sets it: the flag, the environment variable, the .env file of the working directory, the file of -c, and then def. An invalid value gives def, and the program lists it with the other invalid settings and stops before OnStart. In a test binary the value is def, and a test sets the variable itself.
func Strings ¶
Strings defines an option of the app whose value is a list, written as comma-separated text such as a.example,b.example, see String. Spaces around each item are dropped, empty text is no items, and an empty item between commas is invalid.
func Use ¶
Use returns the result of a Layout function for this request, the Layout of the caller's directory or of a directory above it: tifa.Use(c, project.Layout). Each function runs at most once per request, a second caller waits for the first run.
func WithRenderClock ¶
WithRenderClock returns a context whose server render reads now for Date, Temporal.Now and Intl's current time. nil restores the live clock. Set it before rendering, for example in OnRequest with c.WithContext. The clock runs on the rendering goroutine and must not block. If requests share it, it must be safe for concurrent calls. It does not change Go's time.Now, deadlines, or module initialization during VM prewarming. A request with a render clock skips the render memo, so it always renders and never shares a render with another request.
Types ¶
type Alternate ¶ added in v0.0.5
Alternate is one version of a page in a language, see Ctx.SetAlternates. Path is the URL path of that version as a visitor sees it, escaped, with no query and no language prefix: tifa adds the prefix of the language.
type Ctx ¶
Ctx is one request and its response. Load, Layout, the method handlers, Validate, OnRequest and OnError receive it.
It is a type of its own, not an alias of the type that holds the request inside Tifa, so that go doc and pkg.go.dev show its methods: they show none for an alias.
func (*Ctx) Bind ¶ added in v0.9.2
Bind decodes the request body into v by Content-Type: JSON, URL-encoded form or multipart form. A multipart form also fills the fields of type *multipart.FileHeader and []*multipart.FileHeader with its files. Client mistakes come back as Error with status 400, 408, 413 or 415. A method handler with an input gets it decoded this way, so call Bind only in a handler that takes the Ctx alone. It fails the build in a Load or a Layout.
func (*Ctx) BindQuery ¶ added in v0.9.2
BindQuery decodes the query string into the struct v, with the names and value types of a form body. Query parameters that name no field are ignored. A query string that does not parse, or a value that does not, comes back as Error with status 400. Every exported field of v must be one a form fills, or BindQuery returns an error whatever the query holds. It is for method handlers: a Load or a Layout takes its query parameters as a second parameter, and calling BindQuery there fails the build.
func (*Ctx) Context ¶ added in v0.9.2
Context returns the context of the request, which is canceled when the client goes away or the request ends. Pass it to the database and to outgoing requests, so they stop when nobody waits for the answer. WithContext gives a Ctx that carries another one.
func (*Ctx) Cookie ¶ added in v0.9.2
Cookie returns the request cookie name, and http.ErrNoCookie when the request has none. A GET of a page with Cache in its route.go is anonymous and has no cookies.
func (*Ctx) Header ¶ added in v0.9.2
Header returns the first value of the request header name, "" when the request has none. The name is not case-sensitive. A GET of a page with Cache in its route.go is anonymous, and the app sees none of the headers that tell visitors apart.
func (*Ctx) IsDataRequest ¶ added in v0.9.2
IsDataRequest reports whether this is the data request of a navigation in the browser router, rather than a page load.
func (*Ctx) JSON ¶ added in v0.9.2
JSON writes v as the JSON answer with status code, and Content-Type application/json. Map keys are sorted, a nil slice is [] and a nil map is {}. A method handler that returns a value needs no call: Tifa writes the value. It fails the build in a Load or a Layout, and returns an error there without writing, since the page writes the answer.
func (*Ctx) Language ¶ added in v0.9.2
Language returns the language of the route the request is for: the language in the URL, the default language when the URL has none, and so for a route outside every area of a site with languages. It is empty on a site without languages.
func (*Ctx) NoContent ¶ added in v0.9.2
NoContent writes status code with no body, such as http.StatusNoContent after a write that returns nothing. Like JSON, it is not for a Load or a Layout.
func (*Ctx) Param ¶ added in v0.9.2
Param returns the value of the path parameter name, decoded, such as c.Param("order") for the folder order+. In a Layout function it is "" for a parameter of a folder below the Layout, as in the copy Request returns there.
func (*Ctx) Path ¶ added in v0.9.2
Path is the path of the page as the visitor sees it in the address bar: escaped the way the browser writes it, with the language prefix and without the query. The page load and the data request of a client navigation give the same path, and a handler gets its own path. Calling it in a Layout fails the build: a Layout is shared by the pages below it.
func (*Ctx) Pattern ¶ added in v0.9.2
Pattern is the path of the matched route, such as "/projects/{project}", empty when the URL matched no route.
func (*Ctx) Query ¶ added in v0.9.2
Query returns the first value of the query parameter name, "" when there is none, from the request Request returns. It is for method handlers, Validate and OnRequest: a Load or a Layout takes its query parameters as a second parameter, and calling Query there fails the build.
func (*Ctx) QueryValues ¶ added in v0.9.2
QueryValues returns every value of the query parameter name, in order, and nil when there is none. Query returns only the first. Like Query, it fails the build in a Load or a Layout.
func (*Ctx) Request ¶ added in v0.9.2
Request returns the request. In a Load or Layout function, and the functions it calls, it is a copy made on the first call of the run, which holds what the function may depend on: the query parameters it declared, the path parameters of its own folder for a Layout, and no body. Each run has its own copy, so a function that changes it changes nothing of another.
func (*Ctx) SetAlternates ¶ added in v0.9.2
SetAlternates replaces the versions of the page in other languages. Without it a page exists in every language of its area, at the same path under another prefix. Call it in a Load of a page where that is wrong: a content entry whose slug differs in another language, or that is missing in one. Include the page itself. The last call wins, and an empty list says the page has one version.
func (*Ctx) SetBodyLimit ¶ added in v0.9.2
SetBodyLimit changes the request body limit, server.body_limit by default. Call it before anything reads the body, on the goroutine that handles the request, usually in OnRequest. Once reading has started it returns an error and the limit stays as it was.
func (*Ctx) SetCookie ¶ added in v0.9.2
SetCookie adds a Set-Cookie header for cookie to the response. It may be called in a Load or a Layout too. The cookie goes out as written: set HttpOnly, Secure and SameSite yourself.
func (*Ctx) SetHeader ¶ added in v0.9.2
SetHeader sets the response header key to value, replacing any value it had. It may be called in a Load or a Layout too, also from Loads that run at once: the page sends the header with its answer.
func (*Ctx) SetReadTimeout ¶ added in v0.9.2
SetReadTimeout gives the body of this request d to arrive, in place of server.read_timeout, and the answer server.write_timeout after that. Call it before anything reads the body, on the goroutine that handles the request, usually in OnRequest. Once reading has started it returns an error and the deadline stays as it was. It also returns an error when d is not over 0 or when the response cannot reach the connection, such as behind a middleware of SetHTTPHandler that does not unwrap it. A request with no body, such as a GET, keeps its deadlines and the call does nothing. A Ctx a test made with tifatest.NewCtx has no connection, and the call does nothing either.
func (*Ctx) Text ¶ added in v0.9.2
Text writes s as the answer with status code, and Content-Type text/plain in UTF-8. Like JSON, it is not for a Load or a Layout.
func (*Ctx) WithContext ¶ added in v0.9.2
WithContext returns a shallow copy of c whose request carries ctx, as http.Request.WithContext does. c is not changed. Both share the response and the state of the request: Loads run once for either, and the multipart files of the copy are removed when the request ends.
func (*Ctx) Writer ¶ added in v0.9.2
func (c *Ctx) Writer() http.ResponseWriter
Writer returns the http.ResponseWriter of the request, for an answer JSON, Text and NoContent do not write, such as a file, a stream or server-sent events. Write the headers first, then the body. Writing to it from a Load or a Layout breaks the page, which Tifa writes once they return.
type Error ¶
Error is a failure that is safe to show to the client. Returned from Load, a method handler or OnRequest, it is answered with its own status and message without calling OnError. OnError also returns it. Bind, BindQuery and the decoding of an input or a query struct return one for a mistake of the client, such as a body that is not JSON.
type Fields ¶
Fields is a message per input field, by its json name. Returned from Validate or a handler, it is answered with 422 and the messages as "fields" in the JSON, without calling OnError. It is a separate type so that Error stays comparable.
type HTML ¶
type HTML string
HTML is markup the app trusts, such as an article the build turned from Markdown into HTML or HTML a CMS returns, which a page shows as it is with <HTML value={...}> of tifa/client. It may be in the data of Load and Layout and in the result of a method handler, and is written as a JSON string, but it cannot be a map key or part of an input or the session. Only put markup you trust into it: sanitize HTML a user wrote before converting it, as with template.HTML of html/template.
A page the server renders carries such a value once, in its markup: its hydration data holds a marker in place of the value, and <HTML> reads the markup back from the page when the browser hydrates it. Navigation data and a page with SSR = false carry the string.
type MemoStats ¶ added in v0.0.5
type MemoStats struct {
Entries int // entries kept now
Hits uint64 // answered from an entry
Misses uint64 // rendered by the request
Evictions uint64 // entries dropped to make room for another, those hit only once first
}
MemoStats is the render memo in ServerStats.
type RedirectError ¶
RedirectError is what Redirect returns. OnRequest and tests can match it with errors.As.
func (*RedirectError) Error ¶ added in v0.9.2
func (e *RedirectError) Error() string
type SSRStats ¶ added in v0.0.2
type SSRStats struct {
VMs int // VMs loaded now: ssr.vms, one more while a VM that grew is replaced, one fewer while a failed one is
Busy int // VMs rendering now
Queued int // renders waiting for a VM now, at most ssr.queue_limit
// Renders counts the renders that ran in a VM, and Failed those of them that failed: an
// exception, ssr.timeout or ssr.vm_memory.
Renders, Failed uint64
// RenderTime is how long the renders took, together. RenderTime / Renders is the mean.
RenderTime time.Duration
// Rejected counts the renders refused with ErrSSRBusy and answered 503: the queue was full, or
// the wait passed ssr.wait_timeout.
Rejected uint64
// Replaced counts the VMs replaced because they grew: after a collection one held more than
// half of ssr.vm_memory.
Replaced uint64
// Memory is what the VMs hold now, in bytes: the sum of the size each had after its last
// collection.
Memory int64
}
SSRStats is the VM pool in ServerStats.
type ServerStats ¶ added in v0.0.2
type ServerStats struct {
SSR SSRStats // the VM pool
// Memo counts the renders of pages, whose Hits skip the VM, and the answers for the files of
// the site (sitemap.xml, llms.txt and the Markdown of a page).
Memo MemoStats
MemoBytes int64 // what the render memo holds now, in bytes
MemoSize int64 // what it may hold, ssr.memo_size
}
ServerStats is what Stats returns: the VM pool that renders pages and the render memo. Counts run from the start of the program, the other fields are the state now. Under tifa dev the counts of SSR start again when the front end is rebuilt.
func Stats ¶ added in v0.0.2
func Stats() ServerStats
Stats returns the state of the server now. It is cheap and safe to call from many requests at once, such as from a route that a monitoring system reads. Before the server starts and after it stops it returns the zero ServerStats. An app without pages has a zero SSR.
type SessionStore ¶
type SessionStore interface {
Get(ctx context.Context, key string) (data []byte, found bool, err error)
Put(ctx context.Context, key string, data []byte, expiry time.Time) error
Delete(ctx context.Context, key string) error
}
SessionStore keeps the records of sessions. The framework stores one record per session under the SHA-256 of the session token (base64url), not under the token the browser holds. Get, Put and Delete are called from many requests at once and must be safe for that.
Get returns the record. A key that is missing, expired or not valid is found == false with a nil error. err is only for a failure of the store itself, such as a lost connection: the request then fails, it is not treated as signed out. Put creates or replaces the record, and Get does not return it after expiry. It must not keep the data slice it is given, and Get must not return a slice the store still uses. Delete returns nil for a key that does not exist. All three return an error when ctx is done.
type Sitemap ¶ added in v0.1.5
type Sitemap struct {
// Name is the name of the site, the title of llms.txt. Empty, it is the host of site.url.
Name string
// Summary is one or two sentences about the site, the summary of llms.txt.
Summary string
// Exclude lists route patterns, as c.Pattern() writes them, such as "/projects/{project}" or
// "/login". Each leaves out its pages and the pages below it.
Exclude []string
// Pages lists the pages of the routes with parameters, and the pages without parameters that
// need a title, a date or a Markdown version.
Pages []SitemapPage
}
Sitemap is what the app says about its pages, which sitemap.xml, llms.txt, llms-full.txt and the Markdown versions of the pages are made from. See SetSitemap. The pages without parameters are in it without being listed.
type SitemapPage ¶ added in v0.1.5
type SitemapPage struct {
// Language is the language of the page: one of the languages of its area, "" on a site without
// languages and for a page outside every area.
Language string
// Path is the path of the page as a visitor sees it, escaped, without the language prefix and
// the query, as in Alternate: "/blog/hello-world".
Path string
// Modified is when the page last changed, the lastmod of the sitemap. Zero leaves it out.
Modified time.Time
// Title and Description name and describe the page in llms.txt. Without a Title the home page
// is named after the site (Sitemap.Name, else the host of site.url), and any other page by its path.
Title string
Description string
// Content is the entry of a content collection the page shows, such as a post read from
// Blog.Get: any value of a type that embeds content.Entry. With it the page has a Markdown
// version at its path with .md, and its text is in llms-full.txt.
Content icontent.Entry
// Alternates lists the versions of the page in each language, itself included, as
// c.SetAlternates takes them. Empty, the page is in every language of its area at the same path.
Alternates []Alternate
}
SitemapPage is one page of a Sitemap.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
tifa
command
Command tifa builds and inspects tifa applications.
|
Command tifa builds and inspects tifa applications. |
|
Package content reads the Markdown files of an app as typed collections.
|
Package content reads the Markdown files of an app as typed collections. |
|
Package docs carries the English docs for writing an app, so tifa agents can index the docs of the Tifa version it was built from in the AGENTS.md of an app.
|
Package docs carries the English docs for writing an app, so tifa agents can index the docs of the Tifa version it was built from in the AGENTS.md of an app. |
|
internal
|
|
|
analyze
Package analyze reads a tifa application with go/packages and go/types, checks its routing conventions and produces the route manifest.
|
Package analyze reads a tifa application with go/packages and go/types, checks its routing conventions and produces the route manifest. |
|
bundle
Package bundle builds the front end of an application with the application's own Vite, which runs on Node: the browser bundle, and the SSR bundle that QuickJS evaluates.
|
Package bundle builds the front end of an application with the application's own Vite, which runs on Node: the browser bundle, and the SSR bundle that QuickJS evaluates. |
|
bundle/hostgen
command
Command hostgen writes js/runtime/host.js from js/host.
|
Command hostgen writes js/runtime/host.js from js/host. |
|
codegen
Package codegen writes the generated part of a tifa application into its .tifa directory: the Go main with the route registration, and the TypeScript route tree, the route.gen modules, the two entries, the tsconfig and the JavaScript runtime, and the profile go build optimizes with.
|
Package codegen writes the generated part of a tifa application into its .tifa directory: the Go main with the route registration, and the TypeScript route tree, the route.gen modules, the two entries, the tsconfig and the JavaScript runtime, and the profile go build optimizes with. |
|
config
Package config holds the settings of tifa and of the app, and reads them from their sources.
|
Package config holds the settings of tifa and of the app, and reads them from their sources. |
|
content
Package content connects the content collections an app declares with the package github.com/liustack/tifa/content to the server, the build and tifatest.
|
Package content connects the content collections an app declares with the package github.com/liustack/tifa/content to the server, the build and tifatest. |
|
content/scan
Package scan reads the content/ folder of an app as tifa build does: which files are entries, their IDs, slugs and paths, the front matter checked against the schema and turned into JSON, translations, drafts and word counts.
|
Package scan reads the content/ folder of an app as tifa build does: which files are entries, their IDs, slugs and paths, the front matter checked against the schema and turned into JSON, translations, drafts and word counts. |
|
content/scan/internal/schemas
Package schemas holds schema types for the test that compares the field trees reflect and go/types give.
|
Package schemas holds schema types for the test that compares the field trees reflect and go/types give. |
|
core
Package core holds the request context behind the public tifa package.
|
Package core holds the request context behind the public tifa package. |
|
deverrors
Package deverrors holds the errors tifa dev keeps for `tifa errors`: their kinds, their JSON form, and the lists that keep the latest of each kind and count repeats.
|
Package deverrors holds the errors tifa dev keeps for `tifa errors`: their kinds, their JSON form, and the lists that keep the latest of each kind and count repeats. |
|
devserver
Package devserver is the core of tifa dev.
|
Package devserver is the core of tifa dev. |
|
foreign
Package foreign recognizes code written for another framework in a Tifa app: the imports, directives, exports and file names of Next.js, Remix and React Router, TanStack Start and SvelteKit, and the handlers of other Go web frameworks.
|
Package foreign recognizes code written for another framework in a Tifa app: the imports, directives, exports and file names of Next.js, Remix and React Router, TanStack Start and SvelteKit, and the handlers of other Go web frameworks. |
|
langs
Package langs reads the languages of an app from its _locales folders.
|
Package langs reads the languages of an app from its _locales folders. |
|
realpath
Package realpath finds the real name of a file or folder.
|
Package realpath finds the real name of a file or folder. |
|
ssr
Package ssr renders pages to HTML in a pool of prewarmed QuickJS VMs.
|
Package ssr renders pages to HTML in a pool of prewarmed QuickJS VMs. |
|
symwalk
Package symwalk walks a directory tree like filepath.WalkDir, but follows symbolic links.
|
Package symwalk walks a directory tree like filepath.WalkDir, but follows symbolic links. |
|
testproc
Package testproc starts the programs that tests run in the background, such as the program tifa build makes or a Node server, so that the system ends them when the test process ends, however it ends.
|
Package testproc starts the programs that tests run in the background, such as the program tifa build makes or a Node server, so that the system ends them when the test process ends, however it ends. |
|
testproc/orphantest
Package orphantest checks that a program a test starts does not outlive the test process.
|
Package orphantest checks that a program a test starts does not outlive the test process. |
|
Package js holds the JavaScript runtime sources of tifa.
|
Package js holds the JavaScript runtime sources of tifa. |
|
Package server is the tifa runtime.
|
Package server is the tifa runtime. |
|
Package skills holds the agent skill that Tifa ships, so `tifa agents` can write the copy that belongs to the Tifa version it was built from.
|
Package skills holds the agent skill that Tifa ships, so `tifa agents` can write the copy that belongs to the Tifa version it was built from. |
|
test
|
|
|
compare
Package compare builds the workbench pages of examples/shop three ways, as tifa, as a Next.js app and as a TanStack Start app, checks that the three show the same text, and measures how many whole page requests each answers.
|
Package compare builds the workbench pages of examples/shop three ways, as tifa, as a Next.js app and as a TanStack Start app, checks that the three show the same text, and measures how many whole page requests each answers. |
|
compare/cmd/compare
command
Command compare builds, measures and reports the comparison of Tifa with Next.js, TanStack Start, on the six workbench pages of examples/shop.
|
Command compare builds, measures and reports the comparison of Tifa with Next.js, TanStack Start, on the six workbench pages of examples/shop. |
|
ssr/cg
Package cg lets a program tell callgrind where to count: it zeroes the counters and writes a dump on request, so one process can count each stage of its work apart.
|
Package cg lets a program tell callgrind where to count: it zeroes the counters and writes a dump on request, so one process can count each stage of its work apart. |
|
Package tifatest tests a tifa app in go test, in two ways.
|
Package tifatest tests a tifa app in go test, in two ways. |
