app

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Overview

Package app contains types to run the app.

Index

Constants

View Source
const (
	// DefaultConfigFilename is the default filename of the config file.
	DefaultConfigFilename = "groundcontrol.yml"

	// 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

	// DefaultCheckProjectsInterval is the default check projects interval.
	DefaultCheckProjectsInterval = time.Minute

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

Variables

This section is empty.

Functions

func DefaultProjectCachePathGetter

func DefaultProjectCachePathGetter(workspaceSlug, repo, branch string) string

DefaultProjectCachePathGetter is the default ProjectCachePathGetter.

func DefaultProjectPathGetter

func DefaultProjectPathGetter(workspaceSlug, repo, branch string) string

DefaultProjectPathGetter is the default ProjectPathGetter.

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 OptCheckProjectsInterval

func OptCheckProjectsInterval(interval time.Duration) Opt

OptCheckProjectsInterval sets the time to wait between periodic jobs used to check the state of projects.

func OptConfigFilenames

func OptConfigFilenames(filenames ...string) Opt

OptConfigFilenames adds config files. This option can be added multiple times.

func OptDisableSignalHandling

func OptDisableSignalHandling() Opt

OptDisableSignalHandling tells the app not to listen to exit signals.

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 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 OptProjectCachePathGetter

func OptProjectCachePathGetter(getter jobs.ProjectCachePathGetter) Opt

OptProjectCachePathGetter sets the function to resolve the path of a project cache.

func OptProjectPathGetter

func OptProjectPathGetter(getter models.ProjectPathGetter) Opt

OptProjectPathGetter sets the function to resolve the path of a project.

func OptUI

func OptUI(fs http.FileSystem) Opt

OptUI sets the file system for the UI.

Jump to

Keyboard shortcuts

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