Documentation ¶
Index ¶
- Constants
- func MakeShellService(service mrpc.Service) (mrpc.Service, error)
- func MessageToRequest(msg mongowire.Message, out interface{}) error
- func MessageToResponse(msg mongowire.Message, out interface{}) error
- func NewShellService(host string, port int) (mrpc.Service, error)
- func RequestToMessage(t mongowire.OpType, req interface{}) (mongowire.Message, error)
- func ResponseToMessage(t mongowire.OpType, resp interface{}) (mongowire.Message, error)
- func WriteErrorResponse(ctx context.Context, w io.Writer, t mongowire.OpType, err error, op string)
- func WriteNotOKResponse(ctx context.Context, w io.Writer, t mongowire.OpType, op string)
- func WriteOKResponse(ctx context.Context, w io.Writer, t mongowire.OpType, op string)
- func WriteResponse(ctx context.Context, w io.Writer, resp mongowire.Message, op string)
- type ErrorResponse
Constants ¶
const (
BuildinfoCommand = "buildinfo"
)
Constants representing required shell commands.
Variables ¶
This section is empty.
Functions ¶
func MakeShellService ¶
MakeShellService takes an existing mrpc.Service and adds support for mongo shell clients.
func MessageToRequest ¶
MessageToRequest converts a mongowire.Message into a request
func MessageToResponse ¶
MessageToResponse converts a mongowire.Message into a response.
func NewShellService ¶
NewShellService returns a service for mongo shell clients listening on the given host and port.
func RequestToMessage ¶
RequestToMessage converts a request into a wire protocol query.
func ResponseToMessage ¶
ResponseToMessage converts a response into a wire protocol reply.
func WriteErrorResponse ¶
WriteErrorResponse writes a response indicating an error occurred to the writer output.
func WriteNotOKResponse ¶
WriteOKResponse writes a response indicating that the request was not ok.
func WriteOKResponse ¶
WriteOKResponse writes a response indicating that the request was ok.
Types ¶
type ErrorResponse ¶
ErrorResponse represents a response indicating whether the operation was okay and errors, if any.
func MakeErrorResponse ¶
func MakeErrorResponse(ok bool, err error) ErrorResponse
MakeErrorResponse returns an ErrorResponse with the given ok status and error message, if any.
func MakeSuccessResponse ¶
func MakeSuccessResponse() ErrorResponse
MakeSuccessResponse returns an ErrorResponse that is ok and has no error.
func (ErrorResponse) SuccessOrError ¶
func (r ErrorResponse) SuccessOrError() error