print

package
v0.0.0-...-3b5ec37 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditLxcAddLine

func EditLxcAddLine(n string, find, duplicate *regexp.Regexp, line string) error

EditLxcAddLine adds a line to the LXC config file. It will add the line, after it finds a line matching the `find` regexp. It will remove any line matching the 'duplicate' regexp. `n` is the name of the container to whose config this is being added.

func FindFileLists

func FindFileLists(repoPath string) ([]string, error)

FindFileLists finds all the 'file-list' files in the repoPath, and returns an array of the directories where they were found relative to the repoPath

func MakeEndpoint

func MakeEndpoint(pr *PrintRequest) string

func PrintCommand

func PrintCommand() *commander.Command

func PrintInContainer

func PrintInContainer(repoPath, book, printOrScreen string, C chan PrintMessage) (string, error)

func PrintLocal

func PrintLocal(repoPath, bookName, printOrScreen, fileListDir string, C chan PrintMessage) (string, error)

PrintLocal prints the book using the localhost for printing - not as safe as printing in a container, but on the other hand much easier to manage/code.

func PrintLogWriter

func PrintLogWriter(C chan PrintMessage, level string) io.WriteCloser

PrintLogWriter returns a Writer which will channel all writes across the given PrintMessage channel as log messages of the given level.

func PrintRoutes

func PrintRoutes(r *mux.Router)

PrintRoutes sets up the routes for printing on the given router

func Rvm

func Rvm(cout, cerr io.Writer, dir string, args ...string) *exec.Cmd

Runs RVM in the given directory with the given commands. Pipes stdout and stderr to os.Stdout and os.Stderr.

Types

type Jekyll

type Jekyll struct {
	ConfigFiles string
	BaseUrl     string
	RepoDir     string
	Port        int64

	ServerStarting bool

	RestartPath string

	KILL chan (bool)
	// contains filtered or unexported fields
}

Jekyll manages a Jekyll process

func (*Jekyll) Kill

func (j *Jekyll) Kill()

func (*Jekyll) ServeHTTP

func (j *Jekyll) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Jekyll) SetError

func (j *Jekyll) SetError(err error)

type JekyllManager

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

JekyllManager manages a bunch of Jekyll processes that will serve files for a repo. Importantly a Jekyll process needs to be started, build the repo, and automatically update if any files in the repo change.

func NewJekyllManager

func NewJekyllManager() *JekyllManager

func (*JekyllManager) ClearJekyll

func (jm *JekyllManager) ClearJekyll(user, repoOwner, repoName string) error

func (*JekyllManager) GetJekyll

func (jm *JekyllManager) GetJekyll(user, repoOwner, repoName string) (*Jekyll, error)

GetJekyll returns the Jekyll server for the specific user, repoOwner and repoName combination, starting a new Jekyll server if necessary.

type JekyllPorts

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

JekyllPorts handles assigning ports to Jekyll servers. We don't perform very complex checking on port availability, which could be done down the line, but for now simply assume that a port will be available across a sufficient range for our requirements.

func NewJekyllPorts

func NewJekyllPorts() *JekyllPorts

func (*JekyllPorts) Assign

func (jp *JekyllPorts) Assign() int64

func (*JekyllPorts) Release

func (jp *JekyllPorts) Release(p int64)

type Line

type Line struct {
	Level string
	Line  string
}

type OutErrMerge

type OutErrMerge struct {
	Out io.WriteCloser
	Err io.WriteCloser
	// contains filtered or unexported fields
}

func NewOutErrMerge

func NewOutErrMerge() *OutErrMerge

func (*OutErrMerge) Lines

func (oem *OutErrMerge) Lines() []*Line

func (*OutErrMerge) Scan

func (oem *OutErrMerge) Scan(in io.ReadCloser, lvl string)

type PrintMessage

type PrintMessage struct {
	Event string
	Data  interface{}
}

func PrintMessageLog

func PrintMessageLog(strfmt string, args ...interface{}) PrintMessage

type PrintRequest

type PrintRequest struct {
	Username      string
	RepoOwner     string
	RepoName      string
	Book          string
	Token         string
	PrintOrScreen string
	FileList      string // Directory of the file-list file
}

Jump to

Keyboard shortcuts

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