command

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseStatusOk    = "ok"
	ResponseStatusError = "error"
)

Variables

View Source
var (
	ErrUnknownMessage = errors.New("unknown command type")
)

Message errors

Functions

func Encode

func Encode(m Message) ([]byte, error)

Encode encodes the message instance to a JSON buffer object

Types

type Message

type Message interface {
	GetName() MessageName
}

Message represents the message interface

func Decode

func Decode(data []byte) (Message, error)

Decode decodes JSON data into a message instance

type MessageName

type MessageName string

MessageName is a message ID type

const (
	StartMonitorName   MessageName = "cmd.monitor.start"
	StopMonitorName    MessageName = "cmd.monitor.stop"
	ShutdownSensorName MessageName = "cmd.sensor.shutdown"
)

Supported messages

type Response

type Response struct {
	Status string `json:"status"`
}

Response contains the command response status information

type ShutdownSensor

type ShutdownSensor struct{}

ShutdownSensor contains the 'shutdown sensor' command fields

func (*ShutdownSensor) GetName

func (m *ShutdownSensor) GetName() MessageName

GetName returns the command message ID for the 'shutdown sensor' command

type StartMonitor

type StartMonitor struct {
	ObfuscateMetadata            bool                          `json:"obfuscate_metadata"`
	RTASourcePT                  bool                          `json:"rta_source_ptrace"`
	AppName                      string                        `json:"app_name"`
	AppArgs                      []string                      `json:"app_args,omitempty"`
	AppEntrypoint                []string                      `json:"app_entrypoint,omitempty"`
	AppCmd                       []string                      `json:"app_cmd,omitempty"`
	AppUser                      string                        `json:"app_user,omitempty"`
	AppStdoutToFile              bool                          `json:"app_stdout_to_file"`
	AppStderrToFile              bool                          `json:"app_stderr_to_file"`
	RunTargetAsUser              bool                          `json:"run_tas_user,omitempty"`
	ReportOnMainPidExit          bool                          `json:"report_on_main_pid_exit"`
	KeepPerms                    bool                          `json:"keep_perms,omitempty"`
	Perms                        map[string]*fsutil.AccessInfo `json:"perms,omitempty"`
	Excludes                     []string                      `json:"excludes,omitempty"`
	Preserves                    map[string]*fsutil.AccessInfo `json:"preserves,omitempty"`
	Includes                     map[string]*fsutil.AccessInfo `json:"includes,omitempty"`
	IncludeBins                  []string                      `json:"include_bins,omitempty"`
	IncludeExes                  []string                      `json:"include_exes,omitempty"`
	IncludeShell                 bool                          `json:"include_shell,omitempty"`
	IncludeWorkdir               string                        `json:"include_workdir,omitempty"`
	IncludeCertAll               bool                          `json:"include_cert_all,omitempty"`
	IncludeCertBundles           bool                          `json:"include_cert_bundles,omitempty"`
	IncludeCertDirs              bool                          `json:"include_cert_dirs,omitempty"`
	IncludeCertPKAll             bool                          `json:"include_cert_pk_all,omitempty"`
	IncludeCertPKDirs            bool                          `json:"include_cert_pk_dirs,omitempty"`
	IncludeNew                   bool                          `json:"include_new,omitempty"`
	IncludeOSLibsNet             bool                          `json:"include_oslibs_net,omitempty"`
	IncludeZoneInfo              bool                          `json:"include_zoneinfo,omitempty"`
	IncludeAppNuxtDir            bool                          `json:"include_app_nuxt_dir,omitempty"`
	IncludeAppNuxtBuildDir       bool                          `json:"include_app_nuxt_build,omitempty"`
	IncludeAppNuxtDistDir        bool                          `json:"include_app_nuxt_dist,omitempty"`
	IncludeAppNuxtStaticDir      bool                          `json:"include_app_nuxt_static,omitempty"`
	IncludeAppNuxtNodeModulesDir bool                          `json:"include_app_nuxt_nm,omitempty"`
	IncludeAppNextDir            bool                          `json:"include_app_next_dir,omitempty"`
	IncludeAppNextBuildDir       bool                          `json:"include_app_next_build,omitempty"`
	IncludeAppNextDistDir        bool                          `json:"include_app_next_dist,omitempty"`
	IncludeAppNextStaticDir      bool                          `json:"include_app_next_static,omitempty"`
	IncludeAppNextNodeModulesDir bool                          `json:"include_app_next_nm,omitempty"`
	IncludeNodePackages          []string                      `json:"include_node_packages,omitempty"`
}

StartMonitor contains the start monitor command fields

func (*StartMonitor) GetName

func (m *StartMonitor) GetName() MessageName

GetName returns the command message ID for the start monitor command

type StopMonitor

type StopMonitor struct {
}

StopMonitor contains the stop monitor command fields

func (*StopMonitor) GetName

func (m *StopMonitor) GetName() MessageName

GetName returns the command message ID for the stop monitor command

Jump to

Keyboard shortcuts

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