tex

package module
v0.0.0-...-2809da7 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

Tex

Go Report Card Build Status codecov FOSSA Status

License

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFuncMap

func DefaultFuncMap() template.FuncMap

DefaultFuncMap is automatically added to available template functions

func LcFirst

func LcFirst(s string) string

LcFirst returns s with first rune lowercase

func Render

func Render(opts Options) error

func ToGo

func ToGo(name string) string

ToGo returns a valid exported go identifier for name

func ToGoPrivate

func ToGoPrivate(name string) string

ToGoPrivate returns a valid unexported go identifier for name

func UcFirst

func UcFirst(s string) string

UcFirst returns s with first rune uppercase

Types

type ErrInvalidDest

type ErrInvalidDest struct {
	Dest string
}

ErrInvalidDest describes an invalid destination directory

func (*ErrInvalidDest) Error

func (e *ErrInvalidDest) Error() string

func (*ErrInvalidDest) Is

func (e *ErrInvalidDest) Is(target error) bool

type ErrInvalidSource

type ErrInvalidSource struct {
	Source string
}

ErrInvalidSource describes an invalid source directory for templates

func (*ErrInvalidSource) Error

func (e *ErrInvalidSource) Error() string

func (*ErrInvalidSource) Is

func (e *ErrInvalidSource) Is(target error) bool

type ErrNoNoMatch

type ErrNoNoMatch struct {
	Source string
}

ErrNoNoMatch is returned when there are no files matching source

func (*ErrNoNoMatch) Error

func (e *ErrNoNoMatch) Error() string

func (*ErrNoNoMatch) Is

func (e *ErrNoNoMatch) Is(target error) bool

type ErrWithMessage

type ErrWithMessage struct {
	Cause   error
	Message string
}

ErrWithMessage wraps error with an additional message

func (*ErrWithMessage) Error

func (e *ErrWithMessage) Error() string

Error returns message followed by error

func (*ErrWithMessage) Is

func (e *ErrWithMessage) Is(target error) bool

func (ErrWithMessage) Unwrap

func (e ErrWithMessage) Unwrap() error

type Options

type Options struct {
	Source  string
	Dest    string
	WorkDir string

	Fs afero.Fs

	Data  interface{}
	Funcs template.FuncMap

	Logger *log.Logger
}

func (*Options) ApplyDefaults

func (o *Options) ApplyDefaults()

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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