daemon

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Thanks Gin! https://github.com/gin-gonic/contrib/blob/master/static/example/bindata/example.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func HelmIntroActions

func HelmIntroActions() []daemontypes.Action

func HelmValuesActions

func HelmValuesActions() []daemontypes.Action

func MessageActions

func MessageActions() []daemontypes.Action

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NewHeadedDaemon

func NewHeadedDaemon(
	logger log.Logger,
	v *viper.Viper,
	webUIFactory WebUIBuilder,
	routes OptionalRoutes,
) daemontypes.Daemon

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type ConfigOption

type ConfigOption struct {
	Name       string   `json:"name"`
	Value      string   `json:"value"`
	Data       string   `json:"data"`
	MultiValue []string `json:"multi_value"`
	MultiData  []string `json:"multi_data"`
}
type NavcycleRoutes struct {
	Logger       log.Logger
	TreeLoader   filetree.Loader
	StateManager state.Manager
	StepExecutor V2Executor
	Fs           afero.Afero
	Shutdown     chan interface{}

	StepProgress *daemontypes.ProgressMap

	Messenger      lifecycle.Messenger
	HelmIntro      lifecycle.HelmIntro
	HelmValues     lifecycle.HelmValues
	Kustomizer     lifecycle.Kustomizer
	KustomizeIntro lifecycle.KustomizeIntro
	Renderer       lifecycle.Renderer
	Terraformer    lifecycle.Terraformer
	Planner        planner.Planner
	BuilderBuilder *templates.BuilderBuilder
	Patcher        patch.Patcher
	ConfigRenderer *resolve.APIConfigRenderer
	KubectlApply   lifecycle.KubectlApply

	ConfigSaved        chan interface{}
	TerraformConfirmed chan bool
	CurrentConfig      map[string]interface{}
	PreExecuteFuncMap  map[string]preExecuteFunc

	KubectlConfirmed chan bool

	// This isn't known at injection time, so we have to set in Register
	Release *api.Release
	// contains filtered or unexported fields
}

NavcycleRoutes provide workflow execution with standard browser navigation

func NewV2Router

func NewV2Router(
	logger log.Logger,
	stateManager state.Manager,
	messenger lifecycle.Messenger,
	helmIntro lifecycle.HelmIntro,
	helmValues lifecycle.HelmValues,
	kustomizeIntro lifecycle.KustomizeIntro,
	kustomizer lifecycle.Kustomizer,
	terraformer lifecycle.Terraformer,
	kubectlApply lifecycle.KubectlApply,
	configRenderer *resolve.APIConfigRenderer,
	planners planner.Planner,
	patcher patch.Patcher,
	renderer lifecycle.Renderer,
	treeLoader filetree.Loader,
	builderBuilder *templates.BuilderBuilder,
	fs afero.Afero,
) *NavcycleRoutes
func (d *NavcycleRoutes) Register(group *gin.RouterGroup, release *api.Release)

Register registers routes

type OptionalRoutes

type OptionalRoutes struct {
	dig.In
	V2Router *NavcycleRoutes `optional:"true"`
	V1Router *V1Routes       `optional:"true"`
}

type SaveOverlayRequest added in v0.17.0

type SaveOverlayRequest struct {
	Path       string `json:"path"`
	Contents   string `json:"contents"`
	IsResource bool   `json:"isResource"`
}

type SaveValuesRequest

type SaveValuesRequest struct {
	Values      string `json:"values"`
	ReleaseName string `json:"releaseName"`
	Namespace   string `json:"namespace"`
}

type ShipDaemon

type ShipDaemon struct {
	Logger       log.Logger
	WebUIFactory WebUIBuilder
	Viper        *viper.Viper
	// todo private this
	ExitChan  chan error
	StartOnce sync.Once

	*V1Routes
	*NavcycleRoutes
}

Daemon runs the ship api server.

func (*ShipDaemon) AwaitShutdown

func (d *ShipDaemon) AwaitShutdown() error

func (*ShipDaemon) EnsureStarted

func (d *ShipDaemon) EnsureStarted(ctx context.Context, release *api.Release) chan error

"this is fine"

func (*ShipDaemon) Healthz

func (d *ShipDaemon) Healthz(c *gin.Context)

