Documentation ¶
Index ¶
- Constants
- func MaybeRuntimeErr(err error) error
- type Call
- type CallErr
- type CallExitReason
- type CallID
- type CallSummary
- type EnvGlobal
- type LinesReader
- type LogSplitFn
- type NextMultiLineFn
- type NextSingleLineFn
- type ReadWithCallback
- type Report
- type ReportActor
- type ReportCall
- type Session
- func (sess *Session) Close() error
- func (sess *Session) Done() <-chan struct{}
- func (sess *Session) Each(fn func(name string, vr expand.Variable) bool)
- func (sess *Session) Exited() bool
- func (sess *Session) Get(name string) expand.Variable
- func (sess *Session) GetLastCall() *Call
- func (sess *Session) HasInterest(id CallID) (lvl logrus.Level, ok bool)
- func (sess *Session) ListInterests() (out []CallID)
- func (sess *Session) NewCallID() CallID
- func (sess *Session) Run(ctx context.Context, node syntax.Node) error
- func (sess *Session) RunCmd(ctx context.Context, args []string) error
- func (sess *Session) RunInclude(ctx context.Context, includePath string) error
- func (sess *Session) RunNonRumorCmd(ctx context.Context, args []string) error
- func (sess *Session) SetInterest(id CallID, lvl logrus.Level)
- func (sess *Session) UnsetInterest(id CallID)
- type SessionID
- type SessionProcessor
- func (sp *SessionProcessor) ClearLogData()
- func (sp *SessionProcessor) Close()
- func (sp *SessionProcessor) GetActor(name actor.ActorID) *actor.Actor
- func (sp *SessionProcessor) GetCall(id CallID) *Call
- func (sp *SessionProcessor) GetCalls(id actor.ActorID) map[CallID]CallSummary
- func (sp *SessionProcessor) GetLogData(key string) (value interface{}, ok bool)
- func (sp *SessionProcessor) IsClosing() bool
- func (sp *SessionProcessor) KillActor(id actor.ActorID)
- func (sp *SessionProcessor) MakeCall(callCtx context.Context, out io.Writer, actorName actor.ActorID, callID CallID, ...) (*Call, error)
- func (sp *SessionProcessor) NewSession(log logrus.FieldLogger) *Session
- func (sp *SessionProcessor) RemoveInterests(id CallID)
- func (sp *SessionProcessor) Report() *Report
- type ShellLogFmt
- type VoidWriter
- type WriteableFn
Constants ¶
const LogKeyActor = "actor"
const LogKeyCallID = "call_id"
Variables ¶
This section is empty.
Functions ¶
func MaybeRuntimeErr ¶ added in v0.2.2
Types ¶
type Call ¶
type Call struct {
// contains filtered or unexported fields
}
func (*Call) RegisterStop ¶ added in v0.2.1
func (*Call) RequestStep ¶ added in v0.2.1
RequestStep wait for the next step, and waits for the step to complete, or for the call to finish.
type CallErr ¶ added in v0.2.2
type CallErr struct { Exit CallExitReason Err error }
type CallExitReason ¶
type CallExitReason uint8
const ( SuccessDone CallExitReason = iota RuntimeError ParseError )
func (CallExitReason) ExitErr ¶
func (code CallExitReason) ExitErr() error
func (CallExitReason) WithErr ¶ added in v0.2.2
func (code CallExitReason) WithErr(err error) *CallErr
type CallSummary ¶
type EnvGlobal ¶
type EnvGlobal interface { GetCall(id CallID) *Call // Runs the call in sync MakeCall(callCtx context.Context, out io.Writer, actorID actor.ActorID, callID CallID, args []string) (*Call, error) IsClosing() bool KillActor(id actor.ActorID) GetCalls(id actor.ActorID) map[CallID]CallSummary GetLogData(key string) (value interface{}, ok bool) ClearLogData() }
type LinesReader ¶
type LinesReader struct { Fn NextMultiLineFn // contains filtered or unexported fields }
LinesReader is used to convert a stream of lines back into a reader
type LogSplitFn ¶
type NextMultiLineFn ¶
Reads one or more lines at a time. The multi-line string may not end with a linebreak character, but should never end in the middle of an actual line.
type NextSingleLineFn ¶
type ReadWithCallback ¶
type Report ¶ added in v0.2.4
type Report struct { Actors map[actor.ActorID]ReportActor `json:"actors"` Calls map[CallID]ReportCall `json:"calls"` }
type ReportActor ¶ added in v0.2.4
type ReportCall ¶ added in v0.2.4
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) GetLastCall ¶
func (*Session) HasInterest ¶
func (*Session) ListInterests ¶
func (*Session) Run ¶
Run interprets a node inside a Rumor session, using the mvdan shell package.
From the shell docs: A node can be a *File, *Stmt, or Command. If a non-nil error is returned, it will typically contain commands exit status, which can be retrieved with IsExitStatus.
Run can be called multiple times synchronously to interpret programs incrementally. To reuse a Runner without keeping the internal shell state, call Reset.
func (*Session) RunInclude ¶
func (*Session) RunNonRumorCmd ¶
func (*Session) UnsetInterest ¶
type SessionProcessor ¶
type SessionProcessor struct {
// contains filtered or unexported fields
}
func NewSessionProcessor ¶
func NewSessionProcessor(adminLog logrus.FieldLogger) *SessionProcessor
func (*SessionProcessor) ClearLogData ¶
func (sp *SessionProcessor) ClearLogData()
func (*SessionProcessor) Close ¶
func (sp *SessionProcessor) Close()
func (*SessionProcessor) GetActor ¶
func (sp *SessionProcessor) GetActor(name actor.ActorID) *actor.Actor
func (*SessionProcessor) GetCall ¶
func (sp *SessionProcessor) GetCall(id CallID) *Call
func (*SessionProcessor) GetCalls ¶
func (sp *SessionProcessor) GetCalls(id actor.ActorID) map[CallID]CallSummary
func (*SessionProcessor) GetLogData ¶
func (sp *SessionProcessor) GetLogData(key string) (value interface{}, ok bool)
func (*SessionProcessor) IsClosing ¶
func (sp *SessionProcessor) IsClosing() bool
func (*SessionProcessor) KillActor ¶
func (sp *SessionProcessor) KillActor(id actor.ActorID)
func (*SessionProcessor) NewSession ¶
func (sp *SessionProcessor) NewSession(log logrus.FieldLogger) *Session
func (*SessionProcessor) RemoveInterests ¶
func (sp *SessionProcessor) RemoveInterests(id CallID)
func (*SessionProcessor) Report ¶ added in v0.2.4
func (sp *SessionProcessor) Report() *Report
type ShellLogFmt ¶ added in v0.2.1
type ShellLogFmt struct {
FieldMap FieldMap
}
ShellLogFmt formats logs into text
func (*ShellLogFmt) Format ¶ added in v0.2.1
func (f *ShellLogFmt) Format(entry *Entry) ([]byte, error)
Format renders a single log entry
type VoidWriter ¶
type VoidWriter struct{}
type WriteableFn ¶
type WriteableFn func(msg string)