wrap

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AferoWrapper

type AferoWrapper struct {
	// contains filtered or unexported fields
}

AferoWrapper is a Wrapper compatible struct that uses afero for the file system.

func (*AferoWrapper) AddFile

func (b *AferoWrapper) AddFile(filename string, file goembed.File) error

AddFile adds a file to the embedded package.

func (*AferoWrapper) Name

func (b *AferoWrapper) Name() string

Name returns a simple name for this module.

func (*AferoWrapper) Render

func (b *AferoWrapper) Render(w io.Writer) error

Render writes the generated Go code to the supplied io.Writer, returning an. error on failure to write.

type NoDepWrapper

type NoDepWrapper struct {
	// contains filtered or unexported fields
}

NoDepWrapper is a Wrapper compatible struct that uses no dependencies.

func (*NoDepWrapper) AddFile

func (b *NoDepWrapper) AddFile(filename string, file goembed.File) error

AddFile adds a file to the embedded package.

func (*NoDepWrapper) Name

func (b *NoDepWrapper) Name() string

Name returns a simple name for this module.

func (*NoDepWrapper) Render

func (b *NoDepWrapper) Render(w io.Writer) error

Render writes the generated Go code to the supplied io.Writer, returning an. error on failure to write.

type Option added in v0.5.0

type Option func(Wrapper)

Option is an option for modifying the actions of a Wrapper.

func AddBuildTag added in v0.5.0

func AddBuildTag(buildTags []string) Option

AddBuildTag adds build tags to the generated files.

type Wrapper

type Wrapper interface {
	Name() string
	AddFile(filename string, file goembed.File) error
	Render(w io.Writer) error
}

Wrapper is the interface that provides a method for handling the data.

func NewAferoWrapper

func NewAferoWrapper(packageName string, shrinker shrink.Shrinker, opts ...Option) Wrapper

NewAferoWrapper returns a Wrapper compatible class that uses afero for the file system.

func NewNoDepWrapper

func NewNoDepWrapper(packageName string, shrinker shrink.Shrinker, opts ...Option) Wrapper

NewNoDepWrapper returns a Wrapper compatible class that uses no dependencies for the file system.

Jump to

Keyboard shortcuts

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