exportreadme

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 6 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 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

View Source
const DefaultReadmeLocale = "en"

DefaultReadmeLocale is the language of the template used when a realm has none for a user's.

View Source
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).

View Source
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

func CheckReadme(src string) error

CheckReadme parses a README template, with where in it a problem is.

func DefaultReadme

func DefaultReadme(locale string) ([]byte, bool)

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

type ReadmeExclusion struct {
	What   string
	Reason string
}

ReadmeExclusion is something left out of the package, and why.

type ReadmePart

type ReadmePart struct {
	Part      string
	Documents int64
}

ReadmePart is one file of the package the README lists.

Jump to

Keyboard shortcuts

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