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

Function AgentScriptsFromProto

codersdk/agentsdk/convert.go:165–175  ·  view source on GitHub ↗
(protoScripts []*proto.WorkspaceAgentScript)

Source from the content-addressed store, hash-verified

163}
164
165func AgentScriptsFromProto(protoScripts []*proto.WorkspaceAgentScript) ([]codersdk.WorkspaceAgentScript, error) {
166 ret := make([]codersdk.WorkspaceAgentScript, len(protoScripts))
167 for i, protoScript := range protoScripts {
168 app, err := AgentScriptFromProto(protoScript)
169 if err != nil {
170 return nil, xerrors.Errorf("parse script %v: %w", i, err)
171 }
172 ret[i] = app
173 }
174 return ret, nil
175}
176
177func ProtoFromScripts(scripts []codersdk.WorkspaceAgentScript) []*proto.WorkspaceAgentScript {
178 ret := make([]*proto.WorkspaceAgentScript, len(scripts))

Callers 1

ManifestFromProtoFunction · 0.85

Calls 2

AgentScriptFromProtoFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected