core

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: BSD-3-Clause Imports: 21 Imported by: 18

Documentation

Index

Constants

View Source
const (
	StdLen  = 16
	UUIDLen = 20
)

Variables

View Source
var AMP = "&"
View Source
var DAMP = "&&"
View Source
var GOHOME = os.ExpandEnv("$GOPATH") + "/src/"
View Source
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
View Source
var StdNums = []byte("OYZ0123456789")

Functions

func AskForConfirmation

func AskForConfirmation() bool

func BytesToString

func BytesToString(b []byte) string

func CheckFile

func CheckFile(source string) (file, line, reason string)

func Config added in v0.5.6

func Config() (*gos, error)

Get config of current project.

func CopyDir

func CopyDir(source string, dest string) (err error)

updates Recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist.

func CopyFile

func CopyFile(source string, dest string) (err error)

func Decode64

func Decode64(decBuf, enc []byte) []byte

func DoSpin added in v0.5.5

func DoSpin(chn chan int)

func DoubleInput

func DoubleInput(p1 string, p2 string) (r1 string, r2 string)

func EscpaseGXML added in v0.5.4

func EscpaseGXML(data []byte) []byte

func Exe_BG

func Exe_BG(cmd string)

func Exe_Stall

func Exe_Stall(cmd string, chn chan bool)

func Exe_Stalll

func Exe_Stalll(cmd string)

func IsInImports

func IsInImports(imports []*ast.ImportSpec, unfoundvar string) bool

func IsInSlice

func IsInSlice(qry string, slic []string) bool

func LoadGos

func LoadGos(pathraw string) (*gos, error)

func NewID

func NewID(length int) string

func NewLen

func NewLen(length int) string

func NewLenChars

func NewLenChars(length int, chars []byte) string

NewLenChars returns a new random string of the provided length, consisting of the provided byte slice of allowed characters (maximum 256).

func PLoadGos

func PLoadGos(pathraw string) (*gos, error)

func Process

func Process(template *gos, r string, web string, tmpl string) (local_string string)

func ReadLines

func ReadLines(path string) ([]string, error)

func RemoveContents

func RemoveContents(dir string) error

func ReplaceLegacy added in v0.6.1

func ReplaceLegacy(source, target, newExpr string) string

func RunCmd

func RunCmd(cmd string)

func RunCmdA

func RunCmdA(cm string) error

func RunCmdB

func RunCmdB(cmd string)

func RunCmdByte

func RunCmdByte(cmd string) []byte

func RunCmdSmart

func RunCmdSmart(cmd string) (string, error)

func RunCmdSmartB

func RunCmdSmartB(cmd string) ([]byte, error)

func RunCmdSmartCmb

func RunCmdSmartCmb(cmd string) (string, error)

func RunCmdSmartP

func RunCmdSmartP(cmd string) (string, error)

func RunCmdSmartZ

func RunCmdSmartZ(cmd string) (string, error)

func RunCmdSmarttwo

func RunCmdSmarttwo(cmd string) (string, error)

func RunCmdString

func RunCmdString(cmd string) string

func RunFile

func RunFile(root string, file string)

func TrimSuffix

func TrimSuffix(s, suffix string) string

func VLoadGos

func VLoadGos(pathraw string) (gos, error)

Types

type CustomError

type CustomError struct {
	What string
}

A struct for returning custom error messages

func (*CustomError) Error

func (e *CustomError) Error() string

Returns the error message defined in What as a string

type Endpoint

type Endpoint struct {
	XMLName xml.Name `xml:"end"`
	// User-entered endpoint URI.
	Path string `xml:"path,attr"`
	// Code block to run on URI load.
	Method string `xml:",innerxml"`
	// User-entered endpoint request verb type.
	// If a URI matches a request but the verb does not
	// the endpoint will not load.
	Type    string      `xml:"type,attr"`
	Testi   string      `xml:"testi,attr"`
	Testo   string      `xml:"testo,attr"`
	Id      string      `xml:"id,attr"`
	Comment xml.Comment `xml:",comment"`
}

func GetEndpointComment added in v0.6.1

func GetEndpointComment(e Endpoint) Endpoint

type Endpoints

type Endpoints struct {
	XMLName xml.Name `xml:"endpoints"`
	// Array of Web service URIs.
	Endpoints []Endpoint `xml:"end"`
}

Webservice endpoints.

type GlobalVariables

type GlobalVariables struct {
	XMLName      xml.Name `xml:"var"`
	Name         string   `xml:",innerxml"`
	Type         string   `xml:"type,attr"`
	ExplicitName string
}
type Header struct {
	XMLName xml.Name `xml:"header"`
	Structs []Struct `xml:"struct"`
	Objects []Object `xml:"object"`
}

