MCPcopy Index your code
hub / github.com/coder/coder / ProtoFromLifecycleState

Function ProtoFromLifecycleState

codersdk/agentsdk/convert.go:411–417  ·  view source on GitHub ↗
(s codersdk.WorkspaceAgentLifecycle)

Source from the content-addressed store, hash-verified

409}
410
411func ProtoFromLifecycleState(s codersdk.WorkspaceAgentLifecycle) (proto.Lifecycle_State, error) {
412 caps, ok := proto.Lifecycle_State_value[strings.ToUpper(string(s))]
413 if !ok {
414 return 0, xerrors.Errorf("unknown lifecycle state: %s", s)
415 }
416 return proto.Lifecycle_State(caps), nil
417}
418
419func DevcontainersFromProto(pdcs []*proto.WorkspaceAgentDevcontainer) ([]codersdk.WorkspaceAgentDevcontainer, error) {
420 ret := make([]codersdk.WorkspaceAgentDevcontainer, len(pdcs))

Callers 1

Calls 2

Lifecycle_StateTypeAlias · 0.92
ErrorfMethod · 0.45

Tested by 1