cast

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCast

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

BaseCast is a cast that renders files from a source to a destination.

func NewBaseCast

func NewBaseCast(src source.Source, dest template.TemplatedPath, vars variable.Variables) *BaseCast

NewBaseCast creates a new base cast.

func (*BaseCast) Compile

func (c *BaseCast) Compile(ctx context.Context) ([]file.File, error)

Compile compiles the cast.

type Cast

type Cast interface {
	// Compile compiles the cast.
	Compile(ctx context.Context) ([]file.File, error)
}

Cast is the interface that wraps the Compile method.

func NewCast

func NewCast(cast manifest.Cast) Cast

NewCast creates a new cast from a manifest cast.

type CollectionCast

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

CollectionCast is a cast that renders files from a source to a destination for a given collection.

func NewCollectionCast

func NewCollectionCast(coll template.TemplatedString, alias string, filter condition.Condition, baseCast *BaseCast) *CollectionCast

NewCollectionCast creates a new collection cast.

func (*CollectionCast) Compile

func (c *CollectionCast) Compile(ctx context.Context) ([]file.File, error)

Compile compiles the cast.

type ConditionalCast

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

ConditionalCast is a cast that renders files from a source to a destination if a condition is met.

func NewConditionalCast

func NewConditionalCast(condition condition.Condition, baseCast *BaseCast) *ConditionalCast

NewConditionalCast creates a new conditional cast.

func (*ConditionalCast) Compile

func (c *ConditionalCast) Compile(ctx context.Context) ([]file.File, error)

Compile compiles the cast.

type ConditionalCollectionCast

type ConditionalCollectionCast struct {
	*CollectionCast
	*ConditionalCast
}

ConditionalCollectionCast is a cast that renders files from a source to a destination for a given collection if a condition is met.

func NewConditionalCollectionCast

func NewConditionalCollectionCast(condCast *ConditionalCast, collCast *CollectionCast) *ConditionalCollectionCast

NewConditionalCollectionCast creates a new conditional collection cast.

func (*ConditionalCollectionCast) Compile

func (c *ConditionalCollectionCast) Compile(ctx context.Context) ([]file.File, error)

Compile compiles the cast.

Jump to

Keyboard shortcuts

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