snippet

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 2 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 {
	UID      string   `json:"uid,omitempty" yaml:"uid,omitempty"`
	Group    string   `json:"group,omitempty" yaml:"group,omitempty"`
	Name     string   `json:"name" yaml:"name"`
	Desc     string   `json:"desc,omitempty" yaml:"desc,omitempty"`
	Content  string   `json:"content" yaml:"content"`
	Output   string   `json:"output,omitempty" yaml:"output,omitempty"`
	Labels   []string `json:"labels,omitempty" yaml:"labels,omitempty"`
	LoadPath string   `json:"-" yaml:"-"`
}

func New

func New(u, g, n, c, o, d string, l []string) *Snippet

New return new Snippet

func (Snippet) String

func (s Snippet) String() string

type SnippetSet

type SnippetSet struct {
	Group    string   `yaml:"group,omitempty"`
	Snippets Snippets `yaml:"snippets"`
	LoadPath string   `json:"-" yaml:"-"`
}

type Snippets

type Snippets []*Snippet

func (Snippets) AddLoadPath

func (snips Snippets) AddLoadPath(path string)

func (Snippets) ClearLoadPath

func (snips Snippets) ClearLoadPath()

func (Snippets) FindByUID

func (snips Snippets) FindByUID(uid string) (*Snippet, error)

func (Snippets) Validate

func (snips Snippets) Validate() error

Jump to

Keyboard shortcuts

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