actions

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeFiles

func MergeFiles(fileNames []string, uuids []string, outFileName string)

MergeFiles merges the documents stored in fileNames and writes the merged document to outFileName. TODO: Decide if this belongs in a different package

func RunContent

func RunContent(contentStr string, actions []Action) string

RunContent takes a content JSON string and returns the content JSON string after applying actions.

func RunFile

func RunFile(uuidOriginal, fileNameOriginal, fileNameProcessed string, acts []Action)

RunFile processes fileNameOriginal to fileNameProcessed after applying acts.

func RunLines

func RunLines(files []string, actions []Action) map[string]PageReplacement

RunLines takes a slice of all filenames in the uuid/ directory and computes their respective new index and whether they get deleted or not.

func RunPagedata

func RunPagedata(pagedata string, actions []Action) string

RunPagedata takes pagedata and returns the pagedata after applying actions.

func RunPdf

func RunPdf(pdf io.ReadSeeker, outW io.Writer, actions []Action)

RunPdf takes a PDF as input and writes the resulting PDF after applying actions to outW.

func Sort

func Sort(actions []Action)

Types

type Action

type Action interface {
	Page() int
}

func FromString

func FromString(s string) []Action

type Delete

type Delete struct {
	Count  int
	PageNo int
}

func (Delete) Page

func (d Delete) Page() int

type Insert

type Insert struct {
	Count       int
	PageNo      int
	InsertAfter bool
}

func (Insert) Page

func (i Insert) Page() int

type PageReplacement

type PageReplacement struct {
	OriginalIdx int
	NewIdx      int
	Deleted     bool
}

type T

type T []Action

Jump to

Keyboard shortcuts

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