Documentation
¶
Overview ¶
Package devserver serves immutable development builds and reconnecting updates.
Index ¶
Constants ¶
View Source
const (
Schema = "karty.dev@1"
)
Variables ¶
View Source
var ErrSnapshot = errors.New("invalid or oversized development build")
Functions ¶
Types ¶
type Generation ¶
type Generation struct {
Revision uint64 `json:"revision"`
ID string `json:"id"`
RuntimeIdentity string `json:"runtimeIdentity"`
BaseURL string `json:"baseURL"` //nolint:tagliatelle // The versioned tooling schema spells URL as an initialism.
Levels []Level `json:"levels"`
UI UIResource `json:"ui"`
}
type RunOptions ¶
type RunOptions struct {
Directory string
Build func(context.Context, func(string)) error
PollInterval time.Duration
Debounce time.Duration
Log func(string)
// WatchRoots supplies explicitly declared development package roots. Each
// is watched independently without permitting project symlinks to escape.
WatchRoots func(context.Context) (map[string]string, error)
}
RunOptions keeps the watcher independent of compilers and the build service. Build must return only after cancellation cleanup has completed.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type Snapshot ¶
type Snapshot struct {
Generation Generation
// contains filtered or unexported fields
}
type Status ¶
type Status struct {
Schema string `json:"schema"`
Session string `json:"session"`
State string `json:"state"`
Message string `json:"message"`
Generation *Generation `json:"generation"`
}
type UIResource ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher detects content changes, including additions and deletion. Metadata avoids rereading unchanged large assets on each poll. Hashes expire so edits that preserve inode/size/mtime are still detected within the verification age. os.Root confines every read even if a symlink changes during a scan.
func NewWatcher ¶
Click to show internal directories.
Click to hide internal directories.