assets

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultArmoryName = "Default"

	DefaultMalName = "Default"
)
View Source
const (
	AliasesDirName    = "aliases"
	ExtensionsDirName = "extensions"
	MalsDirName       = "mals"
)

Variables

View Source
var (
	MaliceDirName    = ".config/malice"
	ConfigDirName    = "configs"
	ResourcesDirName = "resources"
	TempDirName      = "temp"
	LogDirName       = "log"
)
View Source
var (
	// DefaultArmoryPublicKey - The default public key for the armory
	DefaultArmoryPublicKey = "RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L"
	// DefaultArmoryRepoURL - The default repo url for the armory
	DefaultArmoryRepoURL = "https://api.github.com/repos/sliverarmory/armory/releases"

	DefaultArmoryConfig = &ArmoryConfig{
		PublicKey: DefaultArmoryPublicKey,
		RepoURL:   DefaultArmoryRepoURL,
		Name:      DefaultArmoryName,
		Enabled:   true,
	}

	DefaultMalRepoURL = "https://api.github.com/repos/chainreactors/mals/releases"

	DefaultMalConfig = &MalConfig{

		RepoURL: DefaultMalRepoURL,
		Name:    DefaultMalName,
		Enabled: true,
	}
)
View Source
var (
	DefaultSettings, _ = LoadSettings()
)

Functions

func ExecuteAuthorizationCmd added in v0.0.2

func ExecuteAuthorizationCmd(cmd string) string

func GenerateTempFile added in v0.0.3

func GenerateTempFile(sessionId, filename string) (*os.File, error)

func GetAliasesDir

func GetAliasesDir() string

GetAliasesDir - Returns the path to the config dir

func GetConfigDir

func GetConfigDir() string

func GetConfigs

func GetConfigs() ([]string, error)

func GetExtensionsDir

func GetExtensionsDir() string

GetExtensionsDir

func GetInstalledAliasManifests

func GetInstalledAliasManifests() []string

GetInstalledAliasManifests - Returns a list of installed alias manifests

func GetInstalledExtensionManifests

func GetInstalledExtensionManifests() []string

GetInstalledExtensionManifests - Returns a list of installed extension manifests

func GetInstalledMalManifests added in v0.0.2

func GetInstalledMalManifests() []string

func GetLogDir added in v0.0.3

func GetLogDir() string

func GetMalsDir added in v0.0.2

func GetMalsDir() string

func GetResourceDir added in v0.0.3

func GetResourceDir() string

func GetRootAppDir

func GetRootAppDir() string

func GetTempDir added in v0.0.3

func GetTempDir() string

func MvConfig

func MvConfig(oldPath string) error

func SaveProfile added in v0.0.3

func SaveProfile(profile *Profile) error

func SaveSettings

func SaveSettings(settings *Settings) error

SaveSettings - Save the current settings to disk

Types

type ArmoryConfig

type ArmoryConfig struct {
	PublicKey        string `json:"public_key"`
	RepoURL          string `json:"repo_url"`
	Authorization    string `json:"authorization"`
	AuthorizationCmd string `json:"authorization_cmd"`
	Name             string `json:"name"`
	Enabled          bool   `json:"enabled"`
}

ArmoryConfig - The armory config file

func GetArmoriesConfig

func GetArmoriesConfig() []*ArmoryConfig

GetArmoriesConfig - The parsed armory config file

type MalConfig added in v0.0.2

type MalConfig struct {
	// PublicKey        string `json:"public_key" yaml:"public_key"`
	RepoURL          string `json:"repo_url" yaml:"repo_url"`
	Authorization    string `json:"authorization" yaml:"authorization"`
	AuthorizationCmd string `json:"authorization_cmd" yaml:"authorization_cmd"`
	Name             string `json:"name" yaml:"name"`
	Enabled          bool   `json:"enabled" yaml:"enabled"`
	Version          string `json:"version" yaml:"version"`
	Help             string `json:"help" yaml:"help"`
}

func GetMalsConfig added in v0.0.2

func GetMalsConfig() []*MalConfig

type Profile

type Profile struct {
	ResourceDir string    `yaml:"resources" config:"resources" default:""`
	TempDir     string    `yaml:"tmp" config:"tmp" default:""`
	Aliases     []string  `yaml:"aliases" config:"aliases" default:""`
	Extensions  []string  `yaml:"extensions" config:"extensions" default:""`
	Mals        []string  `yaml:"mals" config:"mals" default:""`
	Settings    *Settings `yaml:"settings" config:"settings"`
}

func GetProfile added in v0.0.3

func GetProfile() *Profile

func (*Profile) AddAlias added in v0.0.3

func (profile *Profile) AddAlias(alias string) bool

func (*Profile) AddExtension added in v0.0.3

func (profile *Profile) AddExtension(extension string) bool

func (*Profile) AddMal added in v0.0.3

func (profile *Profile) AddMal(manifestName string) bool

type Settings

type Settings struct {
	TableStyle        string `yaml:"tables" config:"tables"`
	AutoAdult         bool   `yaml:"autoadult" config:"autoadult"`
	BeaconAutoResults bool   `yaml:"beacon_autoresults" config:"beacon_autoresults"`
	SmallTermWidth    int    `yaml:"small_term_width" config:"small_term_width"`
	AlwaysOverflow    bool   `yaml:"always_overflow" config:"always_overflow"`
	VimMode           bool   `yaml:"vim_mode" config:"vim_mode"`
	DefaultTimeout    int    `yaml:"default_timeout" config:"default_timeout" default:""`
	MaxServerLogSize  int    `yaml:"max_server_log_size" config:"max_server_log_size" default:"10"`
}

func LoadSettings

func LoadSettings() (*Settings, error)

Jump to

Keyboard shortcuts

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