watch

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserRequestedWatchExit = fmt.Errorf("safely exiting from filesystem watch based on user request")

ErrUserRequestedWatchExit is returned when the user stops the watch loop

Functions

func DevfileWatchAndPush

func DevfileWatchAndPush(out io.Writer, parameters WatchParameters) error

DevfileWatchAndPush calls out to the WatchAndPush function. As an occlient instance is not needed for devfile components, it sets it to nil

func WatchAndPush

func WatchAndPush(client *occlient.Client, out io.Writer, parameters WatchParameters) error

WatchAndPush watches path, if something changes in that path it calls PushLocal ignores .git/* by default inspired by https://github.com/openshift/origin/blob/e785f76194c57bd0e1674c2f2776333e1e0e4e78/pkg/oc/cli/cmd/rsync/rsync.go#L257 Parameters:

client: occlient instance
out: io Writer instance
parameters: WatchParameters

Types

type WatchParameters

type WatchParameters struct {
	// Name of component that is to be watched
	ComponentName string
	// Name of application, the component is part of
	ApplicationName string
	// The path to the source of component(local or binary)
	Path string
	// List/Slice of files/folders in component source, the updates to which need not be pushed to component deployed pod
	FileIgnores []string
	// Custom function that can be used to push detected changes to remote pod. For more info about what each of the parameters to this function, please refer, pkg/component/component.go#PushLocal
	WatchHandler func(*occlient.Client, string, string, string, io.Writer, []string, []string, bool, []string, bool) error
	// Custom function that can be used to push detected changes to remote devfile pod. For more info about what each of the parameters to this function, please refer, pkg/devfile/adapters/interface.go#PlatformAdapter
	DevfileWatchHandler func(common.PushParameters) error
	// This is a channel added to signal readiness of the watch command to the external channel listeners
	StartChan chan bool
	// This is a channel added to terminate the watch command gracefully without passing SIGINT. "Stop" message on this channel terminates WatchAndPush function
	ExtChan chan bool
	// Interval of time before pushing changes to remote(component) pod
	PushDiffDelay int
	// Parameter whether or not to show build logs
	Show bool
	// EnvSpecificInfo contains infomation of env.yaml file
	EnvSpecificInfo *envinfo.EnvSpecificInfo
	// DevfileInitCmd takes the init command through the command line and overwrites devfile init command
	DevfileInitCmd string
	// DevfileBuildCmd takes the build command through the command line and overwrites devfile build command
	DevfileBuildCmd string
	// DevfileRunCmd takes the run command through the command line and overwrites devfile run command
	DevfileRunCmd string
}

WatchParameters is designed to hold the controllables and attributes that the watch function works on

Jump to

Keyboard shortcuts

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