sdktypes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Exposes types that are used in the SDK. Those types are mostly an immutable boxes for proto defined types. The idea behind hiding behind a box is twofold: 1. Make the data immutable. 2. Make invalid data unrepresantble. There must be no way to instansiate an object or an id outside of the SDK, other than other via SDK methods, such as <Object>FromProto or New<Object>ID.

Strict* versions of object functions do not allow for missing required fields. They do allow, though, for missing the entire object entirely (nil input).

Strict* versions of ids and handles (non-objects) do not allow for missing values at all.

Index

Constants

Event Record State Enum

View Source
const BuildIDKind = "b"
View Source
const ConnectionIDKind = "connection"
View Source
const DeploymentIDKind = "d"
View Source
const EnvIDKind = "e"
View Source
const EventIDKind = "event"
View Source
const IntegrationIDKind = "integration"
View Source
const MappingEntrypointIDKind = "meid"
View Source
const MappingIDKind = "m"
View Source
const ProjectIDKind = "p"
View Source
const RunIDKind = "run"
View Source
const SessionIDKind = "s"

Variables

View Source
var (
	BuildFromProto       = makeFromProto(validateBuild)
	StrictBuildFromProto = makeFromProto(strictValidateBuild)
	ToStrictBuild        = makeWithValidator(strictValidateBuild)
)
View Source
var (
	BuildArtifactFromProto       = makeFromProto(validateBuildArtifact)
	StrictBuildArtifactFromProto = makeFromProto(strictValidateBuildArtifact)
	ToStrictBuildArtifact        = makeWithValidator(strictValidateBuildArtifact)
)
View Source
var (
	CallFrameFromProto       = makeFromProto(validateCallFrame)
	StrictCallFrameFromProto = makeFromProto(strictValidateCallFrame)
	ToStrictCallFrame        = makeWithValidator(strictValidateCallFrame)
)
View Source
var (
	CodeLocationFromProto       = makeFromProto(validateCodeLocation)
	StrictCodeLocationFromProto = makeFromProto(strictValidateCodeLocation)
	ToStrictCodeLocation        = makeWithValidator(strictValidateCodeLocation)
)
View Source
var (
	ConnectionFromProto       = makeFromProto(validateConnection)
	StrictConnectionFromProto = makeFromProto(strictValidateConnection)
	ToStrictConnection        = makeWithValidator(strictValidateConnection)
)
View Source
var (
	DeploymentFromProto       = makeFromProto(validateDeployment)
	StrictDeploymentFromProto = makeFromProto(strictValidateDeployment)
	ToStrictDeployment        = makeWithValidator(strictValidateDeployment)
)
View Source
var (
	EnvFromProto       = makeFromProto(validateEnv)
	StrictEnvFromProto = makeFromProto(strictValidateEnv)
	ToStrictEnv        = makeWithValidator(strictValidateEnv)
)
View Source
var (
	EnvVarFromProto       = makeFromProto(validateEnvVar)
	StrictEnvVarFromProto = makeFromProto(strictValidateEnvVar)
	ToStrictEnvVar        = makeWithValidator(strictValidateEnvVar)
)
View Source
var (
	EventFromProto       = makeFromProto(validateEvent)
	StrictEventFromProto = makeFromProto(strictValidateEvent)
	ToStrictEvent        = makeWithValidator(strictValidateEvent)
)
View Source
var (
	EventRecordFromProto       = makeFromProto(validateEventRecord)
	StrictEventRecordFromProto = makeFromProto(strictValidateEventRecord)
	ToStrictEventRecord        = makeWithValidator(strictValidateEventRecord)
)
View Source
var (
	ExportFromProto       = makeFromProto(validateExport)
	StrictExportFromProto = makeFromProto(strictValidateExport)
	ToStrictExport        = makeWithValidator(strictValidateExport)
)
View Source
var (
	IntegrationFromProto       = makeFromProto(validateIntegration)
	StrictIntegrationFromProto = makeFromProto(strictValidateIntegration)
	ToStrictIntegration        = makeWithValidator(strictValidateIntegration)
)
View Source
var (
	MappingFromProto       = makeFromProto(validateMapping)
	StrictMappingFromProto = makeFromProto(strictValidateMapping)
	ToStrictMapping        = makeWithValidator(strictValidateMapping)
)
View Source
var (
	MappingEventFromProto       = makeFromProto(validateMappingEvent)
	StrictMappingEventFromProto = makeFromProto(strictValidateMappingEvent)
	ToStrictMappingEvent        = makeWithValidator(strictValidateMappingEvent)
)
View Source
var (
	ModuleFromProto       = makeFromProto(validateModule)
	StrictModuleFromProto = makeFromProto(strictValidateModule)
	ToStrictModule        = makeWithValidator(strictValidateModule)
)
View Source
var (
	ModuleFunctionFromProto       = makeFromProto(validateModuleFunction)
	StrictModuleFunctionFromProto = makeFromProto(strictValidateModuleFunction)
	ToStrictModuleFunction        = makeWithValidator(strictValidateModuleFunction)
)
View Source
var (
	ModuleVariableFromProto       = makeFromProto(validateModuleVariable)
	StrictModuleVariableFromProto = makeFromProto(strictValidateModuleVariable)
	ToStrictModuleVariable        = makeWithValidator(strictValidateModuleVariable)
)
View Source
var (
	ProgramErrorFromProto       = makeFromProto(validateProgramError)
	StrictProgramErrorFromProto = makeFromProto(strictValidateProgramError)
	ToStrictProgramError        = makeWithValidator(strictValidateProgramError)
)
View Source
var (
	ProjectFromProto       = makeFromProto(validateProject)
	StrictProjectFromProto = makeFromProto(strictValidateProject)
	ToStrictProject        = makeWithValidator(strictValidateProject)
)
View Source
var (
	RequirementFromProto       = makeFromProto(validateRequirement)
	StrictRequirementFromProto = makeFromProto(strictValidateRequirement)
	ToStrictRequirement        = makeWithValidator(strictValidateRequirement)
)
View Source
var (
	NewIdleRunStatus = func() RunStatus { return idleRunState }

	NewRunningRunStatus = func() RunStatus { return runningRunState }

	LoadWaitRunStateFromProto = makeFromProto[*runtimesv1.RunStatus_LoadWait](nil)
	NewLoadWaitRunStatus      = func(path string) RunStatus {
		return NewRunStatus(kittehs.Must1(LoadWaitRunStateFromProto(&runtimesv1.RunStatus_LoadWait{Path: path})))
	}

	CompletedRunStateFromProto = makeFromProto(validateCompletedRunState)
	NewCompletedRunStatus      = func(m map[string]Value) RunStatus {
		return NewRunStatus(kittehs.Must1(CompletedRunStateFromProto(&runtimesv1.RunStatus_Completed{
			Values: StringValueMapToProto(m),
		})))
	}

	ErrorRunStateFromProto = makeFromProto[*runtimesv1.RunStatus_Error](nil)
	NewErrorRunStatus      = func(errs []ProgramError) RunStatus {
		return NewRunStatus(kittehs.Must1(ErrorRunStateFromProto(&runtimesv1.RunStatus_Error{
			Errors: kittehs.Transform(errs, func(e ProgramError) *ProgramErrorPB { return e.ToProto() }),
		})))
	}

	CallWaitRunStateFromProto = makeFromProto(validateCallWaitRunState)
	NewCallWaitRunStatus      = func(call Value, args []Value, kwargs map[string]Value) RunStatus {
		return NewRunStatus(kittehs.Must1(CallWaitRunStateFromProto(&runtimesv1.CallWait{
			Call:   call.ToProto(),
			Args:   kittehs.Transform(args, func(v Value) *ValuePB { return v.ToProto() }),
			Kwargs: StringValueMapToProto(kwargs),
		})))
	}
)
View Source
var (
	RunStatusFromProto       = makeFromProto(validateRunStatus)
	StrictRunStatusFromProto = makeFromProto(strictValidateRunStatus)
	ToStrictRunStatus        = makeWithValidator(strictValidateRunStatus)
)
View Source
var (
	RuntimeFromProto       = makeFromProto(validateRuntime)
	StrictRuntimeFromProto = makeFromProto(strictValidateRuntime)
	ToStrictRuntime        = makeWithValidator(strictValidateRuntime)
)
View Source
var (
	SessionFromProto       = makeFromProto(validateSession)
	StrictSessionFromProto = makeFromProto(strictValidateSession)
	ToStrictSession        = makeWithValidator(strictValidateSession)
)
View Source
var (
	SessionCallFromProto       = makeFromProto(validateSessionCall)
	StrictSessionCallFromProto = makeFromProto(strictValidateSessionCall)
	ToStrictSessionCall        = makeWithValidator(strictValidateSessionCall)
)
View Source
var (
	SessionCallAttemptCompleteFromProto       = makeFromProto(validateSessionCallAttemptComplete)
	StrictSessionCallAttemptCompleteFromProto = makeFromProto(strictValidateSessionCallAttemptComplete)
	ToStrictSessionCallAttemptComplete        = makeWithValidator(strictValidateSessionCallAttemptComplete)
)
View Source
var (
	SessionCallAttemptResultFromProto       = makeFromProto(validateSessionCallAttemptResult)
	StrictSessionCallAttemptResultFromProto = makeFromProto(strictValidateSessionCallAttemptResult)
	ToStrictSessionCallAttemptResult        = makeWithValidator(strictValidateSessionCallAttemptResult)
)
View Source
var (
	SessionCallAttemptStartFromProto       = makeFromProto(validateSessionCallAttemptStart)
	StrictSessionCallAttemptStartFromProto = makeFromProto(strictValidateSessionCallAttemptStart)
	ToStrictSessionCallAttemptStart        = makeWithValidator(strictValidateSessionCallAttemptStart)
)
View Source
var (
	SessionCallSpecFromProto       = makeFromProto(validateSessionCallSpec)
	StrictSessionCallSpecFromProto = makeFromProto(strictValidateSessionCallSpec)
	ToStrictSessionCallSpec        = makeWithValidator(strictValidateSessionCallSpec)
)
View Source
var (
	SessionLogFromProto       = makeFromProto(validateSessionLog)
	StrictSessionLogFromProto = makeFromProto(strictValidateSessionLog)
	ToStrictSessionLog        = makeWithValidator(strictValidateSessionLog)
)
View Source
var (
	SessionLogRecordFromProto       = makeFromProto(validateSessionLogRecord)
	StrictSessionLogRecordFromProto = makeFromProto(strictValidateSessionLogRecord)
	ToStrictSessionLogRecord        = makeWithValidator(strictValidateSessionLogRecord)
)
View Source
var (
	SessionStateFromProto       = makeFromProto(validateSessionState)
	StrictSessionStateFromProto = makeFromProto(strictValidateSessionState)
	ToStrictSessionState        = makeWithValidator(strictValidateSessionState)
)
View Source
var (
	NewCreatedSessionState = func() CreatedSessionState { return createdSessionState }

	RunningSessionStateFromProto = makeFromProto(validateRunningSessionState)
	NewRunningSessionState       = func(runID RunID, callv Value) RunningSessionState {
		return kittehs.Must1(RunningSessionStateFromProto(&sessionsv1.SessionState_Running{
			RunId: runID.String(),
			Call:  ToProto(callv),
		}))
	}

	ErrorSessionStateFromProto = makeFromProto(validateErrorSessionState)
	NewErrorSessionState       = func(err error, prints []string) ErrorSessionState {
		return kittehs.Must1(
			ErrorSessionStateFromProto(
				&sessionsv1.SessionState_Error{
					Error:  ProgramErrorFromError(err).ToProto(),
					Prints: prints,
				},
			),
		)
	}

	CompletedSessionStateFromProto = makeFromProto(validateCompletedSessionState)
	NewCompletedSessionState       = func(prints []string, exports map[string]Value, ret Value) (CompletedSessionState, error) {
		return CompletedSessionStateFromProto(&sessionsv1.SessionState_Completed{
			Prints:      prints,
			Exports:     kittehs.TransformMapValues(exports, ToProto),
			ReturnValue: ret.ToProto(),
		})
	}
)
View Source
var (
	MustValueFromProto = makeMustFromProto(ValidateValuePB)
	ToStrictValue      = makeWithValidator(StrictValidateValuePB)
)
View Source
var (
	IsNothingValue  = isValueOfType[NothingValue]
	IsBooleanValue  = isValueOfType[BooleanValue]
	IsStringValue   = isValueOfType[StringValue]
	IsIntegerValue  = isValueOfType[IntegerValue]
	IsBytesValue    = isValueOfType[BytesValue]
	IsFloatValue    = isValueOfType[FloatValue]
	IsDurationValue = isValueOfType[DurationValue]
	IsTimeValue     = isValueOfType[TimeValue]
	IsSymbolValue   = isValueOfType[SymbolValue]
	IsListValue     = isValueOfType[ListValue]
	IsSetValue      = isValueOfType[SetValue]
	IsDictValue     = isValueOfType[DictValue]
	IsStructValue   = isValueOfType[StructValue]
	IsModuleValue   = isValueOfType[ModuleValue]
	IsFunctionValue = isValueOfType[FunctionValue]
)
View Source
var (
	NewNothingValue = func() Value { return MustNewValue(nothingValue) }

	BooleanValueFromProto = makeFromProto[*valuesv1.Boolean](nil)
	NewBooleanValue       = func(v bool) Value { return MustNewValue(kittehs.Must1(BooleanValueFromProto(&valuesv1.Boolean{V: v}))) }

	StringValueFromProto = makeFromProto[*valuesv1.String](nil)
	NewStringValue       = func(v string) Value { return MustNewValue(kittehs.Must1(StringValueFromProto(&valuesv1.String{V: v}))) }

	IntegerValueFromProto = makeFromProto[*valuesv1.Integer](nil)
	NewIntegerValue       = func(v int64) Value {
		return MustNewValue(kittehs.Must1(IntegerValueFromProto(&valuesv1.Integer{V: v})))
	}

	BytesValueFromProto = makeFromProto[*valuesv1.Bytes](nil)
	NewBytesValue       = func(v []byte) Value { return MustNewValue(kittehs.Must1(BytesValueFromProto(&valuesv1.Bytes{V: v}))) }

	FloatValueFromProto = makeFromProto[*valuesv1.Float](nil)
	NewFloatValue       = func(v float64) Value { return MustNewValue(kittehs.Must1(FloatValueFromProto(&valuesv1.Float{V: v}))) }

	SymbolValueFromProto = makeFromProto[*valuesv1.Symbol](nil)
	NewSymbolValue       = func(v Symbol) Value {
		return MustNewValue(kittehs.Must1(SymbolValueFromProto(&valuesv1.Symbol{Name: v.String()})))
	}

	DurationValueFromProto = makeFromProto[*valuesv1.Duration](nil)
	NewDurationValue       = func(v time.Duration) Value {
		return MustNewValue(kittehs.Must1(DurationValueFromProto(&valuesv1.Duration{V: durationpb.New(v)})))
	}

	TimeValueFromProto = makeFromProto[*valuesv1.Time](nil)
	NewTimeValue       = func(v time.Time) Value {
		return MustNewValue(kittehs.Must1(TimeValueFromProto(&valuesv1.Time{V: timestamppb.New(v)})))
	}
)
View Source
var PossibleDeploymentStates = kittehs.Transform(kittehs.MapValuesSortedByKeys(deploymentsv1.DeploymentState_name), func(name string) string {
	return strings.TrimPrefix(name, "DEPLOYMENT_STATE_")
})
View Source
var PossibleEventRecordStates = kittehs.Transform(kittehs.MapValuesSortedByKeys(eventsv1.EventState_name), func(name string) string {
	return strings.TrimPrefix(name, "EVENT_STATE_")
})
View Source
var PossibleSessionStateTypes = kittehs.Transform(kittehs.MapValuesSortedByKeys(sessionsv1.SessionStateType_name), func(name string) string {
	return strings.TrimPrefix(name, "SESSION_STATE_TYPE_")
})

