Skip to content

Godoogle is a Go API search engine, which allows you to search by approximate function type signature, including generics. “Hoogle for Godoc”. / 通过函数签名(输入输出类型)模糊搜索 Go API;支持泛型。

Notifications You must be signed in to change notification settings

SnowOnion/godoogle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godoogle

Godoogle is a Go API search engine, which allows you to search by approximate function type signature, including generics.

Aim: Godoogle is to Go what Hoogle is to Haskell.

Usages

🌏The Online One

https://godoogle.sonion.xyz/

🏡Deploy Your Own Godoogle

# First run
go run script/writeSigGraph.go
mv sigGraph.json server/res/

# Each run
cd server/
go run .

Then visit localhost:8888.

WIP: Be configurable. (By now: Mutate func InitFuncDatabase() in collect/candidates.go ...)

Approaches & TODOs

  • Smarter
    • Fuzzy search by distance.
    • Adapt to various inputs.
      • Type params, e.g. [T any] func(bool, T, T) T
      • Support non-builtin types, e.g. func() time.Time, func(l sync.Locker) *sync.Cond
      • Copy straight from code / Godoogle result, e.g. func InSlice[T comparable](item T, slice []T) bool
      • No func nor name, e.g. [T comparable](item T, slice []T) bool
      • Omit type param, e.g. func(...T) []T, func (T, []T) bool
    • Imagine more.
      • func(X,Y) (Z) -> func(X) (Z,W)
      • func(X,Y) (Z) <- func(X) (Z,W)
      • func(X,Y) (Z,W) -> func(Y,X) (W,Z)
      • [T comparable]func(...T) []T -> [T any]func(...T) []T
      • [E comparable](s []E, v E) -> [S ~[]E, E comparable](s S, v E)
      • func(X) <-> func(*X)
    • First things first.
      • Query func(string) intfunc(s string) (int, error) > func(s string) (p vendor/golang.org/x/text/unicode/bidi.Properties, sz int)
    • Learn from Hoogle, Roogle, *oogle.
  • Wider
  • Faster
    • Memoization of shortest paths in SigGraph, the graph with func signature as vertex and distance as edge weight.
      • Text.
      • DB (RDB? Graph DB?).
  • Other
    • Google Analytics.
    • Google Analytics options, for self-hosted user.

Challenges & Ideas

See draft.md.

Licence

Not specified. You may suggest one!

About

Godoogle is a Go API search engine, which allows you to search by approximate function type signature, including generics. “Hoogle for Godoc”. / 通过函数签名(输入输出类型)模糊搜索 Go API;支持泛型。

Resources

Stars

Watchers

Forks

Packages

No packages published