script

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VAR_MOD_DEFAULT         int = 0
	VAR_MOD_UPPERCASE       int = 1
	VAR_MOD_LOWERCASE       int = 2
	VAR_MOD_UPPERCASE_SHORT int = 3
	VAR_MOD_LOWERCASE_SHORT int = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Index      string       `json:"index"`    // Index
	Desc       string       `json:"desc"`     // Desc
	Type       VariableType `json:"type"`     // Type
	IsOptional bool         `json:"optional"` // Optional
	IsWildcard bool         `json:"wildcard"` // Wildcard
}

Argument contains info about method argument

func (*Argument) IsBoolean

func (a *Argument) IsBoolean() bool

IsBoolean return true if type is boolean

func (*Argument) IsNumber

func (a *Argument) IsNumber() bool

IsNumber return true if type is number

func (*Argument) IsString

func (a *Argument) IsString() bool

IsString return true if type is string

func (*Argument) IsUnknown

func (a *Argument) IsUnknown() bool

IsUnknown return true if type is unknown

func (*Argument) TypeName

func (a *Argument) TypeName(mod int) string

TypeDesc return type description

type Document

type Document struct {
	Title     string      `json:"title"`
	About     []string    `json:"about"`
	Constants []*Variable `json:"constants"`
	Variables []*Variable `json:"variables"`
	Methods   []*Method   `json:"methods"`
}

Document contains info about all constants, global variables and methods

func (*Document) HasAbout

func (d *Document) HasAbout() bool

HasAbout return true if about is present

func (*Document) HasConstants

func (d *Document) HasConstants() bool

HasConstants return true if doc has constants info

func (*Document) HasMethods

func (d *Document) HasMethods() bool

HasMethods return true if doc has methods info

func (*Document) HasVariables

func (d *Document) HasVariables() bool

HasVariables return true if doc has global variables info

func (*Document) IsValid

func (d *Document) IsValid() bool

IsValid return false if document is nil or doesn't have any content

type Method

type Method struct {
	Name       string      `json:"name"`        // Name
	Desc       []string    `json:"desc"`        // Description
	Arguments  []*Argument `json:"arguments"`   // Arguments
	ResultCode bool        `json:"result_code"` // Method uses exit codes
	ResultEcho *Variable   `json:"result_echo"` // Return argument
	Example    []string    `json:"example"`     // Example
	Line       int         `json:"line"`        // LOC of definition
}

Method contains info about method

func (*Method) HasArguments

func (m *Method) HasArguments() bool

HasArguments return true if method has arguments

func (*Method) HasEcho

func (m *Method) HasEcho() bool

HasEcho return true if method echoed some data

func (*Method) HasExample

func (m *Method) HasExample() bool

HasExample return true if method has code usage example

func (*Method) UnitedDesc

func (m *Method) UnitedDesc() string

UnitedDesc return united description string

type Variable

type Variable struct {
	Name  string       `json:"name"`  // Name
	Desc  []string     `json:"desc"`  // Description
	Type  VariableType `json:"type"`  // Type
	Value string       `json:"value"` // Value
	Line  int          `json:"line"`  // LOC of definition
}

Variable contains info about variable

func (*Variable) IsBoolean

func (v *Variable) IsBoolean() bool

IsBoolean return true if type is boolean

func (*Variable) IsNumber

func (v *Variable) IsNumber() bool

IsNumber return true if type is number

func (*Variable) IsString

func (v *Variable) IsString() bool

IsString return true if type is string

func (*Variable) IsUnknown

func (v *Variable) IsUnknown() bool

IsUnknown return true if type is unknown

func (*Variable) TypeName

func (v *Variable) TypeName(mod int) string

TypeDesc return type description

func (*Variable) UnitedDesc

func (v *Variable) UnitedDesc() string

UnitedDesc return united description string

type VariableType

type VariableType uint8

VariableType contains variable type

const (
	VAR_TYPE_UNKNOWN VariableType = 0
	VAR_TYPE_STRING  VariableType = 1
	VAR_TYPE_NUMBER  VariableType = 2
	VAR_TYPE_BOOLEAN VariableType = 3
)

Jump to

Keyboard shortcuts

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