ค้นหา API ของคุณผ่านประเภทด้วยความเร็ว
Goggle เป็นเครื่องมือค้นหาแบบกำกับที่กำกับเช่น Hoogle แต่สำหรับ GO
ลองแว่นตาด้วยตัวคุณเอง! ตอนนี้คุณสามารถเยี่ยมชมที่นี่เพื่อดูการใช้งานแว่นตา

คุณสามารถพิมพ์แบบสอบถามเพื่อค้นหาและกรองผลลัพธ์
รูปแบบที่ง่ายที่สุดคือนิยามฟังก์ชั่นมาตรฐานของ GO
func length ( s string ) int แต่เราสามารถละเว้นชื่อฟังก์ชั่นเพื่อดึงผลลัพธ์ที่ชื่อไม่ตรงกับ length
func ( s string ) int เราสามารถละเว้นคำหลัก func ได้เช่นกัน
( s string ) intในที่สุดเราสามารถละเว้นชื่ออาร์กิวเมนต์
( string ) int Type = Primitives | SliceType | PointerType | identifier .
Primitives = " bool " | Int | UInt | " float32 " | " float64 " | " complex64 " | " complex128 " .
Int = " int " | " int8 " | " int16 " | " int32 " | " int64 " .
UInt = " uint " | " uint8 " | " uint16 " | " uint32 " | " uint64 " | " uintptr " .
SliceType = " [ " " ] " Type .
Parameters = " ( " [ Type { " , " Type } ] " ) " .
Query = [ " func " ] [ identifier ] Parameters [ Type ] .$ git clone https://github.com/abiriadev/goggle && cd goggle$ go run ./cmd/indexer
# or
$ go run ./cmd/indexer < space separated list of packages to index >ดูหน้าช่วยเหลือสำหรับข้อมูลเพิ่มเติม:
Usage of indexer:
-f string
index format (default " gob " )
-o string
path to save index file$ go run ./cmd/repl
# or optionally pass a path to index file to use
$ go run ./cmd/repl < index file to use > จากนั้นจะแสดงให้คุณเห็นพร้อมท์เริ่มต้นด้วย λ
พิมพ์แบบสอบถามใด ๆ (เช่น () bool ) และป้อนเพื่อดูผลลัพธ์
λ () bool
func utf8 . FullRune () bool // FullRune reports whether the bytes in p begin with a full UTF-8 encoding of a rune.
func nettest . TestableAddress () bool // TestableAddress reports whether address of network is testable on the current platform configuration.
func nettest . SupportsRawSocket () bool // SupportsRawSocket reports whether the current session is available to use raw sockets.
func nettest . SupportsIPv6 () bool // SupportsIPv6 reports whether the platform supports IPv6 networking functionality.
func nettest . SupportsIPv4 () bool // SupportsIPv4 reports whether the platform supports IPv4 networking functionality.
func signal . Ignored () bool // Ignored reports whether sig is currently ignored.
func slices . Equal () bool // Equal reports whether two slices are equal: the same length and all elements equal.
func testenv . OptimizationOff () bool // OptimizationOff reports whether optimization is disabled.
func testenv . HasSymlink () bool // HasSymlink reports whether the current system can use os.Symlink.
func testenv . HasSrc () bool // HasSrc reports whether the entire source tree is available under GOROOT.$ go run ./cmd/goggle หมายเลขพอร์ตเริ่มต้นคือ 6099 (L33T หรือ Gogg ) คุณสามารถผ่านตัวเลือก -port เพื่อเปลี่ยนได้
Usage of goggle:
-port int
port number to bind (default 6099)ลองขอจากเทอร์มินัล:
$ http :6099/search q= ' () bool ' -v
POST /search HTTP/1.1
Accept: application/json, * / * ; q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 15
Content-Type: application/json
Host: localhost:6099
User-Agent: HTTPie/3.2.1
{
" q " : " () bool "
}
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 1970
Content-Type: text/plain ; charset=utf-8
Date: Tue, 12 Dec 2023 04:12:01 GMT
{
" items " : [
{
" sim " : 0,
" sig " : " func utf8.FullRune() bool " ,
" summary " : " FullRune reports whether the bytes in p begin with a full UTF-8 encoding of a rune. " ,
" link " : " https://pkg.go.dev/unicode/utf8#FullRune "
},
{
" sim " : 0,
" sig " : " func nettest.TestableAddress() bool " ,
" summary " : " TestableAddress reports whether address of network is testable on the current platform configuration. " ,
" link " : " https://pkg.go.dev/golang.org/x/net/nettest#TestableAddress "
},
...
]
}ตรวจสอบให้แน่ใจว่าคุณมีงานไปงาน node.js และ Binaryen ติดตั้ง
จากนั้นเรียกใช้คำสั่งต่อไปนี้:
$ task wasm-exec syntaxck
$ corepack enable
$ pnpm install --frozen-lockfile
$ cd frontend หากคุณไม่ต้องการมีพร็อกซีแว่นตาท้องถิ่นคุณสามารถระบุจุดสิ้นสุดที่ใช้งานได้แล้วโดยการตั้งค่าตัวแปร VITE_EXTERN_ENDPOINT
$ echo ' VITE_EXTERN_ENDPOINT=<type your endpoint url here> ' > .env.productionจากนั้นวิ่ง!
$ pnpm dev
# Or, to use an external endpoint:
$ pnpm dev --mode productionสำหรับการสร้างส่วนหน้าสำหรับการปรับใช้หรือการให้บริการ:
$ pnpm buildมีหลายวิธีในการสนับสนุนและมีส่วนร่วมในการบำรุงรักษาอย่างต่อเนื่องและการปรับปรุงแว่นตา การสนับสนุนใด ๆ ได้รับการชื่นชมอย่างมาก!