gotools/godoc/server.go

type handlerServer

func (s *handlerServer) registerWithMux(mux *http.ServeMux) {}

// GetPageInfo returns the PageInfo for a package directory abspath. If the
// parameter genAST is set, an AST containing only the package exports is
// computed (PageInfo.PAst), otherwise package documentation (PageInfo.Doc)
// is extracted from the AST. If there is no corresponding package in the
// directory, PageInfo.PAst and PageInfo.PDoc are nil. If there are no sub-
// directories, PageInfo.Dirs is nil. If an error occurred, PageInfo.Err is
// set to the respective error but the error is not logged.
func (h *handlerServer) GetPageInfo(abspath, relpath string, mode PageInfoMode, goos, goarch string) *PageInfo {}

func (h *handlerServer) includePath(path string, mode PageInfoMode) (r bool) {}

type funcsByName

func (s funcsByName) Len() int           {}

func (s funcsByName) Swap(i, j int)      {}

func (s funcsByName) Less(i, j int) bool {}

func (h *handlerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {}

func (h *handlerServer) corpusInitialized() bool {}

type PageInfoMode

const PageInfoModeQueryString

const NoFiltering

const AllMethods

const ShowSource

const FlatDir

const NoTypeAssoc

var modeNames

// generate a query string for persisting PageInfoMode between pages.
func modeQueryString(mode PageInfoMode) string {}

// alphabetically sorted names of active flags for a PageInfoMode.
func (m PageInfoMode) names() []string {}

// GetPageInfoMode computes the PageInfoMode flags by analyzing the request
// URL form value "m". It is value is a comma-separated list of mode names
// as defined by modeNames (e.g.: m=src,text).
func (p *Presentation) GetPageInfoMode(r *http.Request) PageInfoMode {}

// poorMansImporter returns a (dummy) package object named
// by the last path component of the provided package path
// (as is the convention for packages). This is sufficient
// to resolve package identifiers without doing an actual
// import. It never returns an error.
func poorMansImporter(imports map[string]*ast.Object, path string) (*ast.Object, error) {}

// globalNames returns a set of the names declared by all package-level
// declarations. Method names are returned in the form Receiver_Method.
func globalNames(pkg *ast.Package) map[string]bool {}

// collectExamples collects examples for pkg from testfiles.
func collectExamples(c *Corpus, pkg *ast.Package, testfiles map[string]*ast.File) []*doc.Example {}

// addNames adds the names declared by decl to the names set.
// Method names are added in the form ReceiverTypeName_Method.
func addNames(names map[string]bool, decl ast.Decl) {}

// packageExports is a local implementation of ast.PackageExports
// which correctly updates each package file's comment list.
// (The ast.PackageExports signature is frozen, hence the local
// implementation).
func packageExports(fset *token.FileSet, pkg *ast.Package) {}

func applyTemplate(t *template.Template, name string, data interface{}

type writerCapturesErr

func (w *writerCapturesErr) Write(p []byte) (int, error) {}

// applyTemplateToResponseWriter uses an http.ResponseWriter as the io.Writer
// for the call to template.Execute.  It uses an io.Writer wrapper to capture
// errors from the underlying http.ResponseWriter.  Errors are logged only when
// they come from the template processing and not the Writer; this avoid
// polluting log files with error messages due to networking issues, such as
// client disconnects and http HEAD protocol violations.
func applyTemplateToResponseWriter(rw http.ResponseWriter, t *template.Template, data interface{}

func redirect(w http.ResponseWriter, r *http.Request) (redirected bool) {}

func redirectFile(w http.ResponseWriter, r *http.Request) (redirected bool) {}

func (p *Presentation) serveTextFile(w http.ResponseWriter, r *http.Request, abspath, relpath, title string) {}

// formatGoSource HTML-escapes Go source text and writes it to w,
// decorating it with the specified analysis links.
func formatGoSource(buf *bytes.Buffer, text []byte, links []analysis.Link, pattern string, selection Selection) {}

func (p *Presentation) serveDirectory(w http.ResponseWriter, r *http.Request, abspath, relpath string) {}

func (p *Presentation) ServeHTMLDoc(w http.ResponseWriter, r *http.Request, abspath, relpath string) {}

func (p *Presentation) ServeFile(w http.ResponseWriter, r *http.Request) {}

func (p *Presentation) serveFile(w http.ResponseWriter, r *http.Request) {}

func (p *Presentation) ServeText(w http.ResponseWriter, text []byte) {}

func marshalJSON(x interface{}