web

package
v0.0.0-...-f065d94 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EmbeddedFS Keep a reference to the embedded FileSystem holding our static files and templates
	EmbeddedFS http.FileSystem
	// TemplatesFSPrefix the path to template files *inside* the embedded FileSystem
	TemplatesFSPrefix = "/templates/"
	// TemplateFiles the list of template files to look for inside the embedded FileSystem
	TemplateFiles = [...]string{
		"footer.html", "header.html", "home.html"}
)

Functions

func Logger

func Logger() gin.HandlerFunc

Logger instances a Logger middleware that will write the logs, this is a slightly different version of the built-in gin Logger()

func LoggerWithWriter

func LoggerWithWriter(out io.Writer, notlogged ...string) gin.HandlerFunc

LoggerWithWriter instance a Logger middleware with the specified writter buffer. Example: os.Stdout, a file opened in write mode, a socket...

func StartWebInterface

func StartWebInterface(port uint, debug bool)

StartWebInterface -

Types

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Credentials holds the json payload and for the login username and password

type JsonPayload

type JsonPayload struct {
	CrawlID  uint64 `json:"crawlID,string"`
	Mode     string `json:"mode"`
	Filter   string `json:"filter"`
	Order    string `json:"order"`
	Resume   bool   `json:"resume"`
	Details  bool   `json:"details"`
	Target   string `json:"target"`
	Output   string `json:"output"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type ProgressMessage

type ProgressMessage struct {
	ETA                  string `json:"ETA"`
	ChunkSize            uint64 `json:"chunkSize,string"`
	TotalElements        uint64 `json:"totalElements,string"`
	DoneElements         uint64 `json:"doneElements,string"`
	Mode                 string `json:"mode"`
	TimeoutsCount        int    `json:"timoutsCount,string"`
	ErrorsCount          int    `json:"errorsCount,string"`
	ProgressPercentage   string `json:"progressPercentage"`
	OutputFilename       string `json:"outputFilename"`
	LogMessage           string `json:"logMessage"`
	IsIngTargetMode      bool   `json:"isTargetMode"`
	TotalIDsCount        int    `json:"totalIDsCount"`
	CurrentIDOrderNumber int    `json:"currentIDOrderNumber"`
	Error                string `json:"error"`
}

type WebDownloader

type WebDownloader struct {
	IsDone        bool
	IsStopped     bool
	APIDownloader *downloader.Downloader
	JSONPayload   JsonPayload
	WebSocket     *melody.Melody
	// contains filtered or unexported fields
}

func NewWebDownloader

func NewWebDownloader() *WebDownloader

NewWebDownloader -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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