repository

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 86 Imported by: 0

Documentation

Overview

Package repository implements an in-memory database that holds a map of Command structures used with the Merlin CLI

Index

Constants

This section is empty.

Variables

View Source
var ErrCommandNotFound = errors.New(fmt.Sprintf("%s: command not found", pkg))
View Source
var ErrCommandNotInMenu = errors.New(fmt.Sprintf("%s: command not in menu", pkg))

Functions

This section is empty.

Types

type Repository

type Repository struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Repository structure implements an in-memory database that holds a map of Command structures used with the Merlin CLI

func NewRepository

func NewRepository() *Repository

NewRepository creates and returns a Repository structure that contains an in-memory map of agents

func (*Repository) Add

func (r *Repository) Add(cmd commands.Command)

func (*Repository) Get

func (r *Repository) Get(m menu.Menu, cmd string) (command commands.Command, err error)

func (*Repository) GetAll

func (r *Repository) GetAll() (commands []commands.Command)

Jump to

Keyboard shortcuts

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