core

package
v3.2.1-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package core generated by go-bindata.// sources: static/fonts/open-iconic.eot static/fonts/open-iconic.otf static/fonts/open-iconic.svg static/fonts/open-iconic.ttf static/fonts/open-iconic.woff static/images/gopher_full.png static/images/gopher_head.png static/images/spinner.gif static/index.html static/javascripts/application.js static/javascripts/backbone.js static/javascripts/bootstrap.js static/javascripts/clipboard.js static/javascripts/hexdump.js static/javascripts/highlight.js static/javascripts/highlight_worker.js static/javascripts/jquery-3.3.1.js static/javascripts/popper.js static/javascripts/underscore.js static/stylesheets/application.css static/stylesheets/bootstrap.css static/stylesheets/highlight.css static/stylesheets/openiconic.css

Index

Constants

View Source
const (
	GithubBaseUri   = "https://raw.githubusercontent.com"
	MaximumFileSize = 153600
	GitLabBaseUri   = "https://gitlab.com"
	CspPolicy       = "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'"
	ReferrerPolicy  = "no-referrer"
)
View Source
const (
	GitHubAccessTokenEnvVariable = "GITROB_GITHUB_ACCESS_TOKEN"
	GitLabAccessTokenEnvVariable = "GITROB_GITLAB_ACCESS_TOKEN"
	StatusInitializing           = "initializing"
	StatusGathering              = "gathering"
	StatusAnalyzing              = "analyzing"
	StatusFinished               = "finished"
)

Variables

View Source
var IsGithub bool

Functions

func AnalyzeRepositories

func AnalyzeRepositories(sess *Session)

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func BinaryFileSystem

func BinaryFileSystem(root string) *binaryFileSystem

func GatherRepositories

func GatherRepositories(sess *Session)

func GatherTargets

func GatherTargets(sess *Session)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NewRouter

func NewRouter(s *Session) *gin.Engine

func PrintSessionStats

func PrintSessionStats(sess *Session)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type GitLab

type GitLab struct {
	AccessToken string `json:"-"`
}

type Github

type Github struct {
	AccessToken string `json:"-"`
}

type Options

type Options struct {
	BindAddress       *string `json:"-"`
	CommitDepth       *int
	Debug             *bool   `json:"-"`
	GitLabAccessToken *string `json:"-"`
	GithubAccessToken *string `json:"-"`
	InMemClone        *bool
	Load              *string `json:"-"`
	Logins            []string
	Mode              *int
	NoExpandOrgs      *bool
	Port              *int
	Save              *string `json:"-"`
	Silent            *bool   `json:"-"`
	Threads           *int
}

func ParseOptions

func ParseOptions() (Options, error)

type Session

type Session struct {
	sync.Mutex

	Version         string
	Options         Options        `json:"-"` //do not unmarshal to json on save
	Out             *common.Logger `json:"-"` //do not unmarshal to json on save
	Stats           *Stats
	Github          Github         `json:"-"` //do not unmarshal to json on save
	GitLab          GitLab         `json:"-"` //do not unmarshal to json on save
	Client          common.IClient `json:"-"` //do not unmarshal to json on save
	Router          *gin.Engine    `json:"-"` //do not unmarshal to json on save
	Targets         []*common.Owner
	Repositories    []*common.Repository
	Findings        []*matching.Finding
	IsGithubSession bool                `json:"-"` //do not unmarshal to json on save
	Signatures      matching.Signatures `json:"-"` //do not unmarshal to json on save
}

func NewSession

func NewSession() (*Session, error)

func (*Session) AddFinding

func (s *Session) AddFinding(finding *matching.Finding)

func (*Session) AddRepository

func (s *Session) AddRepository(repository *common.Repository)

func (*Session) AddTarget

func (s *Session) AddTarget(target *common.Owner)

func (*Session) Finish

func (s *Session) Finish()

func (*Session) InitAPIClient

func (s *Session) InitAPIClient()

func (*Session) InitAccessToken

func (s *Session) InitAccessToken()

func (*Session) InitLogger

func (s *Session) InitLogger()

func (*Session) InitRouter

func (s *Session) InitRouter()

func (*Session) InitSignatures

func (s *Session) InitSignatures()

func (*Session) InitStats

func (s *Session) InitStats()

func (*Session) InitThreads

func (s *Session) InitThreads()

func (*Session) Initialize

func (s *Session) Initialize()

func (*Session) SaveToFile

func (s *Session) SaveToFile(location string) error

func (*Session) ValidateTokenConfig

func (s *Session) ValidateTokenConfig()

type Stats

type Stats struct {
	sync.Mutex

	StartedAt    time.Time
	FinishedAt   time.Time
	Status       string
	Progress     float64
	Targets      int
	Repositories int
	Commits      int
	Files        int
	Findings     int
}

func (*Stats) IncrementCommits

func (s *Stats) IncrementCommits()

func (*Stats) IncrementFiles

func (s *Stats) IncrementFiles()

func (*Stats) IncrementFindings

func (s *Stats) IncrementFindings()

func (*Stats) IncrementRepositories

func (s *Stats) IncrementRepositories()

func (*Stats) IncrementTargets

func (s *Stats) IncrementTargets()

func (*Stats) UpdateProgress

func (s *Stats) UpdateProgress(current int, total int)

Jump to

Keyboard shortcuts

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