Documentation
¶
Overview ¶
Package exportreadme renders the README.html of a personal data export from a logic-less template: the realm's own (_realm/compliance/readme/<locale>.html) or the built-in one of its language.
Index ¶
Constants ¶
const DefaultReadmeLocale = "en"
DefaultReadmeLocale is the language of the template used when a realm has none for a user's.
const ReadmeDirName = "compliance/readme"
ReadmeDirName is where, inside a realm's _realm folder, its own README templates live: _realm/compliance/readme/<locale>.html (design/compliance.md §4.2).
const ReadmeName = "README.html"
ReadmeName is the human summary at the root of a personal data export.
Variables ¶
This section is empty.
Functions ¶
func CheckReadme ¶
CheckReadme parses a README template, with where in it a problem is.
func DefaultReadme ¶
DefaultReadme returns the built-in README template for a language, and whether there is one.
func DefaultReadmeLocales ¶
func DefaultReadmeLocales() []string
DefaultReadmeLocales lists the languages that have a built-in template.
func RenderReadme ¶
func RenderReadme(src string, data ReadmeData) (string, error)
RenderReadme prints a README template with data; every value is HTML-escaped.
Types ¶
type ReadmeData ¶
type ReadmeData struct {
Realm string
Email string
Generated time.Time
// Days is how long the downloadable copy is kept; 0 for an export handed to an administrator.
Days int
// Count is the number of records of each _account part, by name.
Count map[string]int
Collections []ReadmePart
Files int64
Exclusions []ReadmeExclusion
// Truncated names the parts that stopped at a limit.
Truncated []string
}
ReadmeData is what a README template can print (logic-less: values, sections and inverted sections; the same syntax as the owner's email templates).
{{Realm}} {{Email}} {{Generated}} {{Days}}
{{Count.sessions}} records of each _account part
{{#Collections}}{{#Items}}{{Part}} {{Documents}}{{/Items}} {{Files}}{{/Collections}}
{{#Exclusions}}{{#List}}{{What}}: {{Reason}}{{/List}}{{/Exclusions}}
{{#Truncated}}{{#List}}{{Name}}{{/List}}{{/Truncated}}
type ReadmeExclusion ¶
ReadmeExclusion is something left out of the package, and why.
type ReadmePart ¶
ReadmePart is one file of the package the README lists.