get

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFetcher = NewFetcherImpl()
)

Functions

func CreateAndWriteExecConfigForTask

func CreateAndWriteExecConfigForTask(task *admin.Task, fileName string) error

func CreateAndWriteExecConfigForWorkflow

func CreateAndWriteExecConfigForWorkflow(wlp *admin.LaunchPlan, fileName string) error

func CreateGetCommand

func CreateGetCommand() *cobra.Command

CreateGetCommand will return get command

func ExecutionToProtoMessages

func ExecutionToProtoMessages(l []*admin.Execution) []proto.Message

func FetchAllVerOfLP

func FetchAllVerOfLP(ctx context.Context, lpName string, project string, domain string, cmdCtx cmdCore.CommandContext) ([]*admin.LaunchPlan, error)

func FetchAllVerOfTask

func FetchAllVerOfTask(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) ([]*admin.Task, error)

func FetchLPForName

func FetchLPForName(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) ([]*admin.LaunchPlan, error)

Reads the launchplan config to drive fetching the correct launch plans.

func FetchLPLatestVersion

func FetchLPLatestVersion(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.LaunchPlan, error)

func FetchTaskForName

func FetchTaskForName(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) ([]*admin.Task, error)

Reads the task config to drive fetching the correct tasks.

func FetchTaskLatestVersion

func FetchTaskLatestVersion(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.Task, error)

func FetchTaskVersion

func FetchTaskVersion(ctx context.Context, name string, version string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.Task, error)

func LaunchplanToProtoMessages

func LaunchplanToProtoMessages(l []*admin.LaunchPlan) []proto.Message

func NewFetcherImpl added in v0.1.6

func NewFetcherImpl() interfaces.Fetcher

func ParamMapForTask

func ParamMapForTask(task *admin.Task) (map[string]interface{}, error)

func ParamMapForWorkflow

func ParamMapForWorkflow(lp *admin.LaunchPlan) (map[string]interface{}, error)

func ProjectToProtoMessages

func ProjectToProtoMessages(l []*admin.Project) []proto.Message

func TaskInputs

func TaskInputs(task *admin.Task) map[string]*core.Variable

func TaskToProtoMessages

func TaskToProtoMessages(l []*admin.Task) []proto.Message

func WorkflowParams

func WorkflowParams(lp *admin.LaunchPlan) map[string]*core.Parameter

func WorkflowToProtoMessages

func WorkflowToProtoMessages(l []*admin.Workflow) []proto.Message

func WriteExecConfigToFile

func WriteExecConfigToFile(executionConfig ExecutionConfig, fileName string) error

Types

type ExecutionConfig

type ExecutionConfig struct {
	TargetDomain    string                 `json:"targetDomain"`
	TargetProject   string                 `json:"targetProject"`
	KubeServiceAcct string                 `json:"kubeServiceAcct"`
	IamRoleARN      string                 `json:"iamRoleARN"`
	Workflow        string                 `json:"workflow,omitempty"`
	Task            string                 `json:"task,omitempty"`
	Version         string                 `json:"version"`
	Inputs          map[string]interface{} `json:"inputs"`
}

ExecutionConfig is duplicated struct from create with the same structure. This is to avoid the circular dependency. TODO : replace this with a cleaner design

type FetcherImpl added in v0.1.6

type FetcherImpl struct {
}

func (FetcherImpl) FetchExecution added in v0.1.6

func (f FetcherImpl) FetchExecution(ctx context.Context, name string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.Execution, error)

func (FetcherImpl) FetchLPVersion added in v0.1.6

func (f FetcherImpl) FetchLPVersion(ctx context.Context, name string, version string, project string, domain string, cmdCtx cmdCore.CommandContext) (*admin.LaunchPlan, error)

type LaunchPlanConfig

type LaunchPlanConfig struct {
	ExecFile string `json:"execFile" pflag:",execution file name to be used for generating execution spec of a single launchplan."`
	Version  string `json:"version" pflag:",version of the launchplan to be fetched."`
	Latest   bool   `json:"latest" pflag:", flag to indicate to fetch the latest version, version flag will be ignored in this case"`
}

LaunchPlanConfig

func (LaunchPlanConfig) GetPFlagSet

func (cfg LaunchPlanConfig) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in LaunchPlanConfig and its nested types. The format of the flags is json-name.json-sub-name... etc.

type TaskConfig

type TaskConfig struct {
	ExecFile string `json:"execFile" pflag:",execution file name to be used for generating execution spec of a single task."`
	Version  string `json:"version" pflag:",version of the task to be fetched."`
	Latest   bool   `json:"latest" pflag:", flag to indicate to fetch the latest version, version flag will be ignored in this case"`
}

FilesConfig

func (TaskConfig) GetPFlagSet

func (cfg TaskConfig) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in TaskConfig and its nested types. The format of the flags is json-name.json-sub-name... etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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