scripts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry allows to add, remove and list all registered lua scripts.

func NewRegistry

func NewRegistry(vendor, application string) *Registry

NewRegistry returns new script directory based on app and vendor names.

func (*Registry) Get

func (r *Registry) Get(name string) *Script

Get returns script by name or error

func (*Registry) GetAll

func (r *Registry) GetAll() []*Script

GetAll returns list of registered scripts scripts associated with their aliases.

func (*Registry) Register

func (r *Registry) Register(name, content string) error

Register new scripts script

func (*Registry) Remove

func (r *Registry) Remove(name string) error

Remove removes one goffli lua script.

type Script

type Script struct {
	// Name is short script name (filename without extension).
	Name string

	// Path is physical script locations
	Path string

	// Tags includes set of user defined tags associated with script body.
	Tags map[string]string
}

Script represents one pre-registered lua script.

func NewScript

func NewScript(path string) (*Script, error)

NewScript returns new Script instance based on given part of returns errors.

func (*Script) String

func (s *Script) String() string

String converts script definition into string.

func (*Script) Tag

func (s *Script) Tag(name, placeholder string) string

Tag gets tag value or returns placeholder.

Jump to

Keyboard shortcuts

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