snippets

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Insert(Snippet) error
	Find(string) (Snippet, error)
	List() ([]string, error)
	Delete(string) error
	ListObj() ([]Snippet, error)
}

Container provides an interface for a type handling snippet storage.

func NewSnippetsContainer

func NewSnippetsContainer(t string) (Container, error)

NewSnippetsContainer creates a fresh instance of snippets container.

Allowed types (t): map

type Snippet

type Snippet struct {
	Name string
	Desc string
	Body string
}

Snippet carries information about a single code snippet.

func (Snippet) Repr

func (s Snippet) Repr() string

Repr provides an in-file snippet text representation.

Jump to

Keyboard shortcuts

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