snippet

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snippet

type Snippet struct {
	Name     string
	Type     string
	Text     string
	Vars     map[string]*Var
	FxEscape func(string) string
}

func (*Snippet) Escape

func (q *Snippet) Escape(f func(string) string) *Snippet

func (*Snippet) Get

func (q *Snippet) Get() string

func (*Snippet) Param

func (q *Snippet) Param(key string, value interface{}) *Snippet

type Snippets

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

func NewSnippetStorage

func NewSnippetStorage() *Snippets

func (*Snippets) Comment

func (s *Snippets) Comment(comment string) *Snippets

func (*Snippets) Escape

func (s *Snippets) Escape(fx func(string) string) *Snippets

func (*Snippets) GetSnippet

func (s *Snippets) GetSnippet(name string) Snippet

func (*Snippets) Load

func (s *Snippets) Load(scanner *bufio.Scanner) *Snippets

func (*Snippets) LoadFile

func (s *Snippets) LoadFile(name string) *Snippets

func (*Snippets) LoadString

func (s *Snippets) LoadString(code string) *Snippets

type Var

type Var struct {
	Key   string
	Value string
	Type  string
}

Jump to

Keyboard shortcuts

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