Functions

func DictValueToStringMap

func DictValueToStringMap(v Value) (map[string]Value, error)

func DictValueToStringsMap

func DictValueToStringsMap(v Value) (map[string]Value, error)

func EnvHasID

func EnvHasID(e Env) bool

func EqualValues

func EqualValues(a, b Value) bool

func EventToValues

func EventToValues(e Event) map[string]Value

func FunctionValueHasExecutorID

func FunctionValueHasExecutorID(v Value) bool

func FunctionValueHasFlag

func FunctionValueHasFlag(v Value, flag FunctionFlag) bool

func GetBooleanValue

func GetBooleanValue(v Value) bool

func GetBuildArtifactCompiledData

func GetBuildArtifactCompiledData(p BuildArtifact) map[string][]byte

func GetBuildCreatedAt

func GetBuildCreatedAt(b Build) time.Time

func GetBytesValue

func GetBytesValue(v Value) []byte

func GetCodeLocationCanonicalString

func GetCodeLocationCanonicalString(l CodeLocation) string

func GetCodeLocationName

func GetCodeLocationName(l CodeLocation) string

func GetCodeLocationPath

func GetCodeLocationPath(l CodeLocation) string

func GetCodeLocationRowCol

func GetCodeLocationRowCol(l CodeLocation) (uint32, uint32)

