Categorygithub.com/wricardo/code-surgeon
modulepackage
0.0.0-20241230104006-11a8dcca21a8
Repository: https://github.com/wricardo/code-surgeon.git
Documentation: pkg.go.dev

# README

code-surgeon

Code Surgeon is:

  • a library for generating code, parsing golang code.
  • a command line tool to parse golang code
  • an AI chatbot through grpc

Dependencies

Setup your env variables

  • Create a .env file in the root of the project
  • Add the following variables to the .env file
OPENAI_API_KEY=sk-....
NGROK_AUTH_TOKEN=your_ngrok_auth_token
NGROK_DOMAIN=example-domain.ngrok-free.app
NEO4j_DB_URI=neo4j://localhost
NEO4j_DB_USER=neo4j
NEO4j_DB_PASSWORD=neo4jneo4j

https://dashboard.ngrok.com/cloud-edge/domains

Using chatbot

  • Start infrastructure (terminal 1)
docker-compose up
  • Run the chatbot server (terminal 2)
make run-server
  • Run the chatbot cli client (terminal 3)
make new-chat

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
FindFunction uses Comby to find a function in a directory.
FormatCodeAndFixImports applies gofmt and goimports to the modified files.
No description provided by the author
No description provided by the author
MustRenderTemplate is a helper function to render a template with the given data.
ParseDirectory parses a directory containing Go files and returns the parsed information.
ParseDirectoryRecursive parses a directory recursively and returns the parsed information.
ParseDirectoryWithFilter parses a directory with an optional filter function to include specific files.
ParseFile parses a Go file or directory and returns the parsed information.
ParseString parses Go source code provided as a string and returns the parsed information.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UpsertDocumentationToFunction uses Comby to upsert documentation in a function.

# Variables

FS embeds OpenAPI and proto files for the codesurgeon package.
No description provided by the author

# Structs

No description provided by the author
Constant represents a constant in a Go package.
Field represents a field in a Go struct.
No description provided by the author
Function represents a Go function with its parameters, return types, and documentation.
No description provided by the author
No description provided by the author
No description provided by the author
Interface represents a Go interface and its methods.
Method represents a method in a Go struct or interface.
Module represents a Go module with its packages.
Package represents a Go package with its components such as imports, structs, functions, etc.
Param represents a parameter or return value in a Go function or method.
ParsedInfo holds parsed information about Go packages.
Struct represents a Go struct and its fields and methods.
No description provided by the author
No description provided by the author
Variable represents a global variable in a Go package.