javadocr

package module
v0.0.0-...-0ebeaae Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2016 License: MIT Imports: 14 Imported by: 0

README

javadocr

Serve Javadocs out of Maven repositories (example)

Usage

go get github.com/lukegb/javadocr/cmds/javadocr
go build github.com/lukegb/javadocr/cmds/javadocr
./javadocr

Customising

At the moment the command will only serve the SpongeAPI documentation. You can edit this by changing the code. Sorry.

Other things you can't yet customise: the expiry time for SNAPSHOT artifacts. Release artifacts are cached indefinitely but will be expired if memory usage crosses a (yet again, hardcoded) threshold.

It will, by default, serve on port 16080 on all interfaces, but you can set JAVADOCR_LISTEN to a golang-listen string (ala :16080 or 127.0.0.1:8181) to listen elsewhere.

URLs

The URL scheme is:

http://listeningat/mavenversion/

How?

It periodically fetches the available versions of a particular project from a Maven repository. It then allows requests for these versions, at which point it looks up the URL of the javadoc artifact (which must be in the repo), and then serves them.

Why?

This was written for the SpongePowered project to power jd.spongepowered.org.

Documentation

Index

Constants

View Source
const (
	SnapshotExpiryWindow = 1 * time.Minute
	GCInterval           = SnapshotExpiryWindow / 2
	LruCacheSize         = 512 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JavadocCache

type JavadocCache map[maven.Coordinate]*JavadocCached

type JavadocCacheKeys

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

func (*JavadocCacheKeys) Len

func (jck *JavadocCacheKeys) Len() int

func (*JavadocCacheKeys) Less

func (jck *JavadocCacheKeys) Less(i, j int) bool

func (*JavadocCacheKeys) Swap

func (jck *JavadocCacheKeys) Swap(i, j int)

type JavadocCached

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

type JavadocHandler

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

func NewJavadocHandler

func NewJavadocHandler(repository maven.Repository, coordinate maven.Coordinate) (*JavadocHandler, error)

func (*JavadocHandler) AddCompatFor

func (jh *JavadocHandler) AddCompatFor(thing string)

func (*JavadocHandler) ExcludeVersion

func (h *JavadocHandler) ExcludeVersion(v string)

func (*JavadocHandler) IncludeVersion

func (h *JavadocHandler) IncludeVersion(v string)

func (*JavadocHandler) ServeHTTP

func (h *JavadocHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ZipFile

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

func NewZipFile

func NewZipFile(f *zip.File) (*ZipFile, error)

func (*ZipFile) Close

func (zf *ZipFile) Close() error

func (*ZipFile) IsDir

func (zf *ZipFile) IsDir() bool

func (*ZipFile) ModTime

func (zf *ZipFile) ModTime() time.Time

func (*ZipFile) Mode

func (zf *ZipFile) Mode() os.FileMode

func (*ZipFile) Name

func (zf *ZipFile) Name() string

func (*ZipFile) Read

func (zf *ZipFile) Read(b []byte) (int, error)

func (*ZipFile) Readdir

func (zf *ZipFile) Readdir(n int) ([]os.FileInfo, error)

func (*ZipFile) Seek

func (zf *ZipFile) Seek(offset int64, whence int) (int64, error)

func (*ZipFile) Size

func (zf *ZipFile) Size() int64

func (*ZipFile) Stat

func (zf *ZipFile) Stat() (os.FileInfo, error)

func (*ZipFile) Sys

func (zf *ZipFile) Sys() interface{}

type ZipFileSystem

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

func NewZipFileSystem

func NewZipFileSystem(r *zip.Reader) (*ZipFileSystem, error)

func (*ZipFileSystem) Open

func (fs *ZipFileSystem) Open(name string) (http.File, error)

type ZipFolder

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

func NewZipFolder

func NewZipFolder(name string) *ZipFolder

func (*ZipFolder) Close

func (zf *ZipFolder) Close() error

func (*ZipFolder) IsDir

func (zf *ZipFolder) IsDir() bool

func (*ZipFolder) ModTime

func (zf *ZipFolder) ModTime() time.Time

func (*ZipFolder) Mode

func (zf *ZipFolder) Mode() os.FileMode

func (*ZipFolder) Name

func (zf *ZipFolder) Name() string

func (*ZipFolder) Read

func (zf *ZipFolder) Read(b []byte) (int, error)

func (*ZipFolder) Readdir

func (zf *ZipFolder) Readdir(n int) (fi []os.FileInfo, err error)

func (*ZipFolder) Seek

func (zf *ZipFolder) Seek(n int64, whence int) (int64, error)

func (*ZipFolder) Size

func (zf *ZipFolder) Size() int64

func (*ZipFolder) Stat

func (zf *ZipFolder) Stat() (os.FileInfo, error)

func (*ZipFolder) Sys

func (zf *ZipFolder) Sys() interface{}

type ZipInode

type ZipInode interface{}

Directories

Path Synopsis
cmds

Jump to

Keyboard shortcuts

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