func GetConnectionIntegrationToken

func GetConnectionIntegrationToken(c Connection) string

func GetDictValueLen

func GetDictValueLen(v Value) int

func GetDurationValue

func GetDurationValue(v Value) time.Duration

func GetEnvVarValue

func GetEnvVarValue(e EnvVar) string

func GetEventCreatedAt

func GetEventCreatedAt(e Event) time.Time

func GetEventData

func GetEventData(e Event) map[string]Value

func GetEventIntegrationToken

func GetEventIntegrationToken(e Event) string

func GetEventMemo

func GetEventMemo(e Event) map[string]string

func GetEventRecordCreatedAt

func GetEventRecordCreatedAt(er EventRecord) time.Time

func GetEventRecordSeq

func GetEventRecordSeq(er EventRecord) uint32

func GetEventSequenceNumber

func GetEventSequenceNumber(e Event) uint64

func GetEventType

func GetEventType(e Event) string

func GetFloatValue

func GetFloatValue(v Value) float64

func GetFunctionValueArgsNames

func GetFunctionValueArgsNames(v Value) []string

func GetFunctionValueData

func GetFunctionValueData(v Value) []byte

func GetFunctionValueUniqueID

func GetFunctionValueUniqueID(v Value) string

func GetIntegerValue

func GetIntegerValue(v Value) int64

