common

package module
v0.0.0-...-9972e98 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	API_HOST_KEY  = "LHC_API_HOST"
	API_PORT_KEY  = "LHC_API_PORT"
	CLIENT_ID_KEY = "LHC_CLIENT_ID"

	CERT_FILE_KEY    = "LHC_CLIENT_CERT"
	KEY_FILE_KEY     = "lHC_CLIENT_KEY"
	CA_CERT_FILE_KEY = "LHC_CA_CERT"

	NUM_WORKER_THREADS_KEY      = "LHW_NUM_WORKER_THREADS"
	TASK_WORKER_VERSION_KEY     = "LHW_TASK_WORKER_VERSION"
	SERVER_CONNECT_LISTENER_KEY = "LHW_SERVER_CONNECT_LISTENER"
	DEFAULT_LISTENER            = "LHW_DEFAULT_LISTENER"
)

Variables

This section is empty.

Functions

func GetInputVarDefs

func GetInputVarDefs(w *model.WfSpecPb) map[string]*model.VariableDefPb

func GetIsPtrAndType

func GetIsPtrAndType(thing reflect.Type) (bool, reflect.Kind)

func GetVarType

func GetVarType(thing interface{}) model.VariableTypePb

func InterfaceToVarVal

func InterfaceToVarVal(someInterface interface{}) (*model.VariableValuePb, error)

func PrintProto

func PrintProto(p proto.Message)

func PrintResp

func PrintResp(resp proto.Message, err error)

func ReflectTypeToVarType

func ReflectTypeToVarType(rt reflect.Type) model.VariableTypePb

func StrToVarVal

func StrToVarVal(input string, varType model.VariableTypePb) (*model.VariableValuePb, error)

Types

type LHClient

type LHClient struct {
	// contains filtered or unexported fields
}

func NewLHClient

func NewLHClient(config *LHConfig) (*LHClient, error)

func (*LHClient) DeleteExternalEventDef

func (l *LHClient) DeleteExternalEventDef(name string) error

func (*LHClient) DeleteTaskDef

func (l *LHClient) DeleteTaskDef(name string) error

func (*LHClient) DeleteWfRun

func (l *LHClient) DeleteWfRun(id string) error

func (*LHClient) DeleteWfSpec

func (l *LHClient) DeleteWfSpec(name string, version int32) error

func (*LHClient) GetExternalEvent

func (l *LHClient) GetExternalEvent(
	wfRunId, externalEventDefName, guid string,
) (*model.ExternalEventPb, error)

func (*LHClient) GetExternalEventDef

func (l *LHClient) GetExternalEventDef(name string) (*model.ExternalEventDefPb, error)

func (*LHClient) GetNodeRun

func (l *LHClient) GetNodeRun(wfRunId string, threadRunNumber, position int32) (*model.NodeRunPb, error)

func (*LHClient) GetTaskDef

func (l *LHClient) GetTaskDef(name string) (*model.TaskDefPb, error)

func (*LHClient) GetVariable

func (l *LHClient) GetVariable(
	wfRunId string, threadRunNumber int32, name string,
) (*model.VariablePb, error)

func (*LHClient) GetWfRun

func (l *LHClient) GetWfRun(id string) (*model.WfRunPb, error)

func (*LHClient) GetWfSpec

func (l *LHClient) GetWfSpec(name string, version *int32) (*model.WfSpecPb, error)

func (*LHClient) PutExternalEvent

func (l *LHClient) PutExternalEvent(
	externalEventDefName, wfRunId string,
	content interface{},
	guid *string, threadRunNumber *int32,
) (*model.ExternalEventIdPb, error)

func (*LHClient) PutExternalEventDef

func (l *LHClient) PutExternalEventDef(
	request *model.PutExternalEventDefPb, swallowAlreadyExistsError bool,
) (*model.ExternalEventDefPb, error)

func (*LHClient) PutTaskDef

func (l *LHClient) PutTaskDef(
	request *model.PutTaskDefPb, swallowAlreadyExistsError bool,
) (*model.TaskDefPb, error)

func (*LHClient) PutWfSpec

func (l *LHClient) PutWfSpec(request *model.PutWfSpecPb) (*model.WfSpecPb, error)

func (*LHClient) ResumeWfRun

func (l *LHClient) ResumeWfRun(id string, threadRunNumber int32) error

func (*LHClient) RunWf

func (l *LHClient) RunWf(
	wfSpecName string, wfSpecVersion *int32, wfRunId *string, args ...WfArg,
) (*string, error)

func (*LHClient) StopWfRun

func (l *LHClient) StopWfRun(id string, threadRunNumber int32) error

type LHConfig

type LHConfig struct {
	ApiHost  string
	ApiPort  string
	ClientId string
	CertFile *string
	KeyFile  *string
	CaCert   *string

	NumWorkerThreads      int32
	TaskWorkerVersion     string
	ServerConnectListener string
	// contains filtered or unexported fields
}

func NewConfigFromEnv

func NewConfigFromEnv() *LHConfig

func NewConfigFromProps

func NewConfigFromProps(filePath string) (*LHConfig, error)

func (*LHConfig) GetGrpcClient

func (l *LHConfig) GetGrpcClient() (*model.LHPublicApiClient, error)

func (*LHConfig) GetGrpcClientForHost

func (l *LHConfig) GetGrpcClientForHost(url string) (*model.LHPublicApiClient, error)

func (*LHConfig) GetGrpcConn

func (l *LHConfig) GetGrpcConn(url string) (*grpc.ClientConn, error)

type TaskFuncArg

type TaskFuncArg struct {
	Name     string
	Type     reflect.Type
	Position int32
}

func (*TaskFuncArg) Assign

func (a *TaskFuncArg) Assign(task *model.ScheduledTaskPb) (*reflect.Value, error)

type TaskFuncSignature

type TaskFuncSignature struct {
	Args      []TaskFuncArg
	HasOutput bool
	HasError  bool
}

func NewTaskSignature

func NewTaskSignature(taskFunc interface{}) (*TaskFuncSignature, error)

type WfArg

type WfArg struct {
	Name string
	Arg  interface{}
}

Directories

Path Synopsis
model module

Jump to

Keyboard shortcuts

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