Documentation
¶
Overview ¶
Package tablesync keeps table configuration in step with the database.
Editing YAML by hand and having a tool rewrite it are usually in tension: the tool reformats, drops comments, and reorders keys, so people stop trusting it and stop running it. This package edits the syntax tree and prints it back, which preserves comments, blank lines, and key order exactly. The only thing that changes is what was asked for.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶
type Change struct {
Kind ChangeKind
Table string
Path string
// Content is the file to write. Empty for an orphan.
Content string
// Notes describe what changed, for reporting.
Notes []string
}
Change is one file's worth of work.
type ChangeKind ¶
type ChangeKind string
ChangeKind is what a Change does to a file.
const ( // ChangeCreate writes a configuration file for a table that has none. ChangeCreate ChangeKind = "create" // ChangeUpdate adds or removes entries in an existing file. ChangeUpdate ChangeKind = "update" // ChangeOrphan reports a file whose table is gone. rig does not delete it: // it may hold endpoint definitions that took real work, and a flag is not // enough authority to throw those away. ChangeOrphan ChangeKind = "orphan" )
Click to show internal directories.
Click to hide internal directories.