core

package
v0.0.0-...-0108d89 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "0.0.0"   // Placeholder for the version
	BuildTime = ""        // Placeholder for the build time
	GitSHA    = "0000000" // Placeholder for the git sha
)
View Source
var AppendFileName string

AppendFileName allows for custom appendonly file path

View Source
var AppendOnly = "yes"

AppendOnly allows for disabling the appendonly file.

View Source
var Commands = func() map[string]Command {
	var commands map[string]Command
	if err := json.Unmarshal([]byte(commandsJSON), &commands); err != nil {
		panic(err.Error())
	}
	for name, command := range commands {
		command.Name = strings.ToUpper(name)
		commands[name] = command
	}
	return commands
}()

Commands is a map of all of the commands.

View Source
var DevMode = false

DevMode puts application in to dev mode

View Source
var ProtectedMode = "yes"

ProtectedMode forces Tile38 to default in protected mode.

View Source
var ShowDebugMessages = false

ShowDebugMessages allows for log.Debug to print to console.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Command  string      `json:"command"`
	NameAny  interface{} `json:"name"`
	TypeAny  interface{} `json:"type"`
	Optional bool        `json:"optional"`
	Multiple bool        `json:"multiple"`
	Variadic bool        `json:"variadic"`
	Enum     []string    `json:"enum"`
	EnumArgs []EnumArg   `json:"enumargs"`
}

Argument represents a command argument.

func (Argument) NameTypes

func (a Argument) NameTypes() (names, types []string)

NameTypes returns the types and names of an argument as separate arrays.

func (Argument) String

func (a Argument) String() string

String returns a string representation of an Argument.

type Command

type Command struct {
	Name       string     `json:"-"`
	Summary    string     `json:"summary"`
	Complexity string     `json:"complexity"`
	Arguments  []Argument `json:"arguments"`
	Since      string     `json:"since"`
	Group      string     `json:"group"`
	DevOnly    bool       `json:"dev"`
}

Command represents a Tile38 command.

func (Command) String

func (c Command) String() string

String returns a string representation of the command.

func (Command) TermOutput

func (c Command) TermOutput(indent string) string

TermOutput returns a string representation of the command suitable for displaying in a terminal.

type EnumArg

type EnumArg struct {
	Name      string     `json:"name"`
	Arguments []Argument `json:"arguments"`
}

EnumArg represents a enum arguments.

func (EnumArg) String

func (a EnumArg) String() string

String returns a string representation of an EnumArg.

Jump to

Keyboard shortcuts

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