Documentation ¶
Index ¶
- Constants
- type Connection
- type ConnectionInstance
- type CronJob
- type Headers
- type Information
- type Linking
- type Listener
- type Module
- type ModuleFilter
- type ModuleInformation
- type Note
- type OpfClient
- type Param
- type Session
- func (s *Session) AddAlias(alias string, module string)
- func (s *Session) AddService(service Listener)
- func (s *Session) AddTarget(t string, name string) (string, error)
- func (s *Session) BooleanToString(element bool) string
- func (s *Session) ClearScreen()
- func (s *Session) ExportNow() SessionExport
- func (s *Session) FindLinked(m string, res TargetResults) ([]string, error)
- func (s *Session) FindLinkedTargetByResult(t *Target)
- func (s *Session) GetAlias(alias string) (string, error)
- func (s *Session) GetId() int
- func (s *Session) GetResult(id string) (*TargetResults, error)
- func (s *Session) GetTarget(id string) (*Target, error)
- func (s *Session) GetTargetByName(name string) (*Target, error)
- func (s *Session) IntegerToString(element int) string
- func (s *Session) ListAlias()
- func (s *Session) ListTargets()
- func (s *Session) ListType() []string
- func (s *Session) ParseCommand(line string) []string
- func (s *Session) PushPrompt()
- func (s *Session) PushType(t string)
- func (s *Session) ReadLineAutoCompleteFilters() func(string) []string
- func (s *Session) ReadLineAutoCompleteListAlias() func(string) []string
- func (s *Session) ReadLineAutoCompleteListModules() func(string) []string
- func (s *Session) ReadLineAutoCompleteModuleResults() func(string) []string
- func (s *Session) ReadLineAutoCompleteResults() func(string) []string
- func (s *Session) ReadLineAutoCompleteTargets() func(string) []string
- func (s *Session) ReadLineAutoCompleteType() func(string) []string
- func (s *Session) RemoveTarget(id string) (bool, error)
- func (s *Session) SearchFilter(name string) (ModuleFilter, error)
- func (s *Session) SearchModule(name string) (Module, error)
- func (s *Session) StringToBoolean(element string) bool
- func (s *Session) StringToInteger(element string) int
- func (Session) TableName() string
- func (s *Session) UpdateTarget(id string, value string)
- type SessionExport
- type SessionFilter
- type SessionModule
- func (module *SessionModule) CheckRequired() bool
- func (module *SessionModule) CreateNewParam(name string, description string, value string, isRequired bool, paramType int)
- func (module *SessionModule) GetAllParameters() []Param
- func (module *SessionModule) GetExport() []TargetResults
- func (module *SessionModule) GetExternal() []string
- func (module *SessionModule) GetParameter(name string) (Param, error)
- func (module *SessionModule) GetResults() []string
- func (module *SessionModule) ListArguments()
- func (module *SessionModule) SetExport(result TargetResults)
- func (module *SessionModule) SetParameter(name string, value string) (bool, error)
- func (module *SessionModule) WithProgram(name string) bool
- type Stream
- func (stream *Stream) Error(text string)
- func (stream *Stream) GenerateTable() table.Writer
- func (stream *Stream) Render(t table.Writer)
- func (stream *Stream) Standard(text string)
- func (stream *Stream) Success(text string)
- func (stream *Stream) Warning(text string)
- func (stream *Stream) WithoutDate(text string)
- type Target
- func (target *Target) AddNote(text string)
- func (target *Target) AddTag(tag string) (bool, error)
- func (target *Target) CheckType() bool
- func (target *Target) GetFormatedResults(module string) ([]map[string]string, error)
- func (sub *Target) GetId() string
- func (sub *Target) GetLinked() []Linking
- func (target *Target) GetModuleResults(name string) ([]*TargetResults, error)
- func (sub *Target) GetName() string
- func (target *Target) GetResult(id string) (*TargetResults, error)
- func (sub *Target) GetResults() map[string][]*TargetResults
- func (target *Target) GetSeparator() string
- func (target *Target) GetTags() []string
- func (sub *Target) GetType() string
- func (target *Target) HasTag(tag string) bool
- func (target *Target) Link(target2 Linking)
- func (target *Target) Linked()
- func (sub *Target) PushLinked(t Linking)
- func (target *Target) Save(module Module, result TargetResults) bool
- type TargetResults
Constants ¶
View Source
const ( INT = 1 STRING = 2 BOOL = 3 FLOAT = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { ConnectionInstance ORM *gorm.DB `json:"-"` Migrations map[string]interface{} `json:"-"` }
func (*Connection) GetDB ¶
func (c *Connection) GetDB() *sql.DB
func (*Connection) GetORM ¶
func (c *Connection) GetORM() *gorm.DB
func (*Connection) LoadMigration ¶
func (c *Connection) LoadMigration()
func (*Connection) Migrate ¶
func (c *Connection) Migrate() bool
type ConnectionInstance ¶
type Information ¶
type Information struct { ApiStatus bool `json:"api_status"` ModuleLaunched int `json:"module_launched"` Event int `json:"event"` }
func (*Information) AddEvent ¶
func (i *Information) AddEvent()
func (*Information) AddModule ¶
func (i *Information) AddModule()
func (*Information) SetApi ¶
func (i *Information) SetApi(s bool)
type Linking ¶
type Linking struct { LinkingId int `json:"-" gorm:"primary_key:yes;column:id;AUTO_INCREMENT"` SessionId int `json:"session_id" gorm:"column:session_id"` TargetBase string `json:"target_base" gorm:"column:target_base"` TargetId string `json:"target_id" gorm:"column:target_id"` TargetName string `json:"target_name" gorm:"column:target_name"` TargetType string `json:"target_type" gorm:"column:target_type"` TargetResultId string `json:"target_result_id" gorm:"column:target_result_id"` }
type Module ¶
type Module interface { Start() Name() string Author() string Description() string GetType() string ListArguments() GetExport() []TargetResults SetExport(result TargetResults) GetResults() []string GetInformation() ModuleInformation CheckRequired() bool SetParameter(name string, value string) (bool, error) GetParameter(name string) (Param, error) GetAllParameters() []Param WithProgram(name string) bool GetExternal() []string CreateNewParam(name string, description string, value string, isRequired bool, paramType int) }
type ModuleFilter ¶
type ModuleInformation ¶
type OpfClient ¶
func GetOpfClient ¶
func GetOpfClient() OpfClient
type Session ¶
type Session struct { Id int `json:"-" gorm:"primary_key:yes;column:id;AUTO_INCREMENT"` SessionName string `json:"session_name"` Information Information `json:"information"` Connection Connection `json:"-" sql:"-"` Client OpfClient Config config.Config `json:"config" sql:"-"` Version string `json:"version" sql:"-"` Targets []*Target `json:"subjects" sql:"-"` Modules []Module `json:"modules" sql:"-"` Filters []ModuleFilter `json:"filters" sql:"-"` Prompt *readline.Config `json:"-" sql:"-"` Stream Stream `json:"-" sql:"-"` TypeLists []string `json:"type_lists" sql:"-"` ServiceFolder string `json:"home_folder"` Services []Listener `json:"services"` Alias map[string]string `json:"-" sql:"-"` }
func (*Session) AddService ¶
func (*Session) BooleanToString ¶
func (*Session) ClearScreen ¶
func (s *Session) ClearScreen()
func (*Session) ExportNow ¶
func (s *Session) ExportNow() SessionExport
func (*Session) FindLinked ¶
func (s *Session) FindLinked(m string, res TargetResults) ([]string, error)
func (*Session) FindLinkedTargetByResult ¶
func (*Session) IntegerToString ¶
func (*Session) ListTargets ¶
func (s *Session) ListTargets()
func (*Session) ParseCommand ¶
func (*Session) PushPrompt ¶
func (s *Session) PushPrompt()
func (*Session) ReadLineAutoCompleteFilters ¶
func (*Session) ReadLineAutoCompleteListAlias ¶
func (*Session) ReadLineAutoCompleteListModules ¶
func (*Session) ReadLineAutoCompleteModuleResults ¶
func (*Session) ReadLineAutoCompleteResults ¶
func (*Session) ReadLineAutoCompleteTargets ¶
func (*Session) ReadLineAutoCompleteType ¶
func (*Session) SearchFilter ¶
func (s *Session) SearchFilter(name string) (ModuleFilter, error)
func (*Session) StringToBoolean ¶
func (*Session) StringToInteger ¶
func (*Session) UpdateTarget ¶
type SessionExport ¶
type SessionExport struct { Id int `json:"-"` SessionName string `json:"session_name"` Information Information `json:"information"` Config config.Config `json:"config" sql:"-"` Version string `json:"version" sql:"-"` Targets []*Target `json:"subjects" sql:"-"` Modules []Module `json:"modules" sql:"-"` Filters []ModuleFilter `json:"filters" sql:"-"` Stream Stream `json:"-" sql:"-"` TypeLists []string `json:"type_lists" sql:"-"` ServiceFolder string `json:"home_folder"` Services []Listener `json:"services"` }
type SessionFilter ¶
type SessionFilter struct { ModuleFilter With []string }
func (*SessionFilter) AddModule ¶
func (filter *SessionFilter) AddModule(name string)
func (*SessionFilter) WorkWith ¶
func (filter *SessionFilter) WorkWith(name string) bool
type SessionModule ¶
type SessionModule struct { Module Export []TargetResults Parameters []Param `json:"parameters"` History []string `json:"history"` External []string `json:"external"` Results []string }
func (*SessionModule) CheckRequired ¶
func (module *SessionModule) CheckRequired() bool
func (*SessionModule) CreateNewParam ¶
func (*SessionModule) GetAllParameters ¶
func (module *SessionModule) GetAllParameters() []Param
func (*SessionModule) GetExport ¶
func (module *SessionModule) GetExport() []TargetResults
func (*SessionModule) GetExternal ¶
func (module *SessionModule) GetExternal() []string
func (*SessionModule) GetParameter ¶
func (module *SessionModule) GetParameter(name string) (Param, error)
func (*SessionModule) GetResults ¶
func (module *SessionModule) GetResults() []string
func (*SessionModule) ListArguments ¶
func (module *SessionModule) ListArguments()
func (*SessionModule) SetExport ¶
func (module *SessionModule) SetExport(result TargetResults)
func (*SessionModule) SetParameter ¶
func (module *SessionModule) SetParameter(name string, value string) (bool, error)
func (*SessionModule) WithProgram ¶
func (module *SessionModule) WithProgram(name string) bool
type Stream ¶
type Stream struct { Sess *Session `json:"-"` Verbose bool `json:"verbose"` JSON bool `json:"json"` History map[string]string `json:"history"` }
func (*Stream) GenerateTable ¶
func (*Stream) WithoutDate ¶
type Target ¶
type Target struct { Id int `json:"-" gorm:"primary_key:yes;column:id;AUTO_INCREMENT"` SessionId int `json:"-" gorm:"column:session_id"` TargetId string `json:"id" gorm:"column:target_id"` Sess *Session `json:"-" gorm:"-"` Name string `json:"name" gorm:"column:target_name"` Type string `json:"type" gorm:"column:target_type"` Results map[string][]*TargetResults `sql:"-" json:"results"` TargetLinked []Linking `json:"target_linked" sql:"-"` Notes []Note `json:"notes" sql:"-"` Tags []string `json:"tags" sql:"-"` }
func (*Target) GetFormatedResults ¶
func (*Target) GetModuleResults ¶
func (target *Target) GetModuleResults(name string) ([]*TargetResults, error)
func (*Target) GetResults ¶
func (sub *Target) GetResults() map[string][]*TargetResults
func (*Target) GetSeparator ¶
func (*Target) PushLinked ¶
type TargetResults ¶
type TargetResults struct { Id int `json:"-" gorm:"primary_key:yes;column:id;AUTO_INCREMENT"` SessionId int `json:"-" gorm:"session_id"` ModuleName string `json:"module_name"` ResultId string `json:"result_id" gorm:"primary_key:yes;column:result_id"` TargetId string `json:"target_id" gorm:"target_id"` Header string `json:"key" gorm:"result_header"` Value string `json:"value" gorm:"result_value"` Notes []Note }
func (*TargetResults) AddNote ¶
func (result *TargetResults) AddNote(text string)
Click to show internal directories.
Click to hide internal directories.