types

package
v0.0.0-...-fc83e60 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackExecHandler

type CallbackExecHandler struct {
	StartFunc func()
	StopFunc  func()
}

func (CallbackExecHandler) Start

func (ceh CallbackExecHandler) Start()

func (CallbackExecHandler) Stop

func (ceh CallbackExecHandler) Stop()

type ContainerInfo

type ContainerInfo struct {
	Cmd    []string
	Cwd    string
	Env    EnvInfo
	Image  string
	Mounts []ContainerMount
}

type ContainerMount

type ContainerMount struct {
	From string
	To   string
	Mode string // 'ro'|'rw'
}

type EnvInfo

type EnvInfo = map[string]string

type ExecHandler

type ExecHandler interface {
	Start()
	Stop()
}

type Notebook

type Notebook interface {
	GetName() string
	GetAbsdir() string
	GetMtime() string
	SetMtime(mtime string)
	GetRecipe() Recipe
	GetMainFileAbsPath() string
}

type NotebookReal

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

func MakeNotebookReal

func MakeNotebookReal(notebookname, absdir, mtime string, recipe Recipe) NotebookReal

func (NotebookReal) GetAbsdir

func (n NotebookReal) GetAbsdir() string

func (NotebookReal) GetMainFileAbsPath

func (n NotebookReal) GetMainFileAbsPath() string

func (NotebookReal) GetMtime

func (n NotebookReal) GetMtime() string

func (NotebookReal) GetName

func (n NotebookReal) GetName() string

func (NotebookReal) GetRecipe

func (n NotebookReal) GetRecipe() Recipe

func (NotebookReal) MarshalJSON

func (n NotebookReal) MarshalJSON() ([]byte, error)

func (*NotebookReal) SetMtime

func (n *NotebookReal) SetMtime(mtime string)

type ProcessInfo

type ProcessInfo struct {
	Cmd []string
	Cwd string
	Env EnvInfo
}

type Recipe

type Recipe interface {
	GetKey() string
	GetName() string
	GetLanguage() string
	GetMainfile() string
	GetCmmode() string
	GetDir() string
	ExecNotebook(notebook Notebook, docker bool, writeStdOut io.Writer, writeStdErr io.Writer, writeInfo io.Writer, env EnvInfo) ExecHandler
	InitNotebook(recipe Recipe, notebookspath string, name string) error
}

type RecipeReal

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

func MakeRecipeReal

func MakeRecipeReal(
	key,
	name,
	language,
	mainfile,
	cmmode,
	dir string,
	exec func(
		notebook Notebook,
		docker bool,
		writeStdOut io.Writer,
		writeStdErr io.Writer,
		writeInfo io.Writer,
		env EnvInfo,
	) ExecHandler,
	init func(
		recipe Recipe,
		notebookspath string,
		name string,
	) error,
) RecipeReal

func (RecipeReal) ExecNotebook

func (r RecipeReal) ExecNotebook(notebook Notebook,
	docker bool,
	writeStdOut io.Writer,
	writeStdErr io.Writer,
	writeInfo io.Writer,
	env EnvInfo) ExecHandler

func (RecipeReal) GetCmmode

func (r RecipeReal) GetCmmode() string

func (RecipeReal) GetDir

func (r RecipeReal) GetDir() string

func (RecipeReal) GetKey

func (r RecipeReal) GetKey() string

func (RecipeReal) GetLanguage

func (r RecipeReal) GetLanguage() string

func (RecipeReal) GetMainfile

func (r RecipeReal) GetMainfile() string

func (RecipeReal) GetName

func (r RecipeReal) GetName() string

func (RecipeReal) InitNotebook

func (r RecipeReal) InitNotebook(
	recipe Recipe,
	notebookspath string,
	name string) error

func (RecipeReal) MarshalJSON

func (r RecipeReal) MarshalJSON() ([]byte, error)

type StdParameters

type StdParameters struct {
	Docker            bool   `default:"false"`
	NotebooksPathFlag string `name:"notebooks" default:"" type:"path"`
	NotebooksPathArg  string `arg:"" optional:"" name:"path" default:"" type:"path"`
}

func (StdParameters) GetNotebooksPath

func (p StdParameters) GetNotebooksPath() string

type StreamWriter

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

func NewStreamWriter

func NewStreamWriter(f func(data string)) *StreamWriter

func (StreamWriter) BytesWritten

func (sw StreamWriter) BytesWritten() int

func (*StreamWriter) Write

func (sw *StreamWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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