func GetIntegrationConnectionURL

func GetIntegrationConnectionURL(i Integration) *url.URL

TODO(ENG-346): Connection UI specification instead of a URL.

func GetIntegrationDescription

func GetIntegrationDescription(i Integration) string

func GetIntegrationDisplayName

func GetIntegrationDisplayName(i Integration) string

func GetIntegrationLogoURL

func GetIntegrationLogoURL(i Integration) *url.URL
func GetIntegrationUserLinks(i Integration) map[string]*url.URL

func GetLoadWaitRunStatePath

func GetLoadWaitRunStatePath(l LoadWaitRunState) string

func GetMappingEventType

func GetMappingEventType(me MappingEvent) string

func GetModuleFunctionDescription

func GetModuleFunctionDescription(i ModuleFunction) string

func GetModuleFunctions

func GetModuleFunctions(m Module) map[string]ModuleFunction

func GetModuleVariableDescription

func GetModuleVariableDescription(i ModuleVariable) string

func GetModuleVariables

func GetModuleVariables(m Module) map[string]ModuleVariable

func GetObjectHash

func GetObjectHash(o Object) string

func GetOriginalEventID

func GetOriginalEventID(e Event) string

func GetProgramErrorExtra

func GetProgramErrorExtra(e ProgramError) map[string]string

func GetProgramErrorMessage

func GetProgramErrorMessage(e ProgramError) string

func GetProjectResourcePaths

func GetProjectResourcePaths(p Project) []string

func GetProjectResourcesRootURL

func GetProjectResourcesRootURL(p Project) *url.URL

func GetRequirementURL

func GetRequirementURL(r Requirement) *url.URL

func GetRuntimeFileExtensions

func GetRuntimeFileExtensions(r Runtime) []string

func GetSessionCallResultError

func GetSessionCallResultError(r SessionCallAttemptResult) error

func GetSessionCallSpecData

func GetSessionCallSpecData(v SessionCallSpec) (Value, []Value, map[string]Value)

func GetSessionCallSpecSeq

func GetSessionCallSpecSeq(v SessionCallSpec) uint32

func GetSessionHistoryStatePrints

func GetSessionHistoryStatePrints(s SessionState) []string

func GetSessionInputs

func GetSessionInputs(e Session) map[string]Value

func GetSessionLogRecordData

func GetSessionLogRecordData(r SessionLogRecord) any

func GetSessionLogRecordPrint

func GetSessionLogRecordPrint(r SessionLogRecord) string

func GetSessionLogRecordTimestamp

func GetSessionLogRecordTimestamp(record SessionLogRecord) time.Time

func GetSessionMemo

func GetSessionMemo(e Session) map[string]string

func GetStringValue

func GetStringValue(v Value) string

func GetTimeValue

func GetTimeValue(v Value) time.Time

func GetValueLength

func GetValueLength(v Value) (int, error)

func IsEnvVarSecret

func IsEnvVarSecret(e EnvVar) bool

func IsID

func IsID(s string) bool

IsID returns if s might be an ID, not a valid ID.

In the CLI, UI, or even some routes we might want to get a ref by either a handle or an ID. For that, we need to understand what the user intended to put, and if it's an invalid ID - still treat it as an ID and say "this is an invalid ID".

func IsName

func IsName(s string) bool

See comment for IsID for reasoning.

func IsValidID

func IsValidID(s string) bool

func IsValidName

func IsValidName(s string) bool

func NewSequentialIDGeneratorForTesting

func NewSequentialIDGeneratorForTesting(init uint64) func() string

To be used for testing only, when we expect a certain ID. First ID generated will be init+1.

func ObjectToString

func ObjectToString(o Object) string

func ParseEnvIDOrName

func ParseEnvIDOrName(raw string) (Name, EnvID, error)

func ParseProjectIDOrName

func ParseProjectIDOrName(raw string) (Name, ProjectID, error)

func ProgramErrorToError

func ProgramErrorToError(e ProgramError) error

func ProjectHasID

func ProjectHasID(p Project) bool

func SetIDGenerator

func SetIDGenerator(f func() string)

func SplitRawID

func SplitRawID(raw string) (kind, data string, ok bool)

func StrictValidateValuePB

func StrictValidateValuePB(pb *ValuePB) error

func StringValueMapToProto

func StringValueMapToProto(m map[string]Value) map[string]*ValuePB

func StructValueToStringMap

func StructValueToStringMap(v Value) (map[string]Value, error)

func ToMessage

func ToMessage(obj Object) proto.Message

func ToProto

func ToProto[T comparableProto](o *object[T]) T

func UUIDGenerator

func UUIDGenerator() string

func ValidateValuePB

func ValidateValuePB(pb *ValuePB) error

func ValueToDuration

func ValueToDuration(v Value) (time.Duration, error)

func ValueToStringValuesMap

func ValueToStringValuesMap(v Value) (map[string]Value, error)

func ValueToTime

func ValueToTime(v Value) (time.Time, error)

Types

type BooleanValue

type BooleanValue = *object[*valuesv1.Boolean]

type Build

type Build = *object[*BuildPB]

type BuildArtifact

type BuildArtifact = *object[*BuildArtifactPB]

