langserver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 12 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 WriteJSON

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

Types

type CompilerResponse

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

type ErrorResponse

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

func Errorf

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

Errorf creates error response

func NewErrorResponse

func NewErrorResponse(err error) ErrorResponse

func (ErrorResponse) Write

type Service

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

func New

func New(packages []*analyzer.Package) *Service

func (*Service) Compile

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

func (*Service) FormatCode

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

func (*Service) GetSnippet added in v1.1.0

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

func (*Service) GetSuggestion

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

func (*Service) Mount

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

Mount mounts service on route

func (*Service) Share added in v1.1.0

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

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