utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Type     string
	Template string
}

Metadata describes the configuration of a story

type Story

type Story struct {
	Meta Metadata
	Data map[string]interface{}
	// contains filtered or unexported fields
}

Story is metadata plus a set of variable chunks

func NewStoryFromFile

func NewStoryFromFile(filePath string) (Story, error)

NewStoryFromFile loads a new Story generator from a config file

func NewStoryFromPath

func NewStoryFromPath(path string) (Story, error)

NewStoryFromPath loads a new story generator from a file or URL

func NewStoryFromText

func NewStoryFromText(text []byte) (Story, error)

NewStoryFromText loads a new Story generator from a string

func NewStoryFromURL

func NewStoryFromURL(url string) (Story, error)

NewStoryFromURL loads a new Story generator from a URL to a config file

func (*Story) Generate

func (s *Story) Generate() (string, error)

Generate creates a story string

func (*Story) Init

func (s *Story) Init() error

Init sets up initial state for the Story object

func (*Story) Upload

func (s *Story) Upload(bucket, prefix string) (*Story, error)

Upload copies a story into S3

Jump to

Keyboard shortcuts

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