app

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package app contains types to run the app.

Index

Constants

View Source
const (
	// DefaultListenAddress is the default listen address.
	DefaultListenAddress = ":3333"

	// DefaultJobConcurrency is the default concurrency of the job manager.
	DefaultJobConcurrency = 2

	// DefaultLogLevel is the default log level.
	DefaultLogLevel = models.LogLevelInfo

	// DefaultLogCap is the default capacity of the logger.
	DefaultLogCap = 10000

	// DefaultPubSubHistoryCap is the default capacity of the PubSub history.
	DefaultPubSubHistoryCap = 1000

	// DefaultPeriodicJobsInterval is the default periodic jobs interval.
	DefaultPeriodicJobsInterval = time.Minute

	// DefaultGracefulShutdownTimeout is the default graceful shutdown timeout.
	DefaultGracefulShutdownTimeout = 20 * time.Second

	// DefaultOpenBrowser is whether to open the user interface in a browser by default.
	DefaultOpenBrowser = true

	// DefaultEnableApolloTracing is whether to enable Apollo tracing by default.
	DefaultEnableApolloTracing = false

	// DefaultEnableSignalHandling is whether to enable signal handling by default.
	DefaultEnableSignalHandling = true
)

Variables

View Source
var (
	// DefaultSettingsFile is the default settings file.
	DefaultSettingsFile = "settings.yml"

	// DefaultSourcesFile is the default sources file.
	DefaultSourcesFile = "sources.yml"

	// DefaultKeysFile is the default keys file.
	DefaultKeysFile = "keys.yml"

	// DefaultGitSourcesDirectory is the default Git sources directory.
	DefaultGitSourcesDirectory = "git-sources"

	// DefaultWorkspacesDirectory is the default workspace directory.
	DefaultWorkspacesDirectory = "workspaces"

	// DefaultCacheDirectory is the default cache directory.
	DefaultCacheDirectory = "cache"
)

Functions

This section is empty.

Types

type App

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

App contains data about the app.

func New

func New(opts ...Opt) *App

New creates a new App.

func (*App) Start

func (a *App) Start(ctx context.Context) error

Start starts the app. It blocks until an error occurs or the app exits.

type Opt

type Opt func(*App)

Opt represents an app option.

func OptCacheDirectory added in v0.1.5

func OptCacheDirectory(dir string) Opt

OptCacheDirectory sets the directory for the cache.

func OptEnableApolloTracing added in v0.1.5

func OptEnableApolloTracing(enable bool) Opt

OptEnableApolloTracing tells the app whether to enable the Apollo tracing middleware.

func OptEnableSignalHandling added in v0.1.5

func OptEnableSignalHandling(enable bool) Opt

OptEnableSignalHandling tells the app whether to handle exit signals.

func OptGitSourcesDirectory added in v0.2.0

func OptGitSourcesDirectory(dir string) Opt

OptGitSourcesDirectory sets the directory for Git sources.

func OptGracefulShutdownTimeout

func OptGracefulShutdownTimeout(timeout time.Duration) Opt

OptGracefulShutdownTimeout sets the maximum duration for a graceful shutdown.

func OptJobConcurrency

func OptJobConcurrency(concurrency int) Opt

OptJobConcurrency sets the concurrency of the job manager.

func OptKeysFile added in v0.3.0

func OptKeysFile(filename string) Opt

OptKeysFile sets the keys file.

func OptListenAddress

func OptListenAddress(address string) Opt

OptListenAddress sets the listen address.

func OptLogCap

func OptLogCap(cap int) Opt

OptLogCap sets the capacity of the logger.

func OptLogLevel

func OptLogLevel(level models.LogLevel) Opt

OptLogLevel sets the minimum level for log messages.

func OptOpenBrowser added in v0.1.5

func OptOpenBrowser(open bool) Opt

OptOpenBrowser tells the app whether to open the user interface in a browser.

func OptPeriodicJobsInterval added in v0.2.3

func OptPeriodicJobsInterval(interval time.Duration) Opt

OptPeriodicJobsInterval sets the time to wait between periodic jobs.

func OptPubSubHistoryCap added in v0.2.2

func OptPubSubHistoryCap(cap int) Opt

OptPubSubHistoryCap sets the capacity of the PubSub history cap.

func OptSourcesFile added in v0.2.0

func OptSourcesFile(filename string) Opt

OptSourcesFile sets the sources file.

func OptUI

func OptUI(fs http.FileSystem) Opt

OptUI sets the file system for the UI.

func OptWorkspacesDirectory added in v0.1.5

func OptWorkspacesDirectory(dir string) Opt

OptWorkspacesDirectory sets the directory for workspaces.

Jump to

Keyboard shortcuts

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