core

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCA

func CreateCA() ([]byte, []byte, error)

CreateCA returns a Certificate Authority and its private key

func TLSConfigFromCA

func TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *goproxy.ProxyCtx) (*tls.Config, error)

TLSConfigFromCA returns a TLS configuration with a custom CA

Types

type BroxySettings

type BroxySettings struct {
	CACertificate []byte `xml:"CACert"`
	CAPrivateKey  []byte `xml:"CAPvt"`
}

Config represents the global configuration

func LoadGlobalSettings

func LoadGlobalSettings(path string) *BroxySettings

LoadGlobalSettings loads the global settings

type ControllerModule

type ControllerModule interface {
	ExecCommand(string, ...interface{})
	GetModule() Module
	GetGui() GuiModule
}

ControllerModule interface

type GlobalSettings

type GlobalSettings struct {
	GZipDecode bool
}

type GuiModule

type GuiModule interface {
	GetModuleGui() interface{}
	GetSettings() interface{}
	Title() string
}

GuiModule interface

type Log

type Log struct {
	Type       string
	ModuleName string
	Time       string
	Message    string
}

Log represents a log message

func (*Log) ToString

func (l *Log) ToString() string

ToString prints a string representation of a log message

type MainGui

type MainGui interface {
	AddGuiModule(GuiModule)
	InitWith(*Session)
	ShowErrorMessage(string)
}

type Module

type Module interface {
	Name() string
	Description() string
	Status() bool
	Start() error
	Stop() error
}

Module interface

type Session

type Session struct {
	Controllers []ControllerModule

	Logs     []Log
	LogEvent chan Log

	MainGui           MainGui
	PersistentProject *project.PersistentProject

	Settings       *BroxySettings
	GlobalSettings *GlobalSettings
}

Session represents a running session in Broxy with a GUI and loaded modules

func NewSession

func NewSession(cfg *BroxySettings, p *project.PersistentProject, gui MainGui) *Session

NewSession creates a new session

func (*Session) Debug

func (s *Session) Debug(mod string, message string)

Debug logs a debug information messasge in the current session

func (*Session) Err

func (s *Session) Err(mod string, message string)

Err logs an error information message in the current session

func (*Session) Exec

func (s *Session) Exec(c string, f string, a ...interface{})

Exec executes, for a given module m, a function f with parameters a

func (*Session) Info

func (s *Session) Info(mod string, message string)

Info logs an information message in the current session

func (*Session) LoadModule

func (s *Session) LoadModule(c ControllerModule)

LoadModule loads a module in the current session

func (*Session) ShowErrorMessage

func (s *Session) ShowErrorMessage(message string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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