langserver

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCORSDisablerWrapper

func NewCORSDisablerWrapper(parent http.Handler) http.Handler

func SpaFileServer added in v1.1.0

func SpaFileServer(root http.Dir) http.Handler

func ValidateContentLength added in v1.4.1

func ValidateContentLength(r *http.Request) error

func WrapHandler added in v1.4.1

func WrapHandler(h HandlerFunc, guards ...GuardFn) http.HandlerFunc

func WriteJSON

func WriteJSON(w http.ResponseWriter, i interface{})

Types

type BuildResponse added in v1.3.0

type BuildResponse struct {
	Formatted string `json:"formatted,omitempty"`
	FileName  string `json:"fileName,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
	// contains filtered or unexported fields
}

func NewErrorResponse

func NewErrorResponse(err error) *ErrorResponse

func (*ErrorResponse) Write

type GuardFn added in v1.4.1

type GuardFn func(r *http.Request) error

type HTTPError added in v1.4.1

type HTTPError struct {
	// contains filtered or unexported fields
}

HTTPError is HTTP response error

func Errorf

func Errorf(code int, format string, args ...interface{}) *HTTPError

func NewHTTPError added in v1.4.1

func NewHTTPError(code int, err error) *HTTPError

func (*HTTPError) Error added in v1.4.1

func (err *HTTPError) Error() string

Error implements error

func (*HTTPError) Unwrap added in v1.4.1

func (err *HTTPError) Unwrap() error

Unwrap implements error

func (*HTTPError) WriteResponse added in v1.4.1

func (err *HTTPError) WriteResponse(rw http.ResponseWriter)

type HandlerFunc added in v1.4.1

type HandlerFunc func(http.ResponseWriter, *http.Request) error

type RunResponse added in v1.3.0

type RunResponse struct {
	Formatted string                 `json:"formatted,omitempty"`
	Events    []*goplay.CompileEvent `json:"events,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(packages []*analyzer.Package, builder compiler.BuildService) *Service

func (*Service) HandleArtifactRequest added in v1.3.0

func (s *Service) HandleArtifactRequest(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleCompile added in v1.3.0

func (s *Service) HandleCompile(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleFormatCode added in v1.3.0

func (s *Service) HandleFormatCode(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleGetSnippet added in v1.3.0

func (s *Service) HandleGetSnippet(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleGetSuggestion added in v1.3.0

func (s *Service) HandleGetSuggestion(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleRunCode added in v1.3.0

func (s *Service) HandleRunCode(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleShare added in v1.3.0

func (s *Service) HandleShare(w http.ResponseWriter, r *http.Request) error

func (*Service) Mount

func (s *Service) Mount(r *mux.Router)

Mount mounts service on route

type ShareResponse added in v1.1.0

type ShareResponse struct {
	SnippetID string `json:"snippetID"`
}

type SnippetResponse added in v1.1.0

type SnippetResponse struct {
	FileName string `json:"fileName"`
	Code     string `json:"code"`
}

type SuggestionRequest

type SuggestionRequest struct {
	PackageName string `json:"packageName"`
	Value       string `json:"value"`
}

func (SuggestionRequest) Trim

type SuggestionsResponse

type SuggestionsResponse struct {
	Suggestions []*analyzer.CompletionItem `json:"suggestions"`
}

func (SuggestionsResponse) Write

Jump to

Keyboard shortcuts

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