Documentation
¶
Overview ¶
Package browserapi exposes one initialized CodeGrapher repository through a versioned, authenticated, read-only HTTP API for browser consumers.
Index ¶
- Constants
- Variables
- func GenerateCredential() (string, error)
- type Config
- type ErrorResponse
- type FileResponse
- type Freshness
- type GraphEdge
- type GraphResponse
- type Limits
- type Repository
- type SearchResponse
- type SearchResult
- type Server
- type SourceRange
- type StatusResponse
- type Symbol
- type SymbolResponse
- type TreeEntry
- type TreeResponse
Constants ¶
View Source
const BasePath = "/codegrapher/v1"
Variables ¶
View Source
var DefaultAllowedOrigins = []string{"https://codegrapher.com", "https://codegrapher.dev"}
Functions ¶
func GenerateCredential ¶
GenerateCredential returns a cryptographically random browser bearer token.
Types ¶
type ErrorResponse ¶
type FileResponse ¶
type FileResponse struct {
RepositoryID string `json:"repositoryId"`
Revision string `json:"revision"`
Path string `json:"path"`
Language string `json:"language"`
Size int64 `json:"size"`
LineCount int `json:"lineCount"`
ContentHash string `json:"contentHash"`
Content string `json:"content"`
Freshness Freshness `json:"freshness"`
}
type GraphResponse ¶
type GraphResponse struct {
RepositoryID string `json:"repositoryId"`
Revision string `json:"revision"`
RootSymbolID string `json:"rootSymbolId"`
Direction string `json:"direction"`
Depth int `json:"depth"`
MaxNodes int `json:"maxNodes"`
MaxEdges int `json:"maxEdges"`
Nodes []Symbol `json:"nodes"`
Edges []GraphEdge `json:"edges"`
Truncated bool `json:"truncated"`
Freshness Freshness `json:"freshness"`
}
type Limits ¶
type Limits struct {
MaxTreeEntries int `json:"maxTreeEntries"`
MaxFileBytes int `json:"maxFileBytes"`
MaxSearchResults int `json:"maxSearchResults"`
MaxGraphDepth int `json:"maxGraphDepth"`
MaxGraphNodes int `json:"maxGraphNodes"`
MaxGraphEdges int `json:"maxGraphEdges"`
}
func DefaultLimits ¶
func DefaultLimits() Limits
type Repository ¶
type Repository struct {
ID string `json:"id"`
Label string `json:"label"`
Remote string `json:"remote,omitempty"`
Branch string `json:"branch,omitempty"`
HeadCommit string `json:"headCommit,omitempty"`
Revision string `json:"revision"`
Freshness Freshness `json:"freshness"`
FileCount int `json:"fileCount"`
SymbolCount int `json:"symbolCount"`
EdgeCount int `json:"edgeCount"`
}
type SearchResponse ¶
type SearchResult ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RepositoryID ¶
type SourceRange ¶
type StatusResponse ¶
type Symbol ¶
type Symbol struct {
ID string `json:"id"`
Kind string `json:"kind"`
Name string `json:"name"`
QualifiedName string `json:"qualifiedName"`
FilePath string `json:"filePath"`
Language string `json:"language"`
Range SourceRange `json:"range"`
Signature string `json:"signature,omitempty"`
Docstring string `json:"docstring,omitempty"`
Visibility *string `json:"visibility,omitempty"`
Exported bool `json:"exported"`
}
type SymbolResponse ¶
Click to show internal directories.
Click to hide internal directories.