model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalWordListStorage []WordList
View Source
var JobChannel chan Job

Functions

func GetDomainAndMainPageByUrl

func GetDomainAndMainPageByUrl(s string) (string, string)

from: https://gobyexample.com/url-parsing

func ReadConfigurationFromFile

func ReadConfigurationFromFile(fileName string) (err error)

read configuration from file

func ReadGlobalWordlistFromRemote

func ReadGlobalWordlistFromRemote() error

func ReadWordListFromFile

func ReadWordListFromFile(fileName string) (err error)

read wordList from file

func ReadWordListStorageFromFile

func ReadWordListStorageFromFile(fileName string) (err error)

read wordListStorage from file

func StoreWordlistAtRemote

func StoreWordlistAtRemote(wl WordList) error

func UpdateSession

func UpdateSession(s Session)

store session at global

this is subject to concurency

func UpdateWordlist

func UpdateWordlist(wl WordList)

store wordlist at global

this is subject to concurency

func Worker

func Worker(i int, jobChannel <-chan Job)

Types

type Config

type Config struct {
	WordListUrl        string `json:"wordlisturl"`
	WordListStorageUrl string `json:"wordliststorageurl"`
}
var GlobalConfig Config

type Job

type Job struct {
	Wordlist WordList
}

Job represents the job to be run

type ResponseStatus

type ResponseStatus struct {
	Code int    `json:"code"`
	Text string `json:"text"`
}

type Session

type Session struct {
	SessionID          int    `json:"sid"`
	Count              int    `json:"count"`
	RequestExecution   bool   `json:"requestexecution"`
	PageToScan         string `json:"pagetoscan"`
	DomainsAllowed     string `json:"domainsallowed"`
	NumberLinksFound   int    `json:"numberlinksfound"`
	NumberLinksVisited int    `json:"numberlinksvisited"`
	ExecutionStarted   bool   `json:"executionstarted"`
	ExecutionFinished  bool   `json:"executionfinished"`
	WordsScanned       int    `json:"wordsscanned"`
	PdfsScanned        int    `json:"pdfsscanned"`
}

type SorterWordByOccurance

type SorterWordByOccurance []Word

func (SorterWordByOccurance) Len

func (a SorterWordByOccurance) Len() int

func (SorterWordByOccurance) Less

func (a SorterWordByOccurance) Less(i, j int) bool

func (SorterWordByOccurance) Swap

func (a SorterWordByOccurance) Swap(i, j int)

type Test

type Test struct {
	Name     string `json:"name"`
	Category string `json:"category"`
}

type Word

type Word struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	Occurance int    `json:"occurance"`
	New       bool   `json:"new"`
	Tests     []Test `json:"tests"`
}

func CopyWords

func CopyWords(wl []Word) []Word

func DeleteWordsWithOccuranceZero

func DeleteWordsWithOccuranceZero(wl []Word) []Word

type WordList

type WordList struct {
	Session Session `json:"session"`
	Words   []Word  `json:"words"`
	Tests   []Test  `json:"tests"`
}
var GlobalWordList WordList

func GetWordListForSession

func GetWordListForSession(sid int) (WordList, error)

func NewSession

func NewSession(session Session) (WordList, error)

new session returns existing or new session

func (*WordList) Crawler

func (wl *WordList) Crawler()

func (*WordList) FindWordsFromText

func (wl *WordList) FindWordsFromText(t string, isPdf bool)

Jump to

Keyboard shortcuts

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