MCPcopy
hub / github.com/bilibili/discovery

github.com/bilibili/discovery @v1.2.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.2.0 ↗
263 symbols 922 edges 25 files 122 documented · 46%
README

Discovery

Build Status Go Report Card codecov

Discovery is a based service that is production-ready and primarily used at Bilibili for locating services for the purpose of load balancing and failover of middle-tier servers.

Quick Start

env

go1.12.x (and later)

build

cd $GOPATH/src
git clone https://github.com/bilibili/discovery.git
cd discovery/cmd/discovery
go build

run

./discovery -conf discovery.toml -alsologtostderr

-alsologtostderr is glog's flag,means print into stderr. If you hope print into file, can use -log.dir="/tmp". view glog doc.

Configuration

You can view the comments in cmd/discovery/discovery.toml to understand the meaning of the config.

Client

Intro/Arch/Practice

Feedback

Please report bugs, concerns, suggestions by issues, or join QQ-group 716486124 to discuss problems around source code.

Extension points exported contracts — how you extend this code

Resolver (Interface)
Resolver resolve naming service [2 implementers]
naming/naming.go
Builder (Interface)
Builder resolver builder. [2 implementers]
naming/naming.go
Registry (Interface)
Registry Register an instance and renew automatically. [1 implementers]
naming/naming.go

Core symbols most depended-on inside this repo

NewInstance
called by 39
model/instance.go
Set
called by 34
registry/node.go
Register
called by 26
naming/naming.go
Set
called by 26
naming/client.go
Fetch
called by 24
naming/naming.go
Load
called by 12
registry/scheduler.go
Polls
called by 11
registry/registry.go
cancel
called by 11
http/discovery.go

Shape

Method 117
Function 99
Struct 42
Interface 3
TypeAlias 2

Languages

Go100%

Modules by API surface

naming/client.go30 symbols
registry/registry_test.go25 symbols
registry/registry.go24 symbols
model/instance.go22 symbols
discovery/register_test.go16 symbols
naming/naming.go14 symbols
naming/grpc/resolver_test.go14 symbols
registry/node_test.go11 symbols
naming/grpc/resolver.go10 symbols
http/discovery.go10 symbols
discovery/register.go10 symbols
registry/nodes.go9 symbols

Dependencies from manifests, versioned

github.com/gopherjs/gopherjsv0.0.0-2019043016542 · 1×
github.com/jtolds/glsv4.20.0+incompatible · 1×
github.com/nbio/stv0.0.0-2014062601070 · 1×
github.com/smartystreets/assertionsv0.0.0-2019040121174 · 1×
github.com/smartystreets/goconveyv0.0.0-2018022219450 · 1×
golang.org/x/syncv0.0.0-2019091118510 · 1×
google.golang.org/grpcv1.29.1 · 1×
gopkg.in/h2non/gock.v1v1.0.8 · 1×

For agents

$ claude mcp add discovery \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact