plex

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*Teardown

	// version is the application version.
	Version string

	LiveConfigDB config.DB

	Broker *bus.Broker

	Watcher *notify.Watcher

	Sources *Sources

	Frontend *frontend.Frontend
	// contains filtered or unexported fields
}

func NewApp

func NewApp(version string, livePath string, frontendPath string) *App

func (*App) Close

func (app *App) Close() error

func (*App) HasMultiVersionsSupport

func (app *App) HasMultiVersionsSupport() bool

func (*App) Open

func (app *App) Open() error

func (*App) OpenVersions

func (app *App) OpenVersions(ctx context.Context) error

type CleanupFunc

type CleanupFunc func() error

type Source

type Source struct {
	*Teardown

	// Name identifies the source, usually this is the name of the
	// version the source belongs to.
	Name string

	// Path is the absolute path to the DDT, this might be a subpath
	// of Repo.Path, when the DDT is nested inside a repository.
	// Optional when a completeFn is provided.
	Path string

	// Broker is the Source-specific broker.
	Broker *bus.Broker

	// ConfigDB is the central configuration and managed from the outside.
	ConfigDB config.DB

	Tree *ddt.Tree

	Search *search.Search

	MetaDB meta.DB

	AuthorDB author.DB

	// Repo, optional.
	Repo *vcs.Repo

	// Watcher watches the Path for changes, optional.
	Watcher *notify.Watcher
	// contains filtered or unexported fields
}

func NewLazySource

func NewLazySource(name string, completeFn sourceCompleteFunc, c config.DB) (*Source, error)

func NewSource

func NewSource(name string, path string, c config.DB) (*Source, error)

NewSource initializes a new source and Open()s it to ready it.

func (*Source) CloneFrom

func (s *Source) CloneFrom(source string, refn plumbing.ReferenceName) (string, *git.Repository, error)

CloneFrom copies the source repository by cloning it into a temporary directory.

func (*Source) Close

func (s *Source) Close() error

func (*Source) Complete

func (s *Source) Complete() error

func (*Source) HasMultiVersionsSupport

func (s *Source) HasMultiVersionsSupport() bool

func (*Source) IsComplete

func (s *Source) IsComplete() bool

func (*Source) Open

func (s *Source) Open(gr *git.Repository) error

Open continues the initialization of the struct. When an optinal existing git.Repository is provided it will be used instead of initialization a new one using path information of the struct.

func (*Source) ReverseConnectBroker

func (s *Source) ReverseConnectBroker(b *bus.Broker) chan bool

ReverseConnectBroker connects the internal broker to the provided one, essentially pushing all internal messages of this source out to the external broker.

func (*Source) String

func (s *Source) String() string

func (*Source) UpdateFromUpstream

func (s *Source) UpdateFromUpstream() error

UpdateFromUpstream updates the source repo from the one it was cloned. For the live source, this might be a remote repository.

func (*Source) Versions

func (s *Source) Versions() (*vcs.Versions, error)

Versions retrieves versions from Repo.

type Sources

type Sources struct {
	*Teardown
	// contains filtered or unexported fields
}

func NewSources

func NewSources(cdb config.DB) (*Sources, error)

func (*Sources) Add

func (ss *Sources) Add(name string, path string) (*Source, error)

func (*Sources) AddLazy

func (ss *Sources) AddLazy(name string, completeFn sourceCompleteFunc) (*Source, error)

func (*Sources) All

func (ss *Sources) All() []*Source

func (*Sources) Close

func (ss *Sources) Close() error

func (*Sources) ForEach

func (ss *Sources) ForEach(fn func(*Source) error) error

func (*Sources) Get

func (ss *Sources) Get(name string) (bool, *Source, error)

func (*Sources) Has

func (ss *Sources) Has(name string) bool

func (*Sources) MustGet

func (ss *Sources) MustGet(name string) (s *Source, err error)

func (*Sources) Names

func (ss *Sources) Names() []string

func (*Sources) Open

func (ss *Sources) Open() error

func (*Sources) Primary

func (ss *Sources) Primary() (bool, *Source, error)

func (*Sources) SelectPrimary

func (ss *Sources) SelectPrimary(name string) error

func (*Sources) WhitelistedNames

func (ss *Sources) WhitelistedNames() []string

type Teardown

type Teardown struct {
	Scope string
	// contains filtered or unexported fields
}

Teardown stacks functions for teardown.

func (*Teardown) AddAsyncFunc

func (td *Teardown) AddAsyncFunc(fn CleanupFunc)

func (*Teardown) AddCancelFunc

func (td *Teardown) AddCancelFunc(fn context.CancelFunc)

func (*Teardown) AddChan

func (td *Teardown) AddChan(ch chan<- bool)

func (*Teardown) AddFunc

func (td *Teardown) AddFunc(fn CleanupFunc)

func (*Teardown) Close

func (td *Teardown) Close() error

Close runs the teardown funcs in reverse order they have been added.

func (*Teardown) String

func (td *Teardown) String() string

Jump to

Keyboard shortcuts

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