uisrc

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uisrc decides which web UI the daemon serves: the ui/ directory of a ka checkout, when one is set up and was built against this binary's API, or the UI embedded in the binary.

`ka setup` (or `ka ui use`) records the checkout in ui.json in ka's data directory. If that checkout is deleted, the daemon serves the embedded UI and makes a shallow clone of this release's tag to serve from next.

Index

Constants

View Source
const DefaultURL = "https://github.com/JumpKickOSS/ka.git"

DefaultURL is where ka's repository lives.

Variables

This section is empty.

Functions

func Check

func Check(dir string) error

Check reports whether dir holds a UI built against this binary's API.

func Clear

func Clear() error

Clear forgets the checkout, so the embedded UI is served.

func FindCheckout

func FindCheckout(dir string) (string, bool)

FindCheckout returns the ka checkout containing dir, if there is one.

func Reclone

func Reclone(ctx context.Context, c Config, version string) (string, error)

Reclone makes a shallow clone of tag (v1.2.3) into ka's data directory, records it as the checkout and returns its ui/. version is the binary's version; development builds have no tag to clone.

func Save

func Save(c Config) error

Save writes ui.json.

Types

type Config

type Config struct {
	// Checkout is a ka repository whose ui/ the daemon serves.
	Checkout string `json:"checkout,omitempty"`
	// URL is cloned again when Checkout is gone.
	URL string `json:"url,omitempty"`
}

Config is ui.json.

func Load

func Load() (Config, error)

Load reads ui.json; a missing file is an empty Config.

type Status

type Status struct {
	// Dir is the ui/ directory to serve; empty means the embedded UI.
	Dir string
	// Reason says why the embedded UI is served, when it is.
	Reason string
	// Missing is true when the recorded checkout no longer exists.
	Missing bool
}

Status is the outcome of Resolve.

func Resolve

func Resolve(c Config) Status

Resolve picks the UI for this binary. KA_UI_DIR overrides everything (for UI development; no API check).

Jump to

Keyboard shortcuts

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