Documentation
¶
Index ¶
- Constants
- func NewCodeHandler(svc CodeHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type CodeClient
- type CodeHandler
- type UnimplementedCodeHandler
- func (UnimplementedCodeHandler) ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
- func (UnimplementedCodeHandler) Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
- func (UnimplementedCodeHandler) ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)
Constants ¶
const ( // CodeExecuteProcedure is the fully-qualified name of the Code's Execute RPC. CodeExecuteProcedure = "/codefly.services.code.v0.Code/Execute" // CodeApplyEditProcedure is the fully-qualified name of the Code's ApplyEdit RPC. CodeApplyEditProcedure = "/codefly.services.code.v0.Code/ApplyEdit" // CodeShellExecProcedure is the fully-qualified name of the Code's ShellExec RPC. CodeShellExecProcedure = "/codefly.services.code.v0.Code/ShellExec" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// CodeName is the fully-qualified name of the Code service.
CodeName = "codefly.services.code.v0.Code"
)
Variables ¶
This section is empty.
Functions ¶
func NewCodeHandler ¶
func NewCodeHandler(svc CodeHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewCodeHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type CodeClient ¶
type CodeClient interface {
// Execute is the unified dispatch entry point for every code operation.
// Clients wrap the specific request type in a CodeRequest oneof; the
// plugin's Execute handler unwraps and dispatches the operation.
Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
// ApplyEdit directly exposes smart edits for older CLI callers.
ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
// ShellExec is the one sanctioned path for running shell commands
// against a workspace. Clients call this instead of os/exec so all
// process spawning crosses the plugin boundary (the agent).
ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)
}
CodeClient is a client for the codefly.services.code.v0.Code service.
func NewCodeClient ¶
func NewCodeClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CodeClient
NewCodeClient constructs a client for the codefly.services.code.v0.Code service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type CodeHandler ¶
type CodeHandler interface {
// Execute is the unified dispatch entry point for every code operation.
// Clients wrap the specific request type in a CodeRequest oneof; the
// plugin's Execute handler unwraps and dispatches the operation.
Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
// ApplyEdit directly exposes smart edits for older CLI callers.
ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
// ShellExec is the one sanctioned path for running shell commands
// against a workspace. Clients call this instead of os/exec so all
// process spawning crosses the plugin boundary (the agent).
ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)
}
CodeHandler is an implementation of the codefly.services.code.v0.Code service.
type UnimplementedCodeHandler ¶
type UnimplementedCodeHandler struct{}
UnimplementedCodeHandler returns CodeUnimplemented from all methods.
func (UnimplementedCodeHandler) ApplyEdit ¶
func (UnimplementedCodeHandler) ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
func (UnimplementedCodeHandler) Execute ¶
func (UnimplementedCodeHandler) Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
func (UnimplementedCodeHandler) ShellExec ¶
func (UnimplementedCodeHandler) ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)