response

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidAfterShutdown = -32000
	ErrUnsupportedFeature   = -32001
	ErrInvalidURI           = -32002
	ErrUnexpectedURIScheme  = -32003
	ErrInvalidRequest       = -32600
	ErrMethodNotFound       = -32601
	ErrInternalError        = -32603
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionOptions

type CompletionOptions struct {
	TriggerCharacters []string `json:"triggerCharacters,omitempty"`
	ResolveProvider   bool     `json:"resolveProvider,omitempty"`
}

type InitializeResult

type InitializeResult struct {
	Capabilities ServerCapabilities `json:"capabilities"`
}

type JSONRPCError

type JSONRPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type JSONRPCResponse

type JSONRPCResponse struct {
	ID      int           `json:"id"`
	Result  interface{}   `json:"result"`
	JSONRPC string        `json:"jsonrpc"`
	Error   *JSONRPCError `json:"error,omitempty"`
}

func CreateEnvironmentVariablesResp

func CreateEnvironmentVariablesResp(req request.JSONRPCRequest, envs interface{}) JSONRPCResponse

func CreateSuccessResponse

func CreateSuccessResponse(requestID int, result interface{}) JSONRPCResponse

Utility function to create a general success response

func DefaultResp

func DefaultResp(req request.JSONRPCRequest) JSONRPCResponse

func ErrorResp

func ErrorResp(req request.JSONRPCRequest, errorCode int, errorMsg string) JSONRPCResponse

Utility function to create a general error response

func InvalidReqAfterShutdown

func InvalidReqAfterShutdown(req request.JSONRPCRequest) JSONRPCResponse

type ServerCapabilities

type ServerCapabilities struct {
	TextDocumentSync int                `json:"textDocumentSync"`
	Completion       *CompletionOptions `json:"completion,omitempty"`
	HoverProvider    bool               `json:"hoverProvider,omitempty"`
	SuggestL2Envs    bool               `json:"suggestL2Env,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL