Documentation
¶
Index ¶
- Constants
- func FindProjectDir(startDir string) (string, error)
- func FriendNames(friends []Friend) string
- func RenderManifestReadme(data TemplateData) ([]byte, error)
- func WriteManifestReadme(manifestDir string, data TemplateData) error
- type Friend
- type Project
- func Load(dir string) (*Project, error)
- func New(dir, name string, threshold int, friends []Friend) (*Project, error)
- func NewAnonymous(dir, name string, threshold int, numShares int) (*Project, error)
- func NewWithOptions(dir, name string, threshold int, friends []Friend, anonymous bool) (*Project, error)
- type Sealed
- type ShareInfo
- type TemplateData
Constants ¶
const ( ProjectFileName = "project.yml" ManifestDir = "manifest" OutputDir = "output" )
Variables ¶
This section is empty.
Functions ¶
func FindProjectDir ¶
FindProjectDir searches up the directory tree for a project.yml file. Returns the directory containing the project, or an error if not found.
func FriendNames ¶
FriendNames returns a comma-separated list of friend names.
func RenderManifestReadme ¶ added in v0.0.13
func RenderManifestReadme(data TemplateData) ([]byte, error)
RenderManifestReadme renders the manifest README template to bytes. Used at seal time to detect an untouched template.
func WriteManifestReadme ¶
func WriteManifestReadme(manifestDir string, data TemplateData) error
WriteManifestReadme creates the README.md file in the manifest directory.
Types ¶
type Friend ¶
type Friend struct {
Name string `yaml:"name"`
Contact string `yaml:"contact,omitempty"`
Language string `yaml:"language,omitempty"` // Bundle language override (e.g. "en", "es", "de", "fr", "sl", "pt", "zh-TW")
}
Friend represents a person who will hold a share.
type Project ¶
type Project struct {
Name string `yaml:"name"`
Created string `yaml:"created"`
Threshold int `yaml:"threshold"`
Anonymous bool `yaml:"anonymous,omitempty"`
Language string `yaml:"language,omitempty"` // Default bundle language (e.g. "en", "es", "de", "fr", "sl", "pt", "zh-TW")
Friends []Friend `yaml:"friends"`
Sealed *Sealed `yaml:"sealed,omitempty"`
// Path is the directory containing this project (not serialized)
Path string `yaml:"-"`
}
Project represents a rememory project configuration.
func NewAnonymous ¶ added in v0.0.5
NewAnonymous creates a new anonymous project (no contact info).
func NewWithOptions ¶ added in v0.0.5
func NewWithOptions(dir, name string, threshold int, friends []Friend, anonymous bool) (*Project, error)
NewWithOptions creates a new project with the given configuration.
func (*Project) ManifestAgePath ¶
ManifestAgePath returns the path to the encrypted manifest.
func (*Project) ManifestPath ¶
ManifestPath returns the path to the manifest directory.
func (*Project) OutputPath ¶
OutputPath returns the path to the output directory.
func (*Project) PagesPath ¶ added in v0.0.16
PagesPath returns the path to the static pages output directory.
func (*Project) SharesPath ¶
SharesPath returns the path to the shares directory.
type Sealed ¶
type Sealed struct {
At time.Time `yaml:"at"`
ManifestChecksum string `yaml:"manifest_checksum"`
VerificationHash string `yaml:"verification_hash"`
TlockEnabled bool `yaml:"tlock_enabled,omitempty"`
TlockRound uint64 `yaml:"tlock_round,omitempty"`
TlockUnlockTime *time.Time `yaml:"tlock_unlock_time,omitempty"`
}
SealedInfo stores information about the sealed manifest.
type TemplateData ¶
TemplateData contains data for rendering templates.
func TemplateDataFromProject ¶ added in v0.0.13
func TemplateDataFromProject(p *Project) TemplateData
TemplateDataFromProject builds TemplateData from a Project.