Documentation
¶
Overview ¶
Package converter maps between gRPC/proto types and SDK domain types.
Index ¶
- func ApproveAllResultFromProto(r *pb.ApproveAllDraftChunksResponse) *types.ApproveAllResult
- func ApproveResultFromProto(r *pb.ApproveDraftChunkResponse) *types.ApproveResult
- func ClearResultFromProto(r *pb.ClearDraftChunksResponse) *types.ClearResult
- func ComputeDriverInfoFromProto(d *pb.ComputeDriverInfo) types.ComputeDriverInfo
- func ConfigUpdateResultFromProto(resp *pb.UpdateConfigResponse) *v1.ConfigUpdateResult
- func ConfigUpdateToProto(cu *v1.ConfigUpdate) (*pb.UpdateConfigRequest, error)
- func CopyBoolPtr(p *bool) *bool
- func CopyByteSlice(b []byte) []byte
- func CopyInt32Ptr(p *int32) *int32
- func CopyStringMap(m map[string]string) map[string]string
- func CopyStringSlice(s []string) []string
- func CopyUint32Ptr(p *uint32) *uint32
- func CredentialTokenGrantTypeFromProto(t pb.ProviderCredentialTokenGrantType) types.CredentialTokenGrantType
- func CredentialTokenGrantTypeToProto(t types.CredentialTokenGrantType) pb.ProviderCredentialTokenGrantType
- func CurrentUserFromProto(resp *pb.GetCurrentUserResponse) *types.CurrentUser
- func DraftHistoryEntryFromProto(e *pb.DraftHistoryEntry) *types.DraftHistoryEntry
- func DraftPolicyFromProto(r *pb.GetDraftPolicyResponse) *types.DraftPolicy
- func DurationFromSeconds(value uint64) *durationpb.Duration
- func DurationSecondsFromProto(value *durationpb.Duration) uint64
- func EffectiveSettingFromProto(pv *sbv1.EffectiveSetting) *v1.EffectiveSetting
- func ExecChunkFromEvent(event *pb.ExecSandboxEvent) (*types.ExecChunk, int, error)
- func ExecInteractiveRequestToProto(sandboxName string, command []string, cols, rows uint32, ...) *pb.ExecSandboxRequest
- func ExecRequestToProto(sandboxName string, command []string, opts *types.ExecOptions) *pb.ExecSandboxRequest
- func ExecResultFromEvents(events []*pb.ExecSandboxEvent) (*types.ExecResult, error)
- func ExtensionInfoFromProto(extension *pb.NegotiatedExtensionInfo) types.ExtensionInfo
- func ExtensionKindFromProto(kind pb.ExtensionKind) types.ExtensionKind
- func FromGRPCError(err error) error
- func GatewayConfigFromProto(resp *sbv1.GetGatewayConfigResponse) *v1.GatewayConfig
- func GatewayInfoFromProto(resp *pb.GetGatewayInfoResponse) *types.GatewayInfo
- func LogLineFromProto(l *pb.SandboxLogLine) *types.LogLine
- func LogResultFromProto(r *pb.GetSandboxLogsResponse) *types.LogResult
- func MillisFromProto(value *timestamppb.Timestamp) int64
- func MillisFromTime(t time.Time) int64
- func MillisFromTimePtr(t *time.Time) int64
- func NetworkBinaryFromProto(b *sbv1.NetworkBinary) *types.NetworkBinary
- func NetworkBinaryToProto(b *types.NetworkBinary) *sbv1.NetworkBinary
- func NetworkEndpointFromProto(ep *sbv1.NetworkEndpoint) *types.NetworkEndpoint
- func NetworkEndpointToProto(ep *types.NetworkEndpoint) *sbv1.NetworkEndpoint
- func NetworkPolicyRuleFromProto(r *sbv1.NetworkPolicyRule) *types.NetworkPolicyRule
- func NetworkPolicyRuleToProto(r *types.NetworkPolicyRule) *sbv1.NetworkPolicyRule
- func PolicyChunkFromProto(c *pb.PolicyChunk) *types.PolicyChunk
- func PolicyLoadStatusFromProto(s pb.PolicyStatus) types.PolicyLoadStatus
- func PolicyLoadStatusToProto(s types.PolicyLoadStatus) pb.PolicyStatus
- func PolicyMergeOperationToProto(op *v1.PolicyMergeOperation) (*pb.PolicyMergeOperation, error)
- func PolicySourceFromProto(ps sbv1.PolicySource) v1.PolicySource
- func PolicyStatusResultFromProto(r *pb.GetSandboxPolicyStatusResponse) *types.PolicyStatusResult
- func ProfileCategoryFromProto(c pb.ProviderProfileCategory) types.ProfileCategory
- func ProfileCategoryToProto(c types.ProfileCategory) pb.ProviderProfileCategory
- func ProfileCredentialFromProto(c *pb.ProviderProfileCredential) *types.ProfileCredential
- func ProfileCredentialToProto(c *types.ProfileCredential) *pb.ProviderProfileCredential
- func ProfileDiagnosticFromProto(d *pb.ProviderProfileDiagnostic) *types.ProfileDiagnostic
- func ProfileImportItemFromProto(item *pb.ProviderProfileImportItem) *types.ProfileImportItem
- func ProfileImportItemToProto(item *types.ProfileImportItem) *pb.ProviderProfileImportItem
- func ProviderFromProto(p *dm.Provider) *types.Provider
- func ProviderProfileFromProto(p *pb.ProviderProfile) *types.ProviderProfile
- func ProviderProfileToProto(p *types.ProviderProfile) *pb.ProviderProfile
- func ProviderToProto(p *types.Provider) *dm.Provider
- func RefreshConfigToProto(c *types.RefreshConfig) *pb.ConfigureProviderRefreshRequest
- func RefreshRecoveryActionFromProto(a pb.ProviderCredentialRefreshRecoveryAction) types.RefreshRecoveryAction
- func RefreshStatusFromProto(s *pb.ProviderCredentialRefreshStatus) *types.RefreshStatus
- func RefreshStrategyFromProto(s pb.ProviderCredentialRefreshStrategy) types.RefreshStrategy
- func RefreshStrategyToProto(s types.RefreshStrategy) pb.ProviderCredentialRefreshStrategy
- func SSHSessionFromProto(resp *pb.CreateSshSessionResponse) *v1.SSHSession
- func SSHSessionToProto(session *v1.SSHSession) *pb.CreateSshSessionResponse
- func SandboxConfigFromProto(resp *sbv1.GetSandboxConfigResponse) *v1.SandboxConfig
- func SandboxFromProto(s *pb.Sandbox) *types.Sandbox
- func SandboxPhaseFromProto(phase pb.SandboxPhase) types.SandboxPhase
- func SandboxPhaseToProto(phase types.SandboxPhase) pb.SandboxPhase
- func SandboxPolicyFromProto(p *sbv1.SandboxPolicy) *types.SandboxPolicy
- func SandboxPolicyRevisionFromProto(r *pb.SandboxPolicyRevision) *types.SandboxPolicyRevision
- func SandboxPolicyToProto(p *types.SandboxPolicy) *sbv1.SandboxPolicy
- func SandboxPolicyToProtoChecked(p *types.SandboxPolicy) (*sbv1.SandboxPolicy, error)
- func SandboxResourcesFromProto(resources *pb.SandboxResources) *types.SandboxResources
- func SandboxResourcesToProto(resources *types.SandboxResources) *pb.SandboxResources
- func SandboxRestartPolicyFromProto(policy pb.SandboxRestartPolicy) types.SandboxRestartPolicy
- func SandboxRestartPolicyToProto(policy types.SandboxRestartPolicy) pb.SandboxRestartPolicy
- func SandboxServiceLevelFromProto(level *pb.SandboxServiceLevel) *types.SandboxServiceLevel
- func SandboxServiceLevelToProto(level *types.SandboxServiceLevel) *pb.SandboxServiceLevel
- func SandboxSpecToProto(spec *types.SandboxSpec) *pb.SandboxSpec
- func SandboxSpecToProtoChecked(spec *types.SandboxSpec) (*pb.SandboxSpec, error)
- func SandboxStartupFromProto(startup *pb.SandboxStartup) *types.SandboxStartup
- func SandboxStartupToProto(startup *types.SandboxStartup) *pb.SandboxStartup
- func SandboxToProto(s *types.Sandbox) *pb.Sandbox
- func SandboxWorkloadConfigFromProto(workload *pb.SandboxWorkloadConfig) *types.SandboxWorkloadConfig
- func SandboxWorkloadConfigToProto(workload *types.SandboxWorkloadConfig) *pb.SandboxWorkloadConfig
- func SandboxWorkloadTemplateFromProto(t *pb.SandboxWorkloadTemplate) *types.SandboxWorkloadTemplate
- func SandboxWorkloadTemplateSpecFromProto(spec *pb.SandboxWorkloadTemplateSpec) types.SandboxWorkloadTemplateSpec
- func SandboxWorkloadTemplateSpecToProto(spec *types.SandboxWorkloadTemplateSpec) *pb.SandboxWorkloadTemplateSpec
- func SandboxWorkloadTemplateToProto(t *types.SandboxWorkloadTemplate) *pb.SandboxWorkloadTemplate
- func SandboxWorkloadTemplateToProtoChecked(t *types.SandboxWorkloadTemplate) (*pb.SandboxWorkloadTemplate, error)
- func ServiceEndpointFromProto(resp *pb.ServiceEndpointResponse) *types.ServiceEndpoint
- func ServiceEndpointToProto(se *types.ServiceEndpoint) *pb.ServiceEndpointResponse
- func ServiceStatusFromProto(status pb.ServiceStatus) types.ServiceStatus
- func SettingScopeFromProto(ps sbv1.SettingScope) v1.SettingScope
- func SettingScopeToProto(s v1.SettingScope) sbv1.SettingScope
- func SettingValueFromProto(pv *sbv1.SettingValue) *v1.SettingValue
- func SettingValueToProto(sv *v1.SettingValue) *sbv1.SettingValue
- func TimeFromMillis(ms int64) time.Time
- func TimeFromMillisPtr(ms int64) *time.Time
- func TimeFromProto(value *timestamppb.Timestamp) time.Time
- func TimePtrFromProto(value *timestamppb.Timestamp) *time.Time
- func TimestampFromMillis(value int64) *timestamppb.Timestamp
- func TimestampFromTime(value time.Time) *timestamppb.Timestamp
- func TimestampFromTimePtr(value *time.Time) *timestamppb.Timestamp
- func TimestampStringFromProto(value *timestamppb.Timestamp) string
- func UndoResultFromProto(r *pb.UndoDraftChunkResponse) *types.UndoResult
- func WorkspaceFromProto(w *dm.Workspace) *types.Workspace
- func WorkspaceMemberFromProto(m *pb.WorkspaceMember) *types.WorkspaceMember
- func WorkspacePhaseFromProto(phase dm.WorkspacePhase) types.WorkspacePhase
- func WorkspaceRoleFromProto(role pb.WorkspaceRole) types.WorkspaceRole
- func WorkspaceRoleToProto(role types.WorkspaceRole) pb.WorkspaceRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproveAllResultFromProto ¶
func ApproveAllResultFromProto(r *pb.ApproveAllDraftChunksResponse) *types.ApproveAllResult
ApproveAllResultFromProto converts a proto ApproveAllDraftChunksResponse to an SDK ApproveAllResult.
func ApproveResultFromProto ¶
func ApproveResultFromProto(r *pb.ApproveDraftChunkResponse) *types.ApproveResult
ApproveResultFromProto converts a proto ApproveDraftChunkResponse to an SDK ApproveResult.
func ClearResultFromProto ¶
func ClearResultFromProto(r *pb.ClearDraftChunksResponse) *types.ClearResult
ClearResultFromProto converts a proto ClearDraftChunksResponse to an SDK ClearResult.
func ComputeDriverInfoFromProto ¶
func ComputeDriverInfoFromProto(d *pb.ComputeDriverInfo) types.ComputeDriverInfo
ComputeDriverInfoFromProto converts a proto ComputeDriverInfo to an SDK ComputeDriverInfo.
func ConfigUpdateResultFromProto ¶
func ConfigUpdateResultFromProto(resp *pb.UpdateConfigResponse) *v1.ConfigUpdateResult
ConfigUpdateResultFromProto converts an UpdateConfigResponse to an SDK ConfigUpdateResult.
func ConfigUpdateToProto ¶
func ConfigUpdateToProto(cu *v1.ConfigUpdate) (*pb.UpdateConfigRequest, error)
ConfigUpdateToProto converts an SDK ConfigUpdate to an UpdateConfigRequest.
func CopyBoolPtr ¶
CopyBoolPtr returns a copy of a *bool pointer. Returns nil for nil input.
func CopyByteSlice ¶
CopyByteSlice returns a copy of a byte slice. Returns nil for nil input.
func CopyInt32Ptr ¶
CopyInt32Ptr returns a copy of an *int32 pointer.
func CopyStringMap ¶
CopyStringMap returns a shallow copy of a string-to-string map. Returns nil for nil input.
func CopyStringSlice ¶
CopyStringSlice returns a copy of a string slice. Returns nil for nil input.
func CopyUint32Ptr ¶
CopyUint32Ptr returns a copy of a *uint32 pointer.
func CredentialTokenGrantTypeFromProto ¶
func CredentialTokenGrantTypeFromProto(t pb.ProviderCredentialTokenGrantType) types.CredentialTokenGrantType
CredentialTokenGrantTypeFromProto converts a proto token grant type to an SDK token grant type.
func CredentialTokenGrantTypeToProto ¶
func CredentialTokenGrantTypeToProto(t types.CredentialTokenGrantType) pb.ProviderCredentialTokenGrantType
CredentialTokenGrantTypeToProto converts an SDK token grant type to a proto token grant type.
func CurrentUserFromProto ¶
func CurrentUserFromProto(resp *pb.GetCurrentUserResponse) *types.CurrentUser
CurrentUserFromProto converts a proto GetCurrentUserResponse to an SDK CurrentUser.
func DraftHistoryEntryFromProto ¶
func DraftHistoryEntryFromProto(e *pb.DraftHistoryEntry) *types.DraftHistoryEntry
DraftHistoryEntryFromProto converts a proto DraftHistoryEntry to an SDK DraftHistoryEntry.
func DraftPolicyFromProto ¶
func DraftPolicyFromProto(r *pb.GetDraftPolicyResponse) *types.DraftPolicy
DraftPolicyFromProto converts a proto GetDraftPolicyResponse to an SDK DraftPolicy.
func DurationFromSeconds ¶
func DurationFromSeconds(value uint64) *durationpb.Duration
DurationFromSeconds converts non-zero seconds to a protobuf duration.
func DurationSecondsFromProto ¶
func DurationSecondsFromProto(value *durationpb.Duration) uint64
DurationSecondsFromProto converts a valid non-negative protobuf duration to seconds.
func EffectiveSettingFromProto ¶
func EffectiveSettingFromProto(pv *sbv1.EffectiveSetting) *v1.EffectiveSetting
EffectiveSettingFromProto converts a proto EffectiveSetting to an SDK EffectiveSetting.
func ExecChunkFromEvent ¶
ExecChunkFromEvent converts a proto ExecSandboxEvent to an ExecChunk and/or exit code. For stdout/stderr events, returns the chunk with exitCode -1. For exit events, returns nil chunk with the exit code.
func ExecInteractiveRequestToProto ¶
func ExecInteractiveRequestToProto(sandboxName string, command []string, cols, rows uint32, opts *types.ExecOptions) *pb.ExecSandboxRequest
ExecInteractiveRequestToProto builds a proto ExecSandboxRequest for Interactive mode.
func ExecRequestToProto ¶
func ExecRequestToProto(sandboxName string, command []string, opts *types.ExecOptions) *pb.ExecSandboxRequest
ExecRequestToProto builds a proto ExecSandboxRequest for Run/Stream modes.
func ExecResultFromEvents ¶
func ExecResultFromEvents(events []*pb.ExecSandboxEvent) (*types.ExecResult, error)
ExecResultFromEvents collects a sequence of ExecSandboxEvents into an ExecResult.
func ExtensionInfoFromProto ¶
func ExtensionInfoFromProto(extension *pb.NegotiatedExtensionInfo) types.ExtensionInfo
ExtensionInfoFromProto converts a negotiated extension snapshot.
func ExtensionKindFromProto ¶
func ExtensionKindFromProto(kind pb.ExtensionKind) types.ExtensionKind
ExtensionKindFromProto converts the public extension family enum.
func FromGRPCError ¶
FromGRPCError converts a gRPC error to a typed StatusError. Returns nil for nil errors and OK status. Non-gRPC errors pass through unchanged.
func GatewayConfigFromProto ¶
func GatewayConfigFromProto(resp *sbv1.GetGatewayConfigResponse) *v1.GatewayConfig
GatewayConfigFromProto converts a GetGatewayConfigResponse to an SDK GatewayConfig.
func GatewayInfoFromProto ¶
func GatewayInfoFromProto(resp *pb.GetGatewayInfoResponse) *types.GatewayInfo
GatewayInfoFromProto converts a proto GetGatewayInfoResponse to an SDK GatewayInfo.
func LogLineFromProto ¶
func LogLineFromProto(l *pb.SandboxLogLine) *types.LogLine
LogLineFromProto converts a proto SandboxLogLine to an SDK LogLine.
func LogResultFromProto ¶
func LogResultFromProto(r *pb.GetSandboxLogsResponse) *types.LogResult
LogResultFromProto converts a proto GetSandboxLogsResponse to an SDK LogResult.
func MillisFromProto ¶
func MillisFromProto(value *timestamppb.Timestamp) int64
MillisFromProto converts a valid protobuf timestamp to Unix milliseconds.
func MillisFromTime ¶
MillisFromTime converts a time.Time to a millisecond epoch timestamp. A zero time returns 0.
func MillisFromTimePtr ¶
MillisFromTimePtr converts a *time.Time to a millisecond epoch timestamp. A nil pointer returns 0.
func NetworkBinaryFromProto ¶
func NetworkBinaryFromProto(b *sbv1.NetworkBinary) *types.NetworkBinary
NetworkBinaryFromProto converts a proto NetworkBinary to an SDK NetworkBinary.
func NetworkBinaryToProto ¶
func NetworkBinaryToProto(b *types.NetworkBinary) *sbv1.NetworkBinary
NetworkBinaryToProto converts an SDK NetworkBinary to a proto NetworkBinary.
func NetworkEndpointFromProto ¶
func NetworkEndpointFromProto(ep *sbv1.NetworkEndpoint) *types.NetworkEndpoint
NetworkEndpointFromProto converts a proto NetworkEndpoint to an SDK NetworkEndpoint. Only Host, Port, and Protocol are mapped; additional proto fields are ignored.
func NetworkEndpointToProto ¶
func NetworkEndpointToProto(ep *types.NetworkEndpoint) *sbv1.NetworkEndpoint
NetworkEndpointToProto converts an SDK NetworkEndpoint to a proto NetworkEndpoint.
func NetworkPolicyRuleFromProto ¶
func NetworkPolicyRuleFromProto(r *sbv1.NetworkPolicyRule) *types.NetworkPolicyRule
NetworkPolicyRuleFromProto converts a proto NetworkPolicyRule to an SDK NetworkPolicyRule.
func NetworkPolicyRuleToProto ¶
func NetworkPolicyRuleToProto(r *types.NetworkPolicyRule) *sbv1.NetworkPolicyRule
NetworkPolicyRuleToProto converts an SDK NetworkPolicyRule to a proto NetworkPolicyRule.
func PolicyChunkFromProto ¶
func PolicyChunkFromProto(c *pb.PolicyChunk) *types.PolicyChunk
PolicyChunkFromProto converts a proto PolicyChunk to an SDK PolicyChunk.
func PolicyLoadStatusFromProto ¶
func PolicyLoadStatusFromProto(s pb.PolicyStatus) types.PolicyLoadStatus
PolicyLoadStatusFromProto converts a proto PolicyStatus to an SDK PolicyLoadStatus.
func PolicyLoadStatusToProto ¶
func PolicyLoadStatusToProto(s types.PolicyLoadStatus) pb.PolicyStatus
PolicyLoadStatusToProto converts an SDK PolicyLoadStatus to a proto PolicyStatus.
func PolicyMergeOperationToProto ¶
func PolicyMergeOperationToProto(op *v1.PolicyMergeOperation) (*pb.PolicyMergeOperation, error)
PolicyMergeOperationToProto converts an SDK PolicyMergeOperation to a proto PolicyMergeOperation. Exactly one of the pointer fields must be non-nil. Returns an error if zero or multiple are set.
func PolicySourceFromProto ¶
func PolicySourceFromProto(ps sbv1.PolicySource) v1.PolicySource
PolicySourceFromProto converts a proto PolicySource enum to an SDK PolicySource.
func PolicyStatusResultFromProto ¶
func PolicyStatusResultFromProto(r *pb.GetSandboxPolicyStatusResponse) *types.PolicyStatusResult
PolicyStatusResultFromProto converts a proto GetSandboxPolicyStatusResponse to an SDK PolicyStatusResult.
func ProfileCategoryFromProto ¶
func ProfileCategoryFromProto(c pb.ProviderProfileCategory) types.ProfileCategory
ProfileCategoryFromProto converts a proto ProviderProfileCategory to an SDK ProfileCategory.
func ProfileCategoryToProto ¶
func ProfileCategoryToProto(c types.ProfileCategory) pb.ProviderProfileCategory
ProfileCategoryToProto converts an SDK ProfileCategory to a proto ProviderProfileCategory.
func ProfileCredentialFromProto ¶
func ProfileCredentialFromProto(c *pb.ProviderProfileCredential) *types.ProfileCredential
ProfileCredentialFromProto converts a proto ProviderProfileCredential to an SDK ProfileCredential. Secret is derived from whether the proto has a Refresh configuration.
func ProfileCredentialToProto ¶
func ProfileCredentialToProto(c *types.ProfileCredential) *pb.ProviderProfileCredential
ProfileCredentialToProto converts an SDK ProfileCredential to a proto ProviderProfileCredential.
func ProfileDiagnosticFromProto ¶
func ProfileDiagnosticFromProto(d *pb.ProviderProfileDiagnostic) *types.ProfileDiagnostic
ProfileDiagnosticFromProto converts a proto ProviderProfileDiagnostic to an SDK ProfileDiagnostic.
func ProfileImportItemFromProto ¶
func ProfileImportItemFromProto(item *pb.ProviderProfileImportItem) *types.ProfileImportItem
ProfileImportItemFromProto converts a proto ProviderProfileImportItem to an SDK ProfileImportItem.
func ProfileImportItemToProto ¶
func ProfileImportItemToProto(item *types.ProfileImportItem) *pb.ProviderProfileImportItem
ProfileImportItemToProto converts an SDK ProfileImportItem to a proto ProviderProfileImportItem.
func ProviderFromProto ¶
ProviderFromProto converts a proto Provider to an SDK Provider.
func ProviderProfileFromProto ¶
func ProviderProfileFromProto(p *pb.ProviderProfile) *types.ProviderProfile
ProviderProfileFromProto converts a proto ProviderProfile to an SDK ProviderProfile.
func ProviderProfileToProto ¶
func ProviderProfileToProto(p *types.ProviderProfile) *pb.ProviderProfile
ProviderProfileToProto converts an SDK ProviderProfile to a proto ProviderProfile.
func ProviderToProto ¶
ProviderToProto converts an SDK Provider to a proto Provider.
func RefreshConfigToProto ¶
func RefreshConfigToProto(c *types.RefreshConfig) *pb.ConfigureProviderRefreshRequest
RefreshConfigToProto converts an SDK RefreshConfig to a proto ConfigureProviderRefreshRequest. Material and SecretMaterialKeys are deep-copied.
func RefreshRecoveryActionFromProto ¶
func RefreshRecoveryActionFromProto(a pb.ProviderCredentialRefreshRecoveryAction) types.RefreshRecoveryAction
RefreshRecoveryActionFromProto converts a proto recovery action to the curated SDK type.
func RefreshStatusFromProto ¶
func RefreshStatusFromProto(s *pb.ProviderCredentialRefreshStatus) *types.RefreshStatus
RefreshStatusFromProto converts a proto ProviderCredentialRefreshStatus to an SDK RefreshStatus.
func RefreshStrategyFromProto ¶
func RefreshStrategyFromProto(s pb.ProviderCredentialRefreshStrategy) types.RefreshStrategy
RefreshStrategyFromProto converts a proto ProviderCredentialRefreshStrategy to an SDK RefreshStrategy.
func RefreshStrategyToProto ¶
func RefreshStrategyToProto(s types.RefreshStrategy) pb.ProviderCredentialRefreshStrategy
RefreshStrategyToProto converts an SDK RefreshStrategy to a proto ProviderCredentialRefreshStrategy.
func SSHSessionFromProto ¶
func SSHSessionFromProto(resp *pb.CreateSshSessionResponse) *v1.SSHSession
SSHSessionFromProto converts a CreateSshSessionResponse to an SSHSession.
func SSHSessionToProto ¶
func SSHSessionToProto(session *v1.SSHSession) *pb.CreateSshSessionResponse
SSHSessionToProto converts an SSHSession to a CreateSshSessionResponse. This is primarily used for round-trip testing and fake implementations.
func SandboxConfigFromProto ¶
func SandboxConfigFromProto(resp *sbv1.GetSandboxConfigResponse) *v1.SandboxConfig
SandboxConfigFromProto converts a GetSandboxConfigResponse to an SDK SandboxConfig.
func SandboxFromProto ¶
SandboxFromProto converts a proto Sandbox to an SDK Sandbox.
func SandboxPhaseFromProto ¶
func SandboxPhaseFromProto(phase pb.SandboxPhase) types.SandboxPhase
SandboxPhaseFromProto converts a proto SandboxPhase to an SDK SandboxPhase.
func SandboxPhaseToProto ¶
func SandboxPhaseToProto(phase types.SandboxPhase) pb.SandboxPhase
SandboxPhaseToProto converts an SDK SandboxPhase to a proto SandboxPhase.
func SandboxPolicyFromProto ¶
func SandboxPolicyFromProto(p *sbv1.SandboxPolicy) *types.SandboxPolicy
SandboxPolicyFromProto converts a proto SandboxPolicy to an SDK SandboxPolicy. Returns nil for nil input. All slice and map fields are deep-copied.
func SandboxPolicyRevisionFromProto ¶
func SandboxPolicyRevisionFromProto(r *pb.SandboxPolicyRevision) *types.SandboxPolicyRevision
SandboxPolicyRevisionFromProto converts a proto SandboxPolicyRevision to an SDK SandboxPolicyRevision.
func SandboxPolicyToProto ¶
func SandboxPolicyToProto(p *types.SandboxPolicy) *sbv1.SandboxPolicy
SandboxPolicyToProto converts an SDK SandboxPolicy to a proto SandboxPolicy. Returns nil for nil input. All slice and map fields are deep-copied.
func SandboxPolicyToProtoChecked ¶
func SandboxPolicyToProtoChecked(p *types.SandboxPolicy) (*sbv1.SandboxPolicy, error)
SandboxPolicyToProtoChecked converts middleware configuration without silently discarding values unsupported by protobuf Struct.
func SandboxResourcesFromProto ¶
func SandboxResourcesFromProto(resources *pb.SandboxResources) *types.SandboxResources
SandboxResourcesFromProto converts portable resource requirements.
func SandboxResourcesToProto ¶
func SandboxResourcesToProto(resources *types.SandboxResources) *pb.SandboxResources
SandboxResourcesToProto converts portable resource requirements.
func SandboxRestartPolicyFromProto ¶
func SandboxRestartPolicyFromProto(policy pb.SandboxRestartPolicy) types.SandboxRestartPolicy
SandboxRestartPolicyFromProto converts the restart policy to the curated SDK type.
func SandboxRestartPolicyToProto ¶
func SandboxRestartPolicyToProto(policy types.SandboxRestartPolicy) pb.SandboxRestartPolicy
SandboxRestartPolicyToProto converts the curated SDK restart policy to protobuf.
func SandboxServiceLevelFromProto ¶
func SandboxServiceLevelFromProto(level *pb.SandboxServiceLevel) *types.SandboxServiceLevel
SandboxServiceLevelFromProto converts template service-level hints.
func SandboxServiceLevelToProto ¶
func SandboxServiceLevelToProto(level *types.SandboxServiceLevel) *pb.SandboxServiceLevel
SandboxServiceLevelToProto converts template service-level hints.
func SandboxSpecToProto ¶
func SandboxSpecToProto(spec *types.SandboxSpec) *pb.SandboxSpec
SandboxSpecToProto converts an SDK SandboxSpec to a proto SandboxSpec.
func SandboxSpecToProtoChecked ¶
func SandboxSpecToProtoChecked(spec *types.SandboxSpec) (*pb.SandboxSpec, error)
SandboxSpecToProtoChecked converts an SDK SandboxSpec and reports values that protobuf Struct cannot represent instead of silently dropping them.
func SandboxStartupFromProto ¶
func SandboxStartupFromProto(startup *pb.SandboxStartup) *types.SandboxStartup
SandboxStartupFromProto converts startup service-level hints.
func SandboxStartupToProto ¶
func SandboxStartupToProto(startup *types.SandboxStartup) *pb.SandboxStartup
SandboxStartupToProto converts startup service-level hints.
func SandboxToProto ¶
SandboxToProto converts an SDK Sandbox to a proto Sandbox.
func SandboxWorkloadConfigFromProto ¶
func SandboxWorkloadConfigFromProto(workload *pb.SandboxWorkloadConfig) *types.SandboxWorkloadConfig
SandboxWorkloadConfigFromProto converts a portable workload proto.
func SandboxWorkloadConfigToProto ¶
func SandboxWorkloadConfigToProto(workload *types.SandboxWorkloadConfig) *pb.SandboxWorkloadConfig
SandboxWorkloadConfigToProto converts an SDK portable workload to proto.
func SandboxWorkloadTemplateFromProto ¶
func SandboxWorkloadTemplateFromProto(t *pb.SandboxWorkloadTemplate) *types.SandboxWorkloadTemplate
SandboxWorkloadTemplateFromProto converts a reusable template proto to an SDK template.
func SandboxWorkloadTemplateSpecFromProto ¶
func SandboxWorkloadTemplateSpecFromProto(spec *pb.SandboxWorkloadTemplateSpec) types.SandboxWorkloadTemplateSpec
SandboxWorkloadTemplateSpecFromProto converts a reusable template spec proto.
func SandboxWorkloadTemplateSpecToProto ¶
func SandboxWorkloadTemplateSpecToProto(spec *types.SandboxWorkloadTemplateSpec) *pb.SandboxWorkloadTemplateSpec
SandboxWorkloadTemplateSpecToProto converts an SDK reusable template spec to proto.
func SandboxWorkloadTemplateToProto ¶
func SandboxWorkloadTemplateToProto(t *types.SandboxWorkloadTemplate) *pb.SandboxWorkloadTemplate
SandboxWorkloadTemplateToProto converts an SDK reusable template to proto.
func SandboxWorkloadTemplateToProtoChecked ¶
func SandboxWorkloadTemplateToProtoChecked(t *types.SandboxWorkloadTemplate) (*pb.SandboxWorkloadTemplate, error)
SandboxWorkloadTemplateToProtoChecked converts an SDK reusable template and reports driver config values that protobuf Struct cannot represent.
func ServiceEndpointFromProto ¶
func ServiceEndpointFromProto(resp *pb.ServiceEndpointResponse) *types.ServiceEndpoint
ServiceEndpointFromProto converts a proto ServiceEndpointResponse to an SDK ServiceEndpoint. The response flattens the nested Endpoint and top-level URL into a single SDK type.
func ServiceEndpointToProto ¶
func ServiceEndpointToProto(se *types.ServiceEndpoint) *pb.ServiceEndpointResponse
ServiceEndpointToProto converts an SDK ServiceEndpoint to a proto ServiceEndpointResponse.
func ServiceStatusFromProto ¶
func ServiceStatusFromProto(status pb.ServiceStatus) types.ServiceStatus
ServiceStatusFromProto converts a proto ServiceStatus to an SDK ServiceStatus.
func SettingScopeFromProto ¶
func SettingScopeFromProto(ps sbv1.SettingScope) v1.SettingScope
SettingScopeFromProto converts a proto SettingScope enum to an SDK SettingScope.
func SettingScopeToProto ¶
func SettingScopeToProto(s v1.SettingScope) sbv1.SettingScope
SettingScopeToProto converts an SDK SettingScope to a proto SettingScope enum.
func SettingValueFromProto ¶
func SettingValueFromProto(pv *sbv1.SettingValue) *v1.SettingValue
SettingValueFromProto converts a proto SettingValue (oneof) to an SDK SettingValue.
func SettingValueToProto ¶
func SettingValueToProto(sv *v1.SettingValue) *sbv1.SettingValue
SettingValueToProto converts an SDK SettingValue to a proto SettingValue (oneof).
func TimeFromMillis ¶
TimeFromMillis converts a millisecond epoch timestamp to time.Time. A zero value returns the zero time.
func TimeFromMillisPtr ¶
TimeFromMillisPtr converts a millisecond epoch timestamp to a *time.Time. A zero value returns nil (the resource is not being deleted).
func TimeFromProto ¶
func TimeFromProto(value *timestamppb.Timestamp) time.Time
TimeFromProto converts a valid protobuf timestamp to UTC time.
func TimePtrFromProto ¶
func TimePtrFromProto(value *timestamppb.Timestamp) *time.Time
TimePtrFromProto converts a valid protobuf timestamp to a UTC time pointer.
func TimestampFromMillis ¶
func TimestampFromMillis(value int64) *timestamppb.Timestamp
TimestampFromMillis converts non-zero Unix milliseconds to a protobuf timestamp.
func TimestampFromTime ¶
func TimestampFromTime(value time.Time) *timestamppb.Timestamp
TimestampFromTime converts a non-zero time to a protobuf timestamp.
func TimestampFromTimePtr ¶
func TimestampFromTimePtr(value *time.Time) *timestamppb.Timestamp
TimestampFromTimePtr converts a non-nil time pointer to a protobuf timestamp.
func TimestampStringFromProto ¶
func TimestampStringFromProto(value *timestamppb.Timestamp) string
TimestampStringFromProto formats a valid protobuf timestamp as RFC 3339.
func UndoResultFromProto ¶
func UndoResultFromProto(r *pb.UndoDraftChunkResponse) *types.UndoResult
UndoResultFromProto converts a proto UndoDraftChunkResponse to an SDK UndoResult.
func WorkspaceFromProto ¶
WorkspaceFromProto converts a proto Workspace to an SDK Workspace.
func WorkspaceMemberFromProto ¶
func WorkspaceMemberFromProto(m *pb.WorkspaceMember) *types.WorkspaceMember
WorkspaceMemberFromProto converts a proto WorkspaceMember to an SDK WorkspaceMember.
func WorkspacePhaseFromProto ¶
func WorkspacePhaseFromProto(phase dm.WorkspacePhase) types.WorkspacePhase
WorkspacePhaseFromProto converts a proto WorkspacePhase to an SDK WorkspacePhase.
func WorkspaceRoleFromProto ¶
func WorkspaceRoleFromProto(role pb.WorkspaceRole) types.WorkspaceRole
WorkspaceRoleFromProto converts a proto WorkspaceRole to an SDK WorkspaceRole.
func WorkspaceRoleToProto ¶
func WorkspaceRoleToProto(role types.WorkspaceRole) pb.WorkspaceRole
WorkspaceRoleToProto converts an SDK WorkspaceRole to a proto WorkspaceRole.
Types ¶
This section is empty.