handlers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilePath

func GetFilePath(r *http.Request) (string, error)

Types

type CreateFileHandler

type CreateFileHandler struct {
	ProjectManager project.Manager
}

func (CreateFileHandler) ServeHTTP

func (h CreateFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CreateFileRequest

type CreateFileRequest struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

type CreateProjectHandler

type CreateProjectHandler struct {
	Manager   project.Manager
	Validator *validator.Validate
}

func (CreateProjectHandler) ServeHTTP

type CreateTaskHandler

type CreateTaskHandler struct {
	Manager project.Manager
}

func (CreateTaskHandler) ServeHTTP

func (h CreateTaskHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DeleteFileHandler

type DeleteFileHandler struct {
	ProjectManager project.Manager
}

func (DeleteFileHandler) ServeHTTP

func (h DeleteFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DeleteProjectHandler

type DeleteProjectHandler struct {
	Manager project.Manager
}

func (DeleteProjectHandler) ServeHTTP

type DocumentOutline added in v0.5.0

type DocumentOutline struct {
	ProjectManager project.Manager
}

func (DocumentOutline) ServeHTTP added in v0.5.0

func (h DocumentOutline) ServeHTTP(w http.ResponseWriter, r *http.Request)

type FileInfo

type FileInfo struct {
	Path string `json:"path"`
}

type LineDiffRequest

type LineDiffRequest struct {
	StartLine int    `json:"startLine"`
	EndLine   int    `json:"endLine"`
	Content   string `json:"content"`
}

type ListFilesHandler

type ListFilesHandler struct {
	ProjectManager project.Manager
}

func (ListFilesHandler) ServeHTTP

func (h ListFilesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ListTasksHandler

type ListTasksHandler struct {
	Manager project.Manager
}

func (ListTasksHandler) ServeHTTP

func (h ListTasksHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OverwriteRequest

type OverwriteRequest struct {
	Content string `json:"content"`
}

type ReadFileHandler

type ReadFileHandler struct {
	ProjectManager project.Manager
}

func (ReadFileHandler) ServeHTTP

func (h ReadFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Router

type Router struct {
	*mux.Router
}

func NewRouter

func NewRouter() *Router

func (*Router) Build

func (r *Router) Build() *mux.Router

func (*Router) WithCreateFileHandler

func (r *Router) WithCreateFileHandler(handler http.Handler) *Router

func (*Router) WithCreateProjectHandler

func (r *Router) WithCreateProjectHandler(handler http.Handler) *Router

func (*Router) WithCreateTaskHandler

func (r *Router) WithCreateTaskHandler(handler http.Handler) *Router

func (*Router) WithDeleteFileHandler

func (r *Router) WithDeleteFileHandler(handler http.Handler) *Router

func (*Router) WithDeleteProjectHandler

func (r *Router) WithDeleteProjectHandler(handler http.Handler) *Router

func (*Router) WithDocumentOutlineHandler added in v0.5.0

func (r *Router) WithDocumentOutlineHandler(handler http.Handler) *Router

func (*Router) WithListFilesHandler

func (r *Router) WithListFilesHandler(handler http.Handler) *Router

func (*Router) WithListTasksHandler

func (r *Router) WithListTasksHandler(handler http.Handler) *Router

func (*Router) WithReadFileHandler

func (r *Router) WithReadFileHandler(handler http.Handler) *Router

func (*Router) WithSearchFileHandler

func (r *Router) WithSearchFileHandler(handler http.Handler) *Router

func (*Router) WithSearchSymbolsHandler

func (r *Router) WithSearchSymbolsHandler(handler http.Handler) *Router

func (*Router) WithUpdateFileHandler

func (r *Router) WithUpdateFileHandler(handler http.Handler) *Router

type SearchFilesHandler

type SearchFilesHandler struct {
	ProjectManager project.Manager
}

func (SearchFilesHandler) ServeHTTP

func (h SearchFilesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SearchSymbolsHandler

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

func NewSearchSymbolsHandler

func NewSearchSymbolsHandler(pm project.Manager, opts ...SearchSymbolsOptions) SearchSymbolsHandler

func (SearchSymbolsHandler) ServeHTTP

type SearchSymbolsOptions

type SearchSymbolsOptions func(opts *searchSymbolsOptions)

func ExcludedSymbols

func ExcludedSymbols(symbols ...protocol.SymbolKind) SearchSymbolsOptions

func IncludeSymbols

func IncludeSymbols(symbols ...protocol.SymbolKind) SearchSymbolsOptions

func SearchSymbolsLimit

func SearchSymbolsLimit(n int) SearchSymbolsOptions

func SearchSymbolsMaxLimit

func SearchSymbolsMaxLimit(n int) SearchSymbolsOptions

type TaskRequest

type TaskRequest struct {
	Command *string `json:"command,omitempty"`
	Alias   *string `json:"alias,omitempty"`
}

func (*TaskRequest) Validate

func (t *TaskRequest) Validate() error

type UdiffRequest

type UdiffRequest struct {
	Patch string `json:"patch"`
}

type UpdateFileHandler

type UpdateFileHandler struct {
	ProjectManager project.Manager
}

func (UpdateFileHandler) ServeHTTP

func (h UpdateFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UpdateFileRequest

type UpdateFileRequest struct {
	Type      UpdateType        `json:"type"`
	Udiff     *UdiffRequest     `json:"udiff,omitempty"`
	LineDiff  *LineDiffRequest  `json:"linediff,omitempty"`
	Overwrite *OverwriteRequest `json:"overwrite,omitempty"`
}

func (*UpdateFileRequest) Validate

func (r *UpdateFileRequest) Validate() error

type UpdateType

type UpdateType string
const (
	Udiff     UpdateType = "udiff"
	LineDiff  UpdateType = "linediff"
	Overwrite UpdateType = "overwrite"
)

Jump to

Keyboard shortcuts

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