bootstrap

package
v0.0.0-...-8e6cb86 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockReadStdin

func BlockReadStdin(args []string) error

func BootScheduler

func BootScheduler(ctx context.Context, bs Bootstrap) (*scheduler.Scheduler, error)

func BuildConfig

func BuildConfig(root *hroot.State, profiles []string) (*config.Config, error)

func GenerateRRs

func GenerateRRs(ctx context.Context, e *scheduler.Scheduler, m specs.Matcher, targs []string, opts targetrun.RequestOpts, plain, gen bool) (targetrun.Requests, error)

func Getwd

func Getwd() (string, error)

func HasStdin

func HasStdin(args []string) bool

func InstallTools

func InstallTools(ctx context.Context, root *hroot.State, graph *graph.State, version string) error

func ParseTargetAddrsAndArgs

func ParseTargetAddrsAndArgs(args []string, stdin bool) (specs.Matcher, []string, error)

func PrintHumanError

func PrintHumanError(err error)

func PrintTargetOutputContent

func PrintTargetOutputContent(target *lcache.Target, output string) error

func PrintTargetOutputPaths

func PrintTargetOutputPaths(target *lcache.Target, output string) error

func Query

func Query(ctx context.Context, e *scheduler.Scheduler, m specs.Matcher, plain, gen bool) ([]specs.Target, error)

func QueryFunctions

func QueryFunctions(
	root *hroot.State,
	localCache *lcache.LocalCacheState,
	g *graph.State,
	t *graph.Target,
) map[string]exprs.Func

func Run

func Run(ctx context.Context, e *scheduler.Scheduler, rrs targetrun.Requests, runopts RunOpts, inlineSingle bool) error

func RunAllGen

func RunAllGen(ctx context.Context, e *scheduler.Scheduler, plain bool) error

func RunGen

func RunGen(ctx context.Context, e *scheduler.Scheduler, plain bool, filterFactory func() (func(gent *graph.Target) bool, error)) error

func RunMode

func RunMode(ctx context.Context, e *scheduler.Scheduler, rrs targetrun.Requests, runopts RunOpts, inlineSingle bool, mode string, iocfg sandbox.IOConfig) error

Types

type BaseBootstrap

type BaseBootstrap struct {
	Cwd    string
	Root   *hroot.State
	Config *config.Config
}

func BootBase

func BootBase(ctx context.Context, opts BootOpts) (BaseBootstrap, error)

type BoolStr

type BoolStr struct {
	Bool bool
	Str  string
}

type BootOpts

type BootOpts struct {
	Profiles              []string
	Workers               int
	Params                map[string]string
	Summary               bool
	JaegerEndpoint        string
	DisableCloudTelemetry bool
	Pool                  *worker.Pool

	PostBootBase func(bs BaseBootstrap) error

	FlowID string
}

type Bootstrap

type Bootstrap struct {
	BaseBootstrap
	Finalizers        *finalizers.Finalizers
	Observability     *observability.Observability
	Cloud             Cloud
	Summary           *obsummary.Summary
	Pool              *worker.Pool
	Packages          *packages.Registry
	BuildFiles        *buildfiles.State
	Graph             *graph.State
	PlatformProviders []platform.PlatformProvider
}

func Boot

func Boot(ctx context.Context, opts BootOpts) (Bootstrap, error)

type Cloud

type Cloud struct {
	Root       *hroot.State
	Config     *config.Config
	Client     *cloudclient.HephClient
	AuthClient *cloudclient.HephClient
	Hook       *obhephcloud.Hook
}

func (Cloud) DeleteCloudAuthData

func (c Cloud) DeleteCloudAuthData() error

func (Cloud) GetAuthData

func (c Cloud) GetAuthData() (*CloudAuthData, error)

func (Cloud) GetCurrentFlowDetails

func (c Cloud) GetCurrentFlowDetails(ctx context.Context) (FlowDetails, error)

func (Cloud) StartFlow

func (c Cloud) StartFlow(ctx context.Context, name string, metas map[string]string) error

func (Cloud) StopCurrentFlow

func (c Cloud) StopCurrentFlow(ctx context.Context) error

func (Cloud) StoreCloudAuthData

func (c Cloud) StoreCloudAuthData(data CloudAuthData) error

type CloudAuthData

type CloudAuthData struct {
	Token     string
	UserID    string
	UserEmail string
}

type ErrorWithExitCode

type ErrorWithExitCode struct {
	Err      error
	ExitCode int
}

func (ErrorWithExitCode) Error

func (e ErrorWithExitCode) Error() string

func (ErrorWithExitCode) Unwrap

func (e ErrorWithExitCode) Unwrap() error

type FlowDetails

type FlowDetails struct {
	ID  string
	URL string
}

type RunOpts

type RunOpts struct {
	NoInline    bool    // Run all targets as a background job
	Plain       bool    // Disable TUI
	PrintOutput BoolStr // Print output paths
	CatOutput   BoolStr // Print output content
}

type SchedulerBootstrap

type SchedulerBootstrap struct {
	Bootstrap
	Scheduler *scheduler.Scheduler
}

func BootWithScheduler

func BootWithScheduler(ctx context.Context, opts BootOpts) (SchedulerBootstrap, error)

Jump to

Keyboard shortcuts

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