Documentation ¶
Overview ¶
Package execmockserver implements the "net/rpc" based client/server pair which is used by execmock to communicate to/from mock subprocesses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIntercept ¶
ClientIntercept will look for the LUCI_EXECMOCK_CTX environment variable, and, if found, invoke `cb` with an initialized Client as well as the input corresponding to this invocation.
The callback will execute the mock function with the decoded input, and then possibly call Client.SetInvocationOutput.
See go.chromium.org/luci/common/execmock
func RegisterInvocation ¶
func RegisterInvocation[Out any](s *Server, InvocationInput *InvocationInput, outputFn func(Out, string, error)) (string, uint64)
RegisterInvocation registers an invocation and returns an environment variable which can be set for a subprocess which calls `Intercept()`.
Types ¶
type InvocationInput ¶
type InvocationOutput ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetInvocationInput ¶
func (e *Server) GetInvocationInput(invocationID uint64, reply *InvocationInput) error
func (*Server) SetInvocationOutput ¶
func (e *Server) SetInvocationOutput(InvocationOutput *InvocationOutput, none *int) error
Click to show internal directories.
Click to hide internal directories.