ctx

package
v0.0.0-...-acc4708 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Consume(io.Writer, Global) error
}

Consumes an context object, possibly writing output to the Writer Normally, this is an abstraction for a template, but in tests, we use this to collect and validate the context object generated.

func NewConsumer

func NewConsumer(templ *template.Template) Consumer

type Global

type Global interface {
	Title() string
	Description() string
	URL() url.Reverser
	// Used in tests to compare contexts
	Equals(Global) bool
}

Global context

func NewGlobal

func NewGlobal(cfg *config.Global, url url.Reverser) Global

type List

type List interface {
	Global

	Repos() []models.Repo
}

func NewList

func NewList(cfg *config.Global, url url.Reverser, repos []models.Repo) List

type PathComponent

type PathComponent interface {
	Name() string
	FullPath() string
	IsLast() bool
	Equals(PathComponent) bool
}

func NewPath

func NewPath(path string) []PathComponent

type RepoGlobal

type RepoGlobal interface {
	Global

	Repo() models.Repo
	Branch() string
	Branches() []string
}

Originally named Repo, but renamed to RepoGlobal to resolve conflict with the embedded Repo object and the Repo() method in subclasses

func NewRepoGlobal

func NewRepoGlobal(cfg *config.Global, url url.Reverser, repo models.Repo, branch string, branches []string) RepoGlobal

type RepoLog

type RepoLog interface {
	RepoGlobal
}

func NewRepoLog

func NewRepoLog(cfg *config.Global, url url.Reverser, repo models.Repo, branch string, branches []string) RepoLog

type RepoRefs

type RepoRefs interface {
	RepoGlobal
}

func NewRepoRefs

func NewRepoRefs(cfg *config.Global, url url.Reverser, repo models.Repo, branch string, branches []string) RepoRefs

type RepoRoot

type RepoRoot interface {
	RepoTree

	ReadmePlain() string
	ReadmeHTML() template.HTML
}

func NewRepoRoot

func NewRepoRoot(cfg *config.Global, url url.Reverser, repo models.Repo, branch string, branches []string, files []models.RepoFile, readme string, isReadmeHTML bool) RepoRoot

type RepoTree

type RepoTree interface {
	RepoGlobal

	IsRoot() bool
	Dirname() string
	SplitPath() []PathComponent
	Path() string
	IsListing() bool
	IsBinary() bool
	IsImage() bool
	Files() []models.RepoFile
	Blob() string
}

func NewRepoTree

func NewRepoTree(cfg *config.Global, url url.Reverser, repo models.Repo, branch string, branches []string, path string, isListing bool, isBinary bool, isImage bool, files []models.RepoFile, blob string) RepoTree

Jump to

Keyboard shortcuts

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