module

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module is a structure containing the base information or template for modules

func NewModule

func NewModule(name, platform, arch, lang, description, notes string, extended, priv bool, author, credits, path, commands []string, options []Option) *Module

NewModule instantiates a module object, assigns a unique identifier, and returns the object

func (*Module) Agent

func (m *Module) Agent() string

func (*Module) Arch

func (m *Module) Arch() string

func (*Module) Author

func (m *Module) Author() []string

func (*Module) Commands

func (m *Module) Commands() []string

func (*Module) Credits

func (m *Module) Credits() []string

func (*Module) Description

func (m *Module) Description() string

func (*Module) Extended

func (m *Module) Extended() bool

func (*Module) ID

func (m *Module) ID() uuid.UUID

ID returns the unique identifier for this instance of the module

func (*Module) Lang

func (m *Module) Lang() string

func (*Module) Name

func (m *Module) Name() string

func (*Module) Notes

func (m *Module) Notes() string

func (*Module) Options

func (m *Module) Options() []Option

func (*Module) OptionsMap

func (m *Module) OptionsMap() map[string]string

OptionsMap is used to generate a map containing module option names and values to be used with other functions

func (*Module) OriginalOptions

func (m *Module) OriginalOptions() []Option

func (*Module) Platform

func (m *Module) Platform() string

func (*Module) String

func (m *Module) String() string

String returns the name of the module

func (*Module) UpdateAgent

func (m *Module) UpdateAgent(id string)

func (*Module) UpdateOptions

func (m *Module) UpdateOptions(options []Option)

UpdateOptions updates the options for the module

type Option

type Option struct {
	Name        string `json:"name"`        // Name of the option
	Value       string `json:"value"`       // Value of the option
	Required    bool   `json:"required"`    // Is this a required option?
	Flag        string `json:"flag"`        // The command line flag used for the option
	Description string `json:"description"` // A description of the option
}

Option is a structure containing the keys for the object

type Repository

type Repository interface {
	Add(module *Module) error
	Get(id uuid.UUID) (module *Module, err error)
	Reload(id uuid.UUID)
	Update(id uuid.UUID, module *Module) error
	UpdateOption(id uuid.UUID, key, value string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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