app_workspace

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameSecrets = "secrets"
	NameCache   = "cache"
	NameUser    = "user"
	NameJobs    = "jobs"
	NameLogs    = "logs"
	NameReport  = "report"
	NameTest    = "test"
	NameKvs     = "kvs"
	JobIdFormat = "20060102-150405"
)

Variables

This section is empty.

Functions

func DefaultAppPath

func DefaultAppPath() (path string, err error)

func NewJobId

func NewJobId() string

func WithFork

func WithFork(wb Bundle, name string, f func(fwb Bundle) error) error

Types

type Application

type Application interface {
	// Toolbox home path
	Home() string
}

type Bundle

type Bundle interface {
	io.Closer

	// Workspace
	Workspace() Workspace

	// Logger
	Logger() esl_container.Logger

	// REST logger
	Capture() esl_container.Logger

	// Summary logger
	Summary() esl_container.Logger

	// Storage budget
	Budget() app_budget.Budget

	// Log level for console logs
	ConsoleLogLevel() esl.Level

	// True when the workspace bundle is transient.
	IsTransient() bool
}

Workspace bundle

func ForkBundle

func ForkBundle(wb Bundle, name string) (bundle Bundle, err error)

func ForkBundleWithLevel

func ForkBundleWithLevel(wb Bundle, name string, consoleLevel esl.Level) (bundle Bundle, err error)

func NewBundle

func NewBundle(home string, budget app_budget.Budget, consoleLevel esl.Level, transient bool) (bundle Bundle, err error)

type Job

type Job interface {
	// Path for job
	Job() string

	// Time of the job started
	JobStartTime() time.Time

	// Job ID
	JobId() string

	// Log path for job
	Log() string

	// Test
	Test() string

	// Report path for job
	Report() string

	// Path for KVS storage
	KVS() string

	// Create or get child folder of job folder
	Descendant(name string) (path string, err error)
}

type MultiUser

type MultiUser interface {
	User

	// User home path
	UserHome() string
}

type User

type User interface {
	// Secrets path
	Secrets() string

	// Cache
	Cache() string
}

type Workspace

type Workspace interface {
	Application
	User
	Job
}

func Fork

func Fork(ws Workspace, name string) (Workspace, error)

func NewWorkspace

func NewWorkspace(home string, transient bool) (Workspace, error)

func NewWorkspaceByJobPath

func NewWorkspaceByJobPath(home Application, jobId string) (ws Workspace, err error)

Create workspace instance by job path. This will not create directories. Just matches to existing folder structure. Returns error if a

Jump to

Keyboard shortcuts

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