compile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Files

func Files(part string) (string, []byte, error)

Files accepts a path to one of the three needed files, attempts to find the others, and provides the conventional name and bytes for the file.

Example
package main

import (
	"crypto/md5"
	"fmt"

	"github.com/dotpostcard/postcards-go/compile"
)

func main() {
	filename, data, err := compile.Files("../fixtures/hello-meta.yaml")
	if err != nil {
		panic(err)
	}

	fmt.Printf("%s has checksum %x", filename, md5.Sum(data))
}
Output:

hello.postcard has checksum a266fd1de5a18f59c9578276ff5607a6

func MetadataFromYaml

func MetadataFromYaml(r io.Reader) yamlMetadata

func Readers

func Readers(frontReader, backReader io.Reader, mp MetadataProvider) (*types.Postcard, error)

Readers accepts reader objects for each of the components of a postcard file, and creates an in-memory Postcard object.

Types

type MetadataProvider

type MetadataProvider interface {
	Metadata() (types.Metadata, error)
}

Jump to

Keyboard shortcuts

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