snippet

package
v0.0.0-...-d204e24 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snippets

type Snippets []*pb.Snippet

Snippets represents more than 1 snippet

func (Snippets) Len

func (s Snippets) Len() int

func (Snippets) Less

func (s Snippets) Less(i, j int) bool

func (Snippets) Swap

func (s Snippets) Swap(i, j int)

type Store

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

Store retrieves, creates and deletes snippets stored in the data store

func NewStore

func NewStore(storage storage.BucketKeyValueStore) (*Store, error)

NewStore returns a new Store

func (*Store) DeleteAll

func (s *Store) DeleteAll() error

DeleteAll deletes all snippets in the store

func (*Store) Get

func (s *Store) Get(id string) (snpt pb.Snippet, err error)

Get retrieves a snippet from the store

func (*Store) GetAll

func (s *Store) GetAll() (snpts Snippets, err error)

GetAll retrieves all snippets from the store

func (*Store) Put

func (s *Store) Put(snpt *pb.Snippet) error

Put stores a snippet in the store

Jump to

Keyboard shortcuts

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