{"id":16743248,"url":"https://github.com/abiriadev/goggle","last_synced_at":"2025-04-10T13:32:50.106Z","repository":{"id":210477836,"uuid":"726369005","full_name":"abiriadev/goggle","owner":"abiriadev","description":"Search your api through types, with speed 🥽","archived":false,"fork":false,"pushed_at":"2023-12-12T04:39:00.000Z","size":525,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T02:58:52.644Z","etag":null,"topics":["go","godoc","goggle","golang","hoogle","search-engine","type-directed-search","type-search"],"latest_commit_sha":null,"homepage":"https://abiriadev.github.io/goggle/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abiriadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-02T07:18:30.000Z","updated_at":"2025-01-10T23:00:00.000Z","dependencies_parsed_at":"2023-12-11T03:28:45.253Z","dependency_job_id":null,"html_url":"https://github.com/abiriadev/goggle","commit_stats":null,"previous_names":["abiriadev/goggle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiriadev%2Fgoggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiriadev%2Fgoggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiriadev%2Fgoggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiriadev%2Fgoggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abiriadev","download_url":"https://codeload.github.com/abiriadev/goggle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225712,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","godoc","goggle","golang","hoogle","search-engine","type-directed-search","type-search"],"created_at":"2024-10-13T01:26:27.613Z","updated_at":"2025-04-10T13:32:50.073Z","avatar_url":"https://github.com/abiriadev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGoggle 🥽\u003c/h1\u003e\n\u003cp align=\"center\"\u003eSearch your api through types, with speed \u003c/p\u003e\n\n## Overview\n\nGoggle is a type-directed search engine like [hoogle](https://github.com/ndmitchell/hoogle) but for [Go](https://go.dev/)\n\n## :tada: Try Goggle now!\n\nTry Goggle for yourself! You can now visit [here](https://abiriadev.github.io/goggle/) to see Goggle in action.\n\n## :camera: Demo\n\n![](./assets/demo.png)\n\n## :mag: Query\n\nYou can type query to search and filter results.\n\nThe most simplest form is just Go's standard function definition.\n\n```go\nfunc length(s string) int\n```\n\nBut we can omit a function name, to retrieve results whose name does not match with `length`.\n\n```go\nfunc (s string) int\n```\n\nWe can omit a `func` keyword too.\n\n```go\n(s string) int\n```\n\nFinally, we can omit argument names.\n\n```go\n(string) int\n```\n\n### Query syntax definition\n\n```ebnf\nType = Primitives | SliceType | PointerType | identifier .\nPrimitives = \"bool\" | Int | UInt | \"float32\" | \"float64\" | \"complex64\" | \"complex128\" .\nInt = \"int\" | \"int8\" | \"int16\" | \"int32\" | \"int64\" .\nUInt = \"uint\" | \"uint8\" | \"uint16\" | \"uint32\" | \"uint64\" | \"uintptr\" .\n\nSliceType = \"[\" \"]\" Type .\n\nParameters = \"(\" [ Type { \",\" Type } ] \")\" .\nQuery = [ \"func\" ] [ identifier ] Parameters [ Type ] .\n```\n\n## Build Manually\n\n```sh\n$ git clone https://github.com/abiriadev/goggle \u0026\u0026 cd goggle\n```\n\n### Build indexer from source and index custom packages\n\n```sh\n$ go run ./cmd/indexer\n# or\n$ go run ./cmd/indexer \u003cspace separated list of packages to index\u003e\n```\n\nSee help page for more information:\n\n```sh\nUsage of indexer:\n  -f string\n        index format (default \"gob\")\n  -o string\n        path to save index file\n```\n\n### Build and run REPL\n\n```sh\n$ go run ./cmd/repl\n# or optionally pass a path to index file to use\n$ go run ./cmd/repl \u003cindex file to use\u003e\n```\n\nIt will then show you a prompt starting with `λ`.\n\nType any query(like `() bool`) and enter to see the results.\n\n```go\nλ () bool\nfunc utf8.FullRune() bool       // FullRune reports whether the bytes in p begin with a full UTF-8 encoding of a rune.\nfunc nettest.TestableAddress() bool     // TestableAddress reports whether address of network is testable on the current platform configuration.\nfunc nettest.SupportsRawSocket() bool   // SupportsRawSocket reports whether the current session is available to use raw sockets.\nfunc nettest.SupportsIPv6() bool        // SupportsIPv6 reports whether the platform supports IPv6 networking functionality.\nfunc nettest.SupportsIPv4() bool        // SupportsIPv4 reports whether the platform supports IPv4 networking functionality.\nfunc signal.Ignored() bool      // Ignored reports whether sig is currently ignored.\nfunc slices.Equal() bool        // Equal reports whether two slices are equal: the same length and all elements equal.\nfunc testenv.OptimizationOff() bool     // OptimizationOff reports whether optimization is disabled.\nfunc testenv.HasSymlink() bool  // HasSymlink reports whether the current system can use os.Symlink.\nfunc testenv.HasSrc() bool      // HasSrc reports whether the entire source tree is available under GOROOT.\n```\n\n### Build and run Goggle server\n\n```sh\n$ go run ./cmd/goggle\n```\n\nThe default port number is `6099`(L33T or `Gogg`). You can pass `-port` option to change it.\n\n```sh\nUsage of goggle:\n  -port int\n        port number to bind (default 6099)\n```\n\nTry requesting from terminal:\n\n```sh\n$ http :6099/search q='() bool' -v\n\nPOST /search HTTP/1.1\nAccept: application/json, */*;q=0.5\nAccept-Encoding: gzip, deflate, br\nConnection: keep-alive\nContent-Length: 15\nContent-Type: application/json\nHost: localhost:6099\nUser-Agent: HTTPie/3.2.1\n\n{\n    \"q\": \"() bool\"\n}\n\nHTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nContent-Length: 1970\nContent-Type: text/plain; charset=utf-8\nDate: Tue, 12 Dec 2023 04:12:01 GMT\n\n{\n    \"items\": [\n        {\n            \"sim\": 0,\n            \"sig\": \"func utf8.FullRune() bool\",\n            \"summary\": \"FullRune reports whether the bytes in p begin with a full UTF-8 encoding of a rune.\",\n            \"link\": \"https://pkg.go.dev/unicode/utf8#FullRune\"\n        },\n        {\n            \"sim\": 0,\n            \"sig\": \"func nettest.TestableAddress() bool\",\n            \"summary\": \"TestableAddress reports whether address of network is testable on the current platform configuration.\",\n            \"link\": \"https://pkg.go.dev/golang.org/x/net/nettest#TestableAddress\"\n        },\n        ...\n    ]\n}\n```\n\n### Build and run frontend\n\nEnsure that you have [Go](https://go.dev), [Task](https://github.com/go-task/task), [Node.js](https://nodejs.org), and [Binaryen](https://github.com/WebAssembly/binaryen) installed.\n\nThen, execuate the following commands:\n\n```sh\n$ task wasm-exec syntaxck\n$ corepack enable\n$ pnpm install --frozen-lockfile\n$ cd frontend\n```\n\nIf you don't want to have local Goggle proxy, you can specify your already-deployed endpoint by setting `VITE_EXTERN_ENDPOINT` variable.\n\n```sh\n$ echo 'VITE_EXTERN_ENDPOINT=\u003ctype your endpoint url here\u003e' \u003e .env.production\n```\n\nThen, run!\n\n```sh\n$ pnpm dev\n# Or, to use an external endpoint:\n$ pnpm dev --mode production\n```\n\nFor building the frontend for deployment or serving:\n\n```sh\n$ pnpm build\n```\n\n## :memo: TODO\n\n-   [ ] Index\n    -   [x] Portable index file\n    -   [ ] Index popular packages\n-   [ ] Incremental search\n-   [ ] Frontend\n    -   [ ] Standalone result view\n    -   [x] Link to pkg.go.dev\n    -   [x] Brief description\n    -   [ ] Syntax hightlighting for search result\n    -   [ ] Use dedicated search bar component\n-   [ ] Query\n    -   [ ] Compound types\n        -   [ ] Array\n        -   [ ] Slice\n        -   [ ] Pointer type\n        -   [ ] Inline struct type\n        -   [ ] Interface resolution\n    -   [ ] Method\n    -   [ ] Multiple return\n    -   [ ] Parameter collaping\n    -   [ ] Spread syntax\n    -   [ ] Generics\n        -   [ ] Constraints\n-   [x] Levenshtein distance\n    -   [ ] Argument-level similarity comparison\n    -   [ ] Hoogle-like structured edit distance\n        -   [ ] Subtype polymorphic edit distance\n-   [x] GHA CD automation\n-   [ ] External tools\n    -   [x] REPL\n    -   [ ] vscode extension\n    -   [ ] neovim LSP support?\n\n## :grinning: This is really awwwesome!! How can I help?\n\nThere are many ways to support and contribute to the ongoing maintenance and improvement of Goggle. Any support is greatly appreciated!\n\n-   **Spread the world.** Share Goggle with your co-workers, students, and community so that they can find it useful as well!\n-   **Report bugs.** If you encounter any unexpected behavior or runtime panics, please open an issue to report and document them.\n-   **Make your document cleaner.** Although Goggle can find items without documentation, it doesn't have a power to generate intuitive identifiers and descriptive summaries. So it's a good idea to document you package thoroughly to enhance developer experience.\n-   **Suggest better idea.** Currently, Goggle's approximate search doesn't support structural edit-distance, and there are still a lot of missing features. Your suggestions for more accurate and efficient implementations are always welcome.\n-   **Build creative tools on top of Goggle.** Goggle currently supports web search and REPL, but the possibilities for its application are limitless. Ideas like a vscode extension, LSP autocompletion, etc., could significantly expand its ecosystem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiriadev%2Fgoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabiriadev%2Fgoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiriadev%2Fgoggle/lists"}