caplets

package
v0.0.0-...-ff3c323 Latest Latest
Warning

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

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

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"
)

Variables

View Source
var (
	InstallBase        = ""
	InstallPathArchive = ""
	InstallPath        = ""
	ArchivePath        = ""
	LoadPaths          = []string(nil)
)

Functions

func Setup

func Setup(base string) error

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) (*Caplet, error)

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