type Import

type Import struct {
	XMLName xml.Name `xml:"import"`
	Src     string   `xml:"src,attr"`
}

type Method

type Method struct {
	XMLName    xml.Name    `xml:"method"`
	Method     string      `xml:",innerxml"`
	Comment    xml.Comment `xml:",comment"`
	Name       string      `xml:"name,attr"`
	Variables  string      `xml:"var,attr"`
	Limit      string      `xml:"limit,attr"`
	Object     string      `xml:"object,attr"`
	Autoface   string      `xml:"autoface,attr"`
	Keeplocal  string      `xml:"keep-local,attr"`
	Testi      string      `xml:"testi,attr"`
	Testo      string      `xml:"testo,attr"`
	Man        string      `xml:"m,attr"`
	Returntype string      `xml:"return,attr"`
}

type Methods

type Methods struct {
	XMLName xml.Name `xml:"methods"`
	Methods []Method `xml:"method"`
}

type Object

type Object struct {
	XMLName xml.Name `xml:"object"`
	Name    string   `xml:"name,attr"`
	Templ   string   `xml:"struct,attr"`
	Methods string   `xml:",innerxml"`
}

type Package added in v0.6.0

type Package struct {
	Path string
	Name string
}

type Pgos

type Pgos struct {
	// contains filtered or unexported fields
}

func (*Pgos) Add added in v0.5.7

func (d *Pgos) Add(sec, typ, name string)

func (*Pgos) AddS added in v0.5.7

func (d *Pgos) AddS(sec string, typ interface{})

func (*Pgos) AddToMainFunc added in v0.5.7

func (template *Pgos) AddToMainFunc(str string) error

func (*Pgos) Delete added in v0.5.7

func (d *Pgos) Delete(typ, id string)

func (*Pgos) DeleteEnd added in v0.5.7

func (d *Pgos) DeleteEnd(id string)

func (*Pgos) MMethod added in v0.5.7

func (d *Pgos) MMethod(ne []Method)

func (*Pgos) MObjects added in v0.5.7

func (d *Pgos) MObjects(ne []Object)

func (*Pgos) MStructs added in v0.5.7

func (d *Pgos) MStructs(ne []Struct)

func (*Pgos) MergeWith added in v0.5.7

func (d *Pgos) MergeWith(target string)

func (*Pgos) MergeWithV added in v0.5.7

func (d *Pgos) MergeWithV(target string)

func (*Pgos) PSaveGos added in v0.5.7

func (d *Pgos) PSaveGos(path string)

func (*Pgos) Set added in v0.5.7

func (d *Pgos) Set(attr, value string)

func (*Pgos) Update added in v0.5.7

func (d *Pgos) Update(sec, id string, update interface{})

func (*Pgos) UpdateMethod added in v0.5.7

func (d *Pgos) UpdateMethod(id string, data string)

type Struct

type Struct struct {
	XMLName    xml.Name `xml:"struct"`
	Name       string   `xml:"name,attr"`
	Attributes string   `xml:",innerxml"`
}

type Template

type Template struct {
	XMLName xml.Name `xml:"template"`
	// User-entered template identifier.
	Name string `xml:"name,attr"`
	// Template file relative to tmpl folder,
	// without .tmpl suffix as well.
	TemplateFile string `xml:"tmpl,attr"`
	//
	Bundle string `xml:"bundle,attr"`
	// Interface to use with template.
	Struct    string `xml:"struct,attr"`
	ForcePath bool
	Comment   xml.Comment `xml:",comment"`
}

func GetTemplateComment added in v0.6.1

func GetTemplateComment(e Template) Template

type Templates

type Templates struct {
	XMLName   xml.Name   `xml:"templates"`
	Templates []Template `xml:"template"`
}

type Timer

type Timer struct {
	XMLName  xml.Name `xml:"timer"`
	Method   string   `xml:",innerxml"`
	Interval string   `xml:"interval,attr"`
	Name     string   `xml:"name,attr"`
	Unit     string   `xml:"unit,attr"`
}

type Timers

type Timers struct {
	XMLName xml.Name `xml:"timers"`
	Timers  []Timer  `xml:"timer"`
}

type VGos

type VGos struct {
	XMLName xml.Name `xml:"gos"`
	Objects []Object `xml:"object"`
	Structs []Struct `xml:"struct"`
	Methods []Method `xml:"method"`
}

func CreateVGos

func CreateVGos(path string) *VGos

Jump to

Keyboard shortcuts

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