context

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CONTEXT_COMPILATION = 1 << 1
View Source
const CONTEXT_GLOBAL = 1 << 0
View Source
const CONTEXT_STATUS_ERROR = 1
View Source
const CONTEXT_STATUS_PENDING = -1
View Source
const CONTEXT_STATUS_SUCCESS = 0
View Source
const CONTEXT_TASK = 1 << 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Statements []parser.Statement
	Variables  map[string]value.IValueObject
	Tasks      map[string]task.Task
	// contains filtered or unexported fields
}

Context is global context, use for global variable declarations

func NewContext

func NewContext(ruby *parser.Entry) Context

func (*Context) AddTask

func (ctx *Context) AddTask(name string, task task.Task)

func (*Context) CreateScope

func (ctx *Context) CreateScope(statements []parser.Statement) IContext

func (*Context) GetContextFlag

func (ctx *Context) GetContextFlag() int

func (*Context) GetLastStatus

func (ctx *Context) GetLastStatus() int

func (*Context) GetLocalSession

func (ctx *Context) GetLocalSession() session.ISession

func (*Context) GetPhase

func (ctx *Context) GetPhase() int

func (*Context) GetRemoteSession

func (ctx *Context) GetRemoteSession() session.ISession

func (*Context) GetStatements

func (ctx *Context) GetStatements() []parser.Statement

func (*Context) GetTask

func (ctx *Context) GetTask(name *string) *task.Task

func (*Context) GetVar

func (ctx *Context) GetVar(name string) value.IValueObject

func (*Context) SetLastStatus

func (ctx *Context) SetLastStatus(status int)

func (*Context) SetPhase

func (ctx *Context) SetPhase(phase int)

func (*Context) SetSession

func (ctx *Context) SetSession(remote session.ISession, local session.ISession)

func (*Context) SetVar

func (ctx *Context) SetVar(name string, value value.IValueObject)

type IContext

type IContext interface {
	SetVar(name string, value value.IValueObject)
	GetVar(name string) value.IValueObject
	SetPhase(phase int)
	GetPhase() int
	GetContextFlag() int
	GetStatements() []parser.Statement
	GetTask(name *string) *task.Task
	CreateScope(statements []parser.Statement) IContext
	SetSession(remote session.ISession, local session.ISession)
	GetRemoteSession() session.ISession
	GetLocalSession() session.ISession
	SetLastStatus(status int)
	GetLastStatus() int
}

type ScopedContext

type ScopedContext struct {
	Statements []parser.Statement
	Variables  map[string]value.IValueObject
	Tasks      *map[string]task.Task
	// contains filtered or unexported fields
}

ScopedContext is scoped context, use for in-task variable declarations

func (*ScopedContext) CreateScope

func (ctx *ScopedContext) CreateScope(statements []parser.Statement) IContext

func (*ScopedContext) GetContextFlag

func (ctx *ScopedContext) GetContextFlag() int

func (*ScopedContext) GetLastStatus

func (ctx *ScopedContext) GetLastStatus() int

func (*ScopedContext) GetLocalSession

func (ctx *ScopedContext) GetLocalSession() session.ISession

func (*ScopedContext) GetPhase

func (ctx *ScopedContext) GetPhase() int

func (*ScopedContext) GetRemoteSession

func (ctx *ScopedContext) GetRemoteSession() session.ISession

func (*ScopedContext) GetStatements

func (ctx *ScopedContext) GetStatements() []parser.Statement

func (*ScopedContext) GetTask

func (ctx *ScopedContext) GetTask(name *string) *task.Task

func (*ScopedContext) GetVar

func (ctx *ScopedContext) GetVar(name string) value.IValueObject

func (*ScopedContext) SetLastStatus

func (ctx *ScopedContext) SetLastStatus(status int)

func (*ScopedContext) SetPhase

func (ctx *ScopedContext) SetPhase(phase int)

func (*ScopedContext) SetSession

func (ctx *ScopedContext) SetSession(remote session.ISession, local session.ISession)

func (*ScopedContext) SetVar

func (ctx *ScopedContext) SetVar(name string, value value.IValueObject)

Jump to

Keyboard shortcuts

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