func BuildArtifactReplaceCompiledData

func BuildArtifactReplaceCompiledData(p BuildArtifact, f func([]byte) []byte) BuildArtifact

type BuildArtifactPB

type BuildArtifactPB = runtimesv1.BuildArtifact

type BuildID

type BuildID = *id[BuildIDTraits]

func GetBuildID

func GetBuildID(b Build) BuildID

func GetDeploymentBuildID

func GetDeploymentBuildID(e Deployment) BuildID

func NewBuildID

func NewBuildID() BuildID

func ParseBuildID

func ParseBuildID(raw string) (BuildID, error)

func StrictParseBuildID

func StrictParseBuildID(raw string) (BuildID, error)

type BuildIDTraits

type BuildIDTraits struct{}

func (BuildIDTraits) Kind

func (BuildIDTraits) Kind() string

func (BuildIDTraits) ValidateValue

func (BuildIDTraits) ValidateValue(raw string) error

type BuildPB

type BuildPB = buildsv1.Build

type BytesValue

type BytesValue = *object[*valuesv1.Bytes]

type CallFrame

type CallFrame = *object[*CallFramePB]

func GetProgramErrorCallFrameAt

func GetProgramErrorCallFrameAt(e ProgramError, i int) CallFrame

i=0: innermost. i=-1: outermost.

func GetProgramErrorCallStack

func GetProgramErrorCallStack(e ProgramError) []CallFrame

func GetProgramErrorInnermostCallFrame

func GetProgramErrorInnermostCallFrame(e ProgramError) CallFrame

func GetProgramErrorOutermostCallFrame

func GetProgramErrorOutermostCallFrame(e ProgramError) CallFrame

type CallFramePB

type CallFramePB = programv1.CallFrame

type CallWaitRunState

type CallWaitRunState = *object[*runtimesv1.CallWait]

This is a bit special as it is reused in RunRequest.

type CodeLocation

type CodeLocation = *object[*CodeLocationPB]

func GetExportCodeLocation

func GetExportCodeLocation(e Export) CodeLocation

func GetMappingEventCodeLocation

func GetMappingEventCodeLocation(me MappingEvent) CodeLocation

func GetRequirementCodeLocation

func GetRequirementCodeLocation(r Requirement) CodeLocation

func GetSessionEntryPoint

func GetSessionEntryPoint(e Session) CodeLocation

func ParseCodeLocation

func ParseCodeLocation(s string) (CodeLocation, error)

func StrictParseCodeLocation

func StrictParseCodeLocation(s string) (CodeLocation, error)

type CodeLocationPB

type CodeLocationPB = programv1.CodeLocation

type CompletedRunState

type CompletedRunState = *object[*runtimesv1.RunStatus_Completed]

type CompletedSessionState

type CompletedSessionState = *object[*sessionsv1.SessionState_Completed]

type Connection

type Connection = *object[*ConnectionPB]

type ConnectionID

type ConnectionID = *id[connectionIDTraits]

func GetConnectionID

func GetConnectionID(c Connection) ConnectionID

func GetMappingConnectionID

func GetMappingConnectionID(m Mapping) ConnectionID

func NewConnectionID

func NewConnectionID() ConnectionID

func ParseConnectionID

func ParseConnectionID(raw string) (ConnectionID, error)

func StrictParseConnectionID

func StrictParseConnectionID(raw string) (ConnectionID, error)

type ConnectionPB

type ConnectionPB = connectionsv1.Connection

type CreatedSessionState

type CreatedSessionState = *object[*sessionsv1.SessionState_Created]

type Deployment

type Deployment = *object[*DeploymentPB]

func DeploymentWithoutTimes

func DeploymentWithoutTimes(d Deployment) Deployment

type DeploymentID

type DeploymentID = *id[deploymentIDTraits]

func GetDeploymentID

func GetDeploymentID(e Deployment) DeploymentID

func GetSessionDeploymentID

func GetSessionDeploymentID(e Session) DeploymentID

func NewDeploymentID

func NewDeploymentID() DeploymentID

func ParseDeploymentID

func ParseDeploymentID(raw string) (DeploymentID, error)

func StrictParseDeploymentID

func StrictParseDeploymentID(raw string) (DeploymentID, error)

type DeploymentPB

type DeploymentPB = deploymentsv1.Deployment

type DeploymentSessionsStats

type DeploymentSessionsStats = deploymentsv1.Deployment_SessionStats

type DeploymentState

type DeploymentState deploymentsv1.DeploymentState

func GetDeploymentState

func GetDeploymentState(e Deployment) DeploymentState

func ParseDeploymentState

func ParseDeploymentState(raw string) DeploymentState

func (DeploymentState) String

func (s DeploymentState) String() string

func (DeploymentState) ToProto

type DictValue

type DictValue = *object[*valuesv1.Dict]

func DictValueFromProto

func DictValueFromProto(pb *valuesv1.Dict) (DictValue, error)

type DictValueItem

type DictValueItem struct{ K, V Value }

func GetDictValue

func GetDictValue(v Value) []*DictValueItem

type DurationValue

type DurationValue = *object[*valuesv1.Duration]

type Env

type Env = *object[*EnvPB]

type EnvID

type EnvID = *id[envIDTraits]

func GetDeploymentEnvID

func GetDeploymentEnvID(e Deployment) EnvID

func GetEnvID

func GetEnvID(e Env) EnvID

func GetEnvVarEnvID

func GetEnvVarEnvID(e EnvVar) EnvID

func GetMappingEnvID

func GetMappingEnvID(m Mapping) EnvID

func NewEnvID

func NewEnvID() EnvID

func ParseEnvID

func ParseEnvID(raw string) (EnvID, error)

func StrictParseEnvID

func StrictParseEnvID(raw string) (EnvID, error)

type EnvPB

type EnvPB = envsv1.Env

type EnvVar

type EnvVar = *object[*EnvVarPB]

type EnvVarPB

type EnvVarPB = envsv1.EnvVar

type ErrorRunState

type ErrorRunState = *object[*runtimesv1.RunStatus_Error]

type ErrorSessionState

type ErrorSessionState = *object[*sessionsv1.SessionState_Error]

type Event

type Event = *object[*EventPB]

type EventID

type EventID = *id[eventIDTraits]

func GetEventID

func GetEventID(e Event) EventID

func GetEventRecordEventID

func GetEventRecordEventID(er EventRecord) EventID

func GetSessionEventID

func GetSessionEventID(e Session) EventID

func NewEventID

func NewEventID() EventID

func ParseEventID

func ParseEventID(raw string) (EventID, error)

func StrictParseEventID

func StrictParseEventID(raw string) (EventID, error)

type EventPB

type EventPB = eventsv1.Event

type EventRecord

type EventRecord = *object[*EventRecordPB]

type EventRecordPB

type EventRecordPB = eventsv1.EventRecord

type EventState

type EventState eventsv1.EventState

func GetEventRecordState

func GetEventRecordState(er EventRecord) EventState

func ParseEventRecordState

func ParseEventRecordState(raw string) EventState

func (EventState) String

func (s EventState) String() string

func (EventState) ToProto

func (s EventState) ToProto() eventsv1.EventState

type ExecutorID

type ExecutorID = *executorID

func GetFunctionValueExecutorID

func GetFunctionValueExecutorID(v Value) ExecutorID

func MustParseExecutorID

func MustParseExecutorID(raw string) ExecutorID

func NewExecutorID

func NewExecutorID[T executorIDConstraint](id T) ExecutorID

func ParseExecutorID

func ParseExecutorID(raw string) (ExecutorID, error)

func StrictParseExecutorID

func StrictParseExecutorID(raw string) (ExecutorID, error)

type Export

type Export = *object[*ExportPB]

func GetBuildArtifactExports

func GetBuildArtifactExports(p BuildArtifact) []Export

func NewExport

func NewExport(loc CodeLocation, sym Symbol) (Export, error)

type ExportPB

type ExportPB = runtimesv1.Export

type FloatValue

type FloatValue = *object[*valuesv1.Float]

type FunctionFlag

type FunctionFlag string
const (
	PrivilidgedFunctionFlag    FunctionFlag = "privilidged" // pass workflow context.
	PureFunctionFlag           FunctionFlag = "pure"        // do not run in an activity.
	DisablePollingFunctionFlag FunctionFlag = "no-poll"     // do not poll.
)

func GetFunctionValueFlags

func GetFunctionValueFlags(v Value) []FunctionFlag

func (FunctionFlag) String

func (ff FunctionFlag) String() string

type FunctionValue

type FunctionValue = *object[*valuesv1.Function]

func FunctionValueFromProto

func FunctionValueFromProto(pb *valuesv1.Function) (FunctionValue, error)

func GetFunctionValue

func GetFunctionValue(v Value) FunctionValue

type ID

type ID interface {
	fmt.Stringer
	json.Marshaler
	json.Unmarshaler

	Kind() string
	Value() string
	// contains filtered or unexported methods
}

func ParseAnyID

func ParseAnyID(raw string) (ID, error)

func StrictParseAnyID

func StrictParseAnyID(raw string) (ID, error)

type IdleRunState

type IdleRunState = *object[*runtimesv1.RunStatus_Idle]

type IntegerValue

type IntegerValue = *object[*valuesv1.Integer]

type Integration

type Integration = *object[*IntegrationPB]

type IntegrationID

type IntegrationID = *id[integrationIDTraits]

func GetConnectionIntegrationID

func GetConnectionIntegrationID(c Connection) IntegrationID

func GetEventIntegrationID

func GetEventIntegrationID(e Event) IntegrationID

func GetIntegrationID

func GetIntegrationID(i Integration) IntegrationID

func IntegrationIDFromName

func IntegrationIDFromName(name string) IntegrationID

func NewIntegrationID

func NewIntegrationID() IntegrationID

func ParseIntegrationID

func ParseIntegrationID(raw string) (IntegrationID, error)

func StrictParseIntegrationID

func StrictParseIntegrationID(raw string) (IntegrationID, error)

type IntegrationPB

type IntegrationPB = integrationsv1.Integration

type ListValue

type ListValue = *object[*valuesv1.List]

func ListValueFromProto

func ListValueFromProto(pb *valuesv1.List) (ListValue, error)

type LoadWaitRunState

type LoadWaitRunState = *object[*runtimesv1.RunStatus_LoadWait]

type Mapping

type Mapping = *object[*MappingPB]

type MappingEntrypointID

type MappingEntrypointID = *id[mappingEntrypointIDTraits]

func NewEMappingEntrypointD

func NewEMappingEntrypointD() MappingEntrypointID

func ParseMappingEntrypointID

func ParseMappingEntrypointID(raw string) (MappingEntrypointID, error)

func StrictParseMappingEntrypointID

func StrictParseMappingEntrypointID(raw string) (MappingEntrypointID, error)

type MappingEvent

type MappingEvent = *object[*MappingEventPB]

func GetMappingEvents

func GetMappingEvents(m Mapping) []MappingEvent

type MappingEventPB

type MappingEventPB = mappingsv1.MappingEvent

type MappingID

type MappingID = *id[mappingIDTraits]

func GetMappingID

func GetMappingID(m Mapping) MappingID

func NewMappingID

func NewMappingID() MappingID

func ParseMappingID

func ParseMappingID(raw string) (MappingID, error)

func StrictParseMappingID

func StrictParseMappingID(raw string) (MappingID, error)

type MappingPB

type MappingPB = mappingsv1.Mapping

type Module

type Module = *object[*ModulePB]

func GetIntegrationModule

func GetIntegrationModule(i Integration) Module

func NewModule

func NewModule(funcs map[string]ModuleFunction, vars map[string]ModuleVariable) Module

type ModuleFunction

type ModuleFunction = *object[*ModuleFunctionPB]

type ModuleFunctionFieldPB

type ModuleFunctionFieldPB = programv1.FunctionField

type ModuleFunctionPB

type ModuleFunctionPB = programv1.Function

