Documentation
¶
Index ¶
- func AddRecordToLogs(cfg *Config, record *ImmutableRecord) error
- func GeneratePDF(cfg *Config) error
- func GenerateREADME(cfg *Config, readmeFilepath string) error
- func GenerateREADMEFile(cfg *Config) error
- type Config
- type DocumentConfig
- type GotenbergConfig
- type ImmutableRecord
- type PinataConfig
- type PinataResponse
- type ReadmeData
- type ReadmeRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRecordToLogs ¶
func AddRecordToLogs(cfg *Config, record *ImmutableRecord) error
AddRecordToLogs adds a new record to the records file.
func GeneratePDF ¶
GeneratePDF generates a PDF from the given config.
func GenerateREADME ¶
GenerateREADME generates a README document into given filepath.
func GenerateREADMEFile ¶
GenerateREADMEFile generates a README.md or _README.md file based on production config flag. If production flag is true, then the file is named README.md, otherwise it is named _README.md.
Types ¶
type Config ¶
type Config struct { Document DocumentConfig `yaml:"document"` ImmutableDir string `yaml:"immutableDir"` TemplatesDir string `yaml:"templatesDir"` Gotenberg GotenbergConfig `yaml:"gotenberg"` Pinata PinataConfig `yaml:"pinata"` Production bool `yaml:"production"` }
func LoadConfigFromFile ¶
type DocumentConfig ¶
type GotenbergConfig ¶
type GotenbergConfig struct {
Hostname string `yaml:"hostname"`
}
type ImmutableRecord ¶
func NewRecord ¶
func NewRecord(config *Config) (*ImmutableRecord, error)
NewRecord returns a new immutable record with the given config.
func ReadSortedRecords ¶
func ReadSortedRecords(cfg *Config) ([]ImmutableRecord, error)
ReadSortedRecords reads the records file and returns a sorted by created date, slice of records.
func (*ImmutableRecord) RecordLine ¶
func (ir *ImmutableRecord) RecordLine() string
RecordLine returns a string representation of the record.
type PinataConfig ¶
type PinataResponse ¶
func PinDocumentToIPFS ¶
func PinDocumentToIPFS(cfg *Config) (*PinataResponse, error)
PinAssetToIPFS pins a file to IPFS and returns the hash of the file.
type ReadmeData ¶
type ReadmeData struct { DocumentTitle string DocumentName string Records []ReadmeRecord }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.