console

package
v0.0.0-...-3fff119 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2015 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package console implements a web console for Walker in Go

Index

Constants

View Source
const DefaultPageWindowLength = 15

S E S S I O N S

Variables

View Source
var PageWindowLengthChoices = []int{10, 15, 25, 35, 50, 75, 100, 150, 250}

PageWindowLengthChoices lists the window length's listed on /list and /links page

View Source
var Render *render.Render

Render is the global render.Render object used by all controllers

Functions

func AddLinkIndexController

func AddLinkIndexController(w http.ResponseWriter, req *http.Request)

AddLinkIndexController returns pages rooted at /add

func BuildRender

func BuildRender()

BuildRender builds Render

func ChangePriorityController

func ChangePriorityController(w http.ResponseWriter, req *http.Request)

ChangePriorityController handles web-based priority changes.

func ExcludeToggleController

func ExcludeToggleController(w http.ResponseWriter, req *http.Request)

ExcludeToggleController handles web based exclusions

func FilterLinksController

func FilterLinksController(w http.ResponseWriter, req *http.Request)

FilterLinksController returns pages rooted at /filterLinks

func FindDomainController

func FindDomainController(w http.ResponseWriter, req *http.Request)

FindDomainController returns pages rooted at /find

func FindLinksController

func FindLinksController(w http.ResponseWriter, req *http.Request)

FindLinksController returns pages rooted at /findLinks

func HomeController

func HomeController(w http.ResponseWriter, req *http.Request)

HomeController returns / page

func LinksController

func LinksController(w http.ResponseWriter, req *http.Request)

LinksController returns pages rooted at /links IMPL NOTE: Why does linksController encode the seedURL in base32, rather than URL encode it? The reason is that various components along the way are tripping on the appearance of the seedURL argument. First, it appears that the browser is unencoding the link BEFORE submitting it to the server. That looks like a problem with the browser to me. But in addition, the server appears to be choking on the url-encoded text as well. For example if the url encoded seedURL ends with .html, it appears that this is causing the server to throw a 301. Unknown why that is. But the net effect is that, if I totally disguise the link in base32, everything works.

func LinksHistoricalController

func LinksHistoricalController(w http.ResponseWriter, req *http.Request)

LinksHistoricalController returns pages rooted at /links

func ListDomainsController

func ListDomainsController(w http.ResponseWriter, req *http.Request)

ListDomainsController returns pages rooted at /list

func RestAdd

func RestAdd(w http.ResponseWriter, req *http.Request)

RestAdd manages the rest endpoint rooted at /rest/add.

func Run

func Run()

Run will run console until SIGINT is caught

func SpoofData

func SpoofData()

SpoofData populates the ds with spoofed data.

func Start

func Start()

Start the console. NOTE: we only support a single instance of console at a time. You must match all your Start() calls with Stop() calls or else bad things happen.

func Stop

func Stop()

Stop will stop the console from running. Currently unused, but I'm leaving it here for now, as it seems like something one might want to be able to do.

Types

type Route

type Route struct {
	Path       string
	Controller func(w http.ResponseWriter, req *http.Request)
}

Route represents an http endpoint

func RestRoutes

func RestRoutes() []Route

RestRoutes returns all Route's used in the Rest space.

func Routes

func Routes() []Route

Routes returns all the endpoints for console

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session object manages all controller sessions

func GetSession

func GetSession(w http.ResponseWriter, req *http.Request) (*Session, error)

GetSession returns a session object

func (*Session) AddErrorFlash

func (sess *Session) AddErrorFlash(message string)

func (*Session) AddInfoFlash

func (sess *Session) AddInfoFlash(message string)

func (*Session) Flashes

func (sess *Session) Flashes() (infos []string, errors []string)

func (*Session) LinksPageWindowLength

func (sess *Session) LinksPageWindowLength() int

LinksPageWindowLength returns the page length for /links page

func (*Session) ListPageWindowLength

func (sess *Session) ListPageWindowLength() int

ListPageWindowLength returns page length for /list page

func (*Session) SetLinksPageWindowLength

func (sess *Session) SetLinksPageWindowLength(plen int)

func (*Session) SetListPageWindowLength

func (sess *Session) SetListPageWindowLength(plen int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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