Healthz returns a 200 with the version if provided

func (*ShipDaemon) Metricz

func (d *ShipDaemon) Metricz(c *gin.Context)

Metricz returns (empty) metrics for this server

func (*ShipDaemon) Serve

func (d *ShipDaemon) Serve(ctx context.Context, release *api.Release) error

Serve starts the server with the given context

type V1Routes

type V1Routes struct {
	Logger         log.Logger
	Fs             afero.Afero
	Viper          *viper.Viper
	UI             cli.Ui
	StateManager   state.Manager
	ConfigRenderer *resolve.APIConfigRenderer
	TreeLoader     filetree.Loader
	Patcher        patch.Patcher
	OpenWebConsole opener

	sync.Mutex

	ConfigSaved   chan interface{}
	CurrentConfig map[string]interface{}

	MessageConfirmed chan string

	TerraformConfirmed chan bool

	KustomizeSaved chan interface{}
	UnforkSaved    chan interface{}
	Release        *api.Release
	// contains filtered or unexported fields
}

func NewV1Router

func NewV1Router(
	v *viper.Viper,
	renderer *resolve.APIConfigRenderer,
	stateManager state.Manager,
	logger log.Logger,
	ui cli.Ui,
	fs afero.Afero,
	treeLoader filetree.Loader,
	patcher patch.Patcher,
) *V1Routes

func (*V1Routes) AllStepsDone

func (d *V1Routes) AllStepsDone(ctx context.Context)

func (*V1Routes) CleanPreviousStep

func (d *V1Routes) CleanPreviousStep()

func (*V1Routes) ClearProgress

func (d *V1Routes) ClearProgress()

func (*V1Routes) ConfigSavedChan

func (d *V1Routes) ConfigSavedChan() chan interface{}

func (*V1Routes) GetCurrentConfig

func (d *V1Routes) GetCurrentConfig() (map[string]interface{}, error)

func (*V1Routes) KustomizeSavedChan

func (d *V1Routes) KustomizeSavedChan() chan interface{}

func (*V1Routes) MessageConfirmedChan

func (d *V1Routes) MessageConfirmedChan() chan string

func (*V1Routes) PushHelmIntroStep

func (d *V1Routes) PushHelmIntroStep(
	ctx context.Context,
	step daemontypes.HelmIntro,
	actions []daemontypes.Action,
)

func (*V1Routes) PushHelmValuesStep

func (d *V1Routes) PushHelmValuesStep(
	ctx context.Context,
	step daemontypes.HelmValues,
	actions []daemontypes.Action,
)

func (*V1Routes) PushKustomizeStep

func (d *V1Routes) PushKustomizeStep(ctx context.Context, kustomize daemontypes.Kustomize)

func (*V1Routes) PushMessageStep

func (d *V1Routes) PushMessageStep(
	ctx context.Context,
	step daemontypes.Message,
	actions []daemontypes.Action,
)

func (*V1Routes) PushRenderStep

func (d *V1Routes) PushRenderStep(
	ctx context.Context,
	step daemontypes.Render,
)

func (*V1Routes) PushStreamStep

func (d *V1Routes) PushStreamStep(
	ctx context.Context,
	msgs <-chan daemontypes.Message,
)

func (*V1Routes) PushUnforkStep added in v0.27.0

func (d *V1Routes) PushUnforkStep(ctx context.Context, unfork daemontypes.Unfork)

func (*V1Routes) Register

func (d *V1Routes) Register(g *gin.RouterGroup, release *api.Release)

func (*V1Routes) SetProgress

func (d *V1Routes) SetProgress(p daemontypes.Progress)

func (*V1Routes) SetStepName

func (d *V1Routes) SetStepName(ctx context.Context, stepName string)

func (*V1Routes) TerraformConfirmedChan

func (d *V1Routes) TerraformConfirmedChan() chan bool

func (*V1Routes) UnforkSavedChan added in v0.27.0

func (d *V1Routes) UnforkSavedChan() chan interface{}

type V2Executor

type V2Executor func(d *NavcycleRoutes, step api.Step) error

type WebUIBuilder

type WebUIBuilder func(root string) *binaryFileSystem

func WebUIFactoryFactory

func WebUIFactoryFactory(
	logger log.Logger,
) WebUIBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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