caplets

package
v2.24.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package caplets contains functions to enumerate, load and execute caplets.

Index

Constants

View Source
const (
	EnvVarName     = "CAPSPATH"
	Suffix         = ".cap"
	InstallArchive = "https://github.com/bettercap/caplets/archive/master.zip"
	InstallBase    = "/usr/local/share/bettercap/"
)

Variables

View Source
var (
	InstallPathArchive = filepath.Join(InstallBase, "caplets-master")
	InstallPath        = filepath.Join(InstallBase, "caplets")

	LoadPaths = []string{
		"./",
		"./caplets/",
		InstallPath,
	}
)

Functions

This section is empty.

Types

type Caplet

type Caplet struct {
	Script
	Name    string   `json:"name"`
	Scripts []Script `json:"scripts"`
}

func List

func List() []*Caplet

func Load

func Load(name string) (error, *Caplet)

func NewCaplet

func NewCaplet(name string, path string, size int64) Caplet

func (*Caplet) Eval

func (cap *Caplet) Eval(argv []string, lineCb func(line string) error) error

type Script

type Script struct {
	Path string   `json:"path"`
	Size int64    `json:"size"`
	Code []string `json:"code"`
}

Jump to

Keyboard shortcuts

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