gniid

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

README

gniid

A library for building applications that wrangler text.

Documentation

Overview

Copyright © 2024 Jeremy Boles <me@jeremyboles.com>

rhis program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	Gather    Phase = "gather"
	Process         = "prcoess"
	Transform       = "transform"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact interface {
	Processor
	Transformer

	Filepath(path string) string
	OriginalPath() string
	Paths() []string
}

type Builder

type Builder struct {
	Artifacts []Artifact
	Phase     Phase
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(cwd string, dirs []string) *Builder

func (*Builder) Artifact

func (b *Builder) Artifact(path string) *Artifact

func (*Builder) Gather

func (b *Builder) Gather(match func(rel, path string) Artifact) error

func (*Builder) Paths

func (b *Builder) Paths() map[string]Artifact

func (*Builder) Process

func (b *Builder) Process() error

func (*Builder) Transform

func (b *Builder) Transform(wr io.Writer, path string, artifact Artifact) error

type Phase

type Phase string

type Processor

type Processor interface {
	Process() error
}

type Transformer

type Transformer interface {
	Transform(path string, writer io.Writer) error
}

Source Files

  • builder.go

Jump to

Keyboard shortcuts

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