Documentation
¶
Index ¶
- Constants
- func ExpandRef(ctx *Context, ref executable.Ref) executable.Ref
- type Context
- func (ctx *Context) AddCallback(callback func(*Context) error)
- func (ctx *Context) Cancel()
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) Err() error
- func (ctx *Context) Finalize()
- func (ctx *Context) SetContext(c context.Context, cancelFunc context.CancelFunc)
- func (ctx *Context) SetIO(stdIn, stdOut *os.File)
- func (ctx *Context) SetView(view tuikit.View) error
- func (ctx *Context) StdIn() *os.File
- func (ctx *Context) StdOut() *os.File
- func (ctx *Context) String() string
- func (ctx *Context) Value(key any) any
Constants ¶
View Source
const ( AppName = "flow" HeaderCtxKey = "ctx" )
Variables ¶
This section is empty.
Functions ¶
func ExpandRef ¶
func ExpandRef(ctx *Context, ref executable.Ref) executable.Ref
Types ¶
type Context ¶
type Context struct {
Config *config.Config
CurrentWorkspace *workspace.Workspace
TUIContainer *tuikit.Container
WorkspacesCache cache.WorkspaceCache
ExecutableCache cache.ExecutableCache
// RootExecutable is the executable that is being run in the current context.
// This will be nil if the context is not associated with an executable run.
RootExecutable *executable.Executable
// ProcessTmpDir is the temporary directory for the current process. If set, it will be
// used to store temporary files all executable runs when the tmpDir value is specified.
ProcessTmpDir string
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) AddCallback ¶ added in v1.0.2
func (*Context) SetContext ¶ added in v1.1.0
func (ctx *Context) SetContext(c context.Context, cancelFunc context.CancelFunc)
SetContext sets the context and cancel function for the Context. This function should NOT be used outside of tests! The context and cancel function should be set when creating the context.
Click to show internal directories.
Click to hide internal directories.