type ModulePB

type ModulePB = programv1.Module

type ModuleValue

type ModuleValue = *object[*valuesv1.Module]

func ModuleValueFromProto

func ModuleValueFromProto(pb *valuesv1.Module) (ModuleValue, error)

type ModuleVariable

type ModuleVariable = *object[*ModuleVariablePB]

type ModuleVariablePB

type ModuleVariablePB = programv1.Variable

type Name

type Name = *name

func GetConnectionName

func GetConnectionName(c Connection) Name

func GetEnvName

func GetEnvName(e Env) Name

func GetIntegrationUniqueName

func GetIntegrationUniqueName(i Integration) Name

func GetProjectName

func GetProjectName(p Project) Name

func GetRuntimeName

func GetRuntimeName(r Runtime) Name

func ParseName

func ParseName(h string) (Name, error)

func StrictParseName

func StrictParseName(h string) (Name, error)

type NothingValue

type NothingValue = *object[*valuesv1.Nothing]

type Object

type Object interface {
	// contains filtered or unexported methods
}

func GetRunState

func GetRunState(v RunStatus) Object

func GetValue

func GetValue(v Value) Object

func UnwrapSessionState

func UnwrapSessionState(s SessionState) Object

type ProgramError

type ProgramError = *object[*ProgramErrorPB]

func NewProgramError

func NewProgramError(msg string, callstack []CallFrame, extra map[string]string) (ProgramError, error)

func ProgramErrorFromError

func ProgramErrorFromError(err error) ProgramError

type ProgramErrorAsError

type ProgramErrorAsError struct{ ProgramError }

func (ProgramErrorAsError) Error

func (e ProgramErrorAsError) Error() string

type ProgramErrorPB

type ProgramErrorPB = programv1.Error

type Project

type Project = *object[*ProjectPB]

type ProjectID

type ProjectID = *id[projectIDTraits]

func GetBuildProjectID

func GetBuildProjectID(b Build) ProjectID

func GetConnectionProjectID

func GetConnectionProjectID(c Connection) ProjectID

func GetEnvProjectID

func GetEnvProjectID(e Env) ProjectID

func GetProjectID

func GetProjectID(p Project) ProjectID

func MustParseProjectID

func MustParseProjectID(raw string) ProjectID

func NewProjectID

func NewProjectID() ProjectID

func ParseProjectID

func ParseProjectID(raw string) (ProjectID, error)

func StrictParseProjectID

func StrictParseProjectID(raw string) (ProjectID, error)

type ProjectPB

type ProjectPB = projectv1.Project

type Requirement

type Requirement = *object[*RequirementPB]

func GetBuildArtifactRequirements

func GetBuildArtifactRequirements(p BuildArtifact) []Requirement

func NewRequirement

func NewRequirement(loc CodeLocation, url *url.URL, symbol Symbol) (Requirement, error)

type RequirementPB

type RequirementPB = runtimesv1.Requirement

type RunID

type RunID = *id[runIDTraits]

func GetSessionStateRunID

func GetSessionStateRunID(s SessionState) RunID

func NewRunID

func NewRunID() RunID

func ParseRunID

func ParseRunID(raw string) (RunID, error)

func StrictParseRunID

func StrictParseRunID(raw string) (RunID, error)

type RunStatus

type RunStatus = *object[*RunStatusPB]

func NewRunStatus

func NewRunStatus(v Object) RunStatus

type RunStatusPB

type RunStatusPB = runtimesv1.RunStatus

type RunningRunState

type RunningRunState = *object[*runtimesv1.RunStatus_Running]

type RunningSessionState

type RunningSessionState = *object[*sessionsv1.SessionState_Running]

type Runtime

type Runtime = *object[*RuntimePB]

type RuntimePB

type RuntimePB = runtimesv1.Runtime

type Session

type Session = *object[*SessionPB]

func NewSession

func NewSession(deploymentID DeploymentID, parentSessionID SessionID, eventID EventID, ep CodeLocation, inputs map[string]Value, memo map[string]string) Session

type SessionCall

type SessionCall = *object[*SessionCallPB]

type SessionCallAttemptComplete

type SessionCallAttemptComplete = *object[*SessionCallAttemptCompletePB]

func NewSessionCallAttemptComplete

func NewSessionCallAttemptComplete(last bool, retryInterval time.Duration, result SessionCallAttemptResult) SessionCallAttemptComplete

type SessionCallAttemptCompletePB

type SessionCallAttemptCompletePB = sessionsv1.Call_Attempt_Complete

type SessionCallAttemptResult

type SessionCallAttemptResult = *object[*SessionCallAttemptResultPB]

func NewSessionCallAttemptErrorResult

func NewSessionCallAttemptErrorResult(err error) SessionCallAttemptResult

func NewSessionCallAttemptResult

func NewSessionCallAttemptResult(v Value, err error) SessionCallAttemptResult

func NewSessionCallAttemptValueResult

func NewSessionCallAttemptValueResult(v Value) SessionCallAttemptResult

type SessionCallAttemptResultPB

type SessionCallAttemptResultPB = sessionsv1.Call_Attempt_Result

type SessionCallAttemptStart

type SessionCallAttemptStart = *object[*SessionCallAttemptStartPB]

type SessionCallAttemptStartPB

type SessionCallAttemptStartPB = sessionsv1.Call_Attempt_Start

type SessionCallPB

type SessionCallPB = sessionsv1.Call

type SessionCallSpec

type SessionCallSpec = *object[*SessionCallSpecPB]

func NewSessionCallSpec

func NewSessionCallSpec(v Value, args []Value, kwargs map[string]Value, seq uint32) SessionCallSpec

type SessionCallSpecPB

type SessionCallSpecPB = sessionsv1.Call_Spec

type SessionID

type SessionID = *id[SessionIDTraits]

func GetParentSessionID

func GetParentSessionID(e Session) SessionID

func GetSessionID

func GetSessionID(e Session) SessionID

func NewSessionID

func NewSessionID() SessionID

func ParseSessionID

func ParseSessionID(raw string) (SessionID, error)

func StrictParseSessionID

func StrictParseSessionID(raw string) (SessionID, error)

type SessionIDTraits

type SessionIDTraits struct{}

func (SessionIDTraits) Kind

func (SessionIDTraits) Kind() string

func (SessionIDTraits) ValidateValue

func (SessionIDTraits) ValidateValue(raw string) error

type SessionLog

type SessionLog = *object[*SessionLogPB]

func NewSessionLog

func NewSessionLog(rs []SessionLogRecord) SessionLog

type SessionLogPB

type SessionLogPB = sessionsv1.SessionLog

type SessionLogRecord

type SessionLogRecord = *object[*SessionLogRecordPB]

func NewCallAttemptCompleteSessionLogRecord

func NewCallAttemptCompleteSessionLogRecord(complete SessionCallAttemptComplete) SessionLogRecord

func NewCallAttemptStartSessionLogRecord

func NewCallAttemptStartSessionLogRecord(start SessionCallAttemptStart) SessionLogRecord

func NewCallSpecSessionLogRecord

func NewCallSpecSessionLogRecord(spec SessionCallSpec) SessionLogRecord

func NewPrintSessionLogRecord

func NewPrintSessionLogRecord(print string) SessionLogRecord

func NewSessionLogCallAttemptComplete

func NewSessionLogCallAttemptComplete(spec SessionCallAttemptComplete) SessionLogRecord

func NewSessionLogCallAttemptStart

func NewSessionLogCallAttemptStart(spec SessionCallAttemptStart) SessionLogRecord

func NewSessionLogCallSpec

func NewSessionLogCallSpec(spec SessionCallSpec) SessionLogRecord

func NewSessionLogPrint

func NewSessionLogPrint(print string) SessionLogRecord

func NewSessionLogState

func NewSessionLogState(state SessionState) SessionLogRecord

func NewStateSessionLogRecord

func NewStateSessionLogRecord(state SessionState) SessionLogRecord

type SessionLogRecordPB

type SessionLogRecordPB = sessionsv1.SessionLogRecord

type SessionPB

type SessionPB = sessionsv1.Session

type SessionState

type SessionState = *object[*SessionStatePB]

func GetSessionLogRecordState

func GetSessionLogRecordState(r SessionLogRecord) SessionState

func SessionStateWithTimestamp

func SessionStateWithTimestamp(s SessionState, t time.Time) SessionState

func WrapSessionState

func WrapSessionState(s Object) SessionState

type SessionStatePB

type SessionStatePB = sessionsv1.SessionState // TODO: WrappedState?

type SessionStateType

type SessionStateType sessionsv1.SessionStateType

func GetSessionLatestState

func GetSessionLatestState(e Session) SessionStateType

func GetSessionStateType

func GetSessionStateType(s SessionState) SessionStateType

func ParseSessionStateType

func ParseSessionStateType(raw string) SessionStateType

func (SessionStateType) String

func (s SessionStateType) String() string

func (SessionStateType) ToProto

type SetValue

type SetValue = *object[*valuesv1.Set]

func SetValueFromProto

func SetValueFromProto(pb *valuesv1.Set) (SetValue, error)

type StringValue

type StringValue = *object[*valuesv1.String]

type StructValue

type StructValue = *object[*valuesv1.Struct]

func StructValueFromProto

func StructValueFromProto(pb *valuesv1.Struct) (StructValue, error)

type Symbol

type Symbol = *symbol

func GetEnvVarName

func GetEnvVarName(e EnvVar) Symbol

func GetExportSymbol

func GetExportSymbol(e Export) Symbol

func GetFunctionValueName

func GetFunctionValueName(v Value) Symbol

func GetMappingModuleName

func GetMappingModuleName(m Mapping) Symbol

func GetModuleValue

func GetModuleValue(v Value) (Symbol, map[string]Value)

func GetRequirementSymbol

func GetRequirementSymbol(r Requirement) Symbol

func GetSymbolValue

func GetSymbolValue(v Value) Symbol

func ParseSymbol

func ParseSymbol(s string) (Symbol, error)

func StrictParseSymbol

func StrictParseSymbol(s string) (Symbol, error)

type SymbolValue

type SymbolValue = *object[*valuesv1.Symbol]

type TimeValue

type TimeValue = *object[*valuesv1.Time]

type Value

type Value = *object[*ValuePB]

func GetDictValueKeys

func GetDictValueKeys(v Value) []Value

func GetListValue

func GetListValue(v Value) []Value

func GetSessionCallResultValue

func GetSessionCallResultValue(r SessionCallAttemptResult) Value

func GetSessionStateCallValue

func GetSessionStateCallValue(s SessionState) Value

func GetSetValue

func GetSetValue(v Value) []Value

func GetStructValue

func GetStructValue(v Value) (Value, map[string]Value)

func MustNewValue

func MustNewValue(v Object) Value

func NewDictValue

func NewDictValue(items []*DictValueItem) Value

Creates a new Dict Value. Dictionary items are stored sorted by their string representation of their key.

func NewDictValueFromStringMap

func NewDictValueFromStringMap(kvs map[string]Value) Value

func NewFunctionValue

func NewFunctionValue(xid ExecutorID, name string, data []byte, flags []FunctionFlag, desc ModuleFunction) Value

func NewListValue

func NewListValue(vs []Value) Value

func NewModuleValue

func NewModuleValue(name Symbol, members map[string]Value) Value

func NewSetValue

func NewSetValue(vs []Value) Value

func NewStructValue

func NewStructValue(ctor Value, fields map[string]Value) Value

func NewValue

func NewValue(v Object) (Value, error)

func SessionCallResultAsPair

func SessionCallResultAsPair(r SessionCallAttemptResult) (Value, error)

func StrictValueFromProto

func StrictValueFromProto(pb *ValuePB) (Value, error)

func ValueFromProto

func ValueFromProto(pb *ValuePB) (Value, error)

type ValuePB

type ValuePB = valuesv1.Value

Jump to

Keyboard shortcuts

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