Documentation ¶
Index ¶
- Constants
- Variables
- type CommandHandler
- type Environment
- type Event
- type EventPool
- type LogMessage
- type Module
- type ModuleHandler
- type ModuleParam
- func NewBoolParameter(name string, def_value string, desc string) *ModuleParam
- func NewIntParameter(name string, def_value string, desc string) *ModuleParam
- func NewModuleParameter(name string, def_value string, t ParamType, validator string, desc string) *ModuleParam
- func NewStringParameter(name string, def_value string, validator string, desc string) *ModuleParam
- type ParamType
- type Session
- type SessionModule
- func (m *SessionModule) AddHandler(h ModuleHandler)
- func (m *SessionModule) AddParam(p *ModuleParam)
- func (m *SessionModule) Handlers() []ModuleHandler
- func (m *SessionModule) OnSessionStarted(s *Session)
- func (m *SessionModule) Param(name string) *ModuleParam
- func (m *SessionModule) Parameters() map[string]*ModuleParam
- func (m *SessionModule) Running() bool
- func (m *SessionModule) SetRunning(running bool)
- type Targets
Constants ¶
View Source
const ( DEBUG = iota INFO IMPORTANT WARNING ERROR FATAL )
View Source
const ( BOLD = "\033[1m" DIM = "\033[2m" FG_BLACK = "\033[30m" FG_WHITE = "\033[97m" BG_DGRAY = "\033[100m" BG_RED = "\033[41m" BG_GREEN = "\033[42m" BG_YELLOW = "\033[43m" BG_LBLUE = "\033[104m" RESET = "\033[0m" )
View Source
const ( STRING ParamType = iota BOOL = iota INT = iota )
Variables ¶
View Source
var (
I = (*Session)(nil)
)
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct { Name string Description string Parser *regexp.Regexp Exec func(args []string, s *Session) error }
func NewCommandHandler ¶
type Environment ¶
type Environment struct { Padding int `json:"-"` Storage map[string]string `json:"storage"` // contains filtered or unexported fields }
func NewEnvironment ¶
func NewEnvironment(s *Session) *Environment
func (*Environment) Has ¶
func (env *Environment) Has(name string) bool
func (*Environment) Set ¶
func (env *Environment) Set(name, value string) string
func (*Environment) Sorted ¶
func (env *Environment) Sorted() []string
type Event ¶
type EventPool ¶
type EventPool struct { NewEvents chan Event // contains filtered or unexported fields }
func NewEventPool ¶
type LogMessage ¶
type ModuleHandler ¶
type ModuleHandler struct { Name string Description string Parser *regexp.Regexp Exec func(args []string) error }
func NewModuleHandler ¶
func (*ModuleHandler) Help ¶
func (h *ModuleHandler) Help(padding int) string
type ModuleParam ¶
type ModuleParam struct { Name string Type ParamType Value string Description string Validator *regexp.Regexp }
func NewBoolParameter ¶
func NewBoolParameter(name string, def_value string, desc string) *ModuleParam
func NewIntParameter ¶
func NewIntParameter(name string, def_value string, desc string) *ModuleParam
func NewModuleParameter ¶
func NewStringParameter ¶
func NewStringParameter(name string, def_value string, validator string, desc string) *ModuleParam
func (ModuleParam) Get ¶
func (p ModuleParam) Get(s *Session) (error, interface{})
func (ModuleParam) Help ¶
func (p ModuleParam) Help(padding int) string
func (ModuleParam) Register ¶
func (p ModuleParam) Register(s *Session)
func (ModuleParam) Validate ¶
func (p ModuleParam) Validate(value string) (error, interface{})
type Session ¶
type Session struct { Options core.Options `json:"options"` Interface *net.Endpoint `json:"interface"` Gateway *net.Endpoint `json:"gateway"` Firewall firewall.FirewallManager `json:"-"` Env *Environment `json:"env"` Targets *Targets `json:"targets"` Queue *packets.Queue `json:"-"` Input *readline.Instance `json:"-"` Active bool `json:"active"` CoreHandlers []CommandHandler `json:"-"` Modules []Module `json:"-"` HelpPadding int `json:"-"` Events *EventPool `json:"-"` }
type SessionModule ¶
type SessionModule struct { Name string `json:"name"` Session *Session `json:"-"` Started bool `json:"started"` StatusLock *sync.Mutex `json:"-"` // contains filtered or unexported fields }
func NewSessionModule ¶
func NewSessionModule(name string, s *Session) SessionModule
func (*SessionModule) AddHandler ¶
func (m *SessionModule) AddHandler(h ModuleHandler)
func (*SessionModule) AddParam ¶
func (m *SessionModule) AddParam(p *ModuleParam)
func (*SessionModule) Handlers ¶
func (m *SessionModule) Handlers() []ModuleHandler
func (*SessionModule) OnSessionStarted ¶
func (m *SessionModule) OnSessionStarted(s *Session)
func (*SessionModule) Param ¶
func (m *SessionModule) Param(name string) *ModuleParam
func (*SessionModule) Parameters ¶
func (m *SessionModule) Parameters() map[string]*ModuleParam
func (*SessionModule) Running ¶
func (m *SessionModule) Running() bool
func (*SessionModule) SetRunning ¶
func (m *SessionModule) SetRunning(running bool)
Click to show internal directories.
Click to hide internal directories.