MCPcopy Index your code
hub / github.com/apolloconfig/agollo

github.com/apolloconfig/agollo @v5.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.0.0 ↗ · + Follow
566 symbols 2,081 edges 78 files 248 documented · 44% 5 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Agollo - Go Client for Apollo

English | 中文

golang Build Status Go Report Card codebeat badge Coverage Status License GoDoc GitHub release 996.icu

A Golang client for the configuration center framework Apollo.

Features

  • Support for multiple IPs, AppIDs, and namespaces
  • Real-time configuration synchronization
  • Gray release configuration
  • Lazy loading (runtime) namespaces
  • Client-side and configuration file fallback
  • Customizable logger and cache components
  • Support for configuration access keys

Usage

Quick Start

Import agollo

go get -u github.com/apolloconfig/agollo/v5@latest

Initialize agollo

package main

import (
    "fmt"

    "github.com/apolloconfig/agollo/v5"
    "github.com/apolloconfig/agollo/v5/env/config"
)

func main() {
    c := &config.AppConfig{
        AppID:          "testApplication_yang",
        Cluster:        "dev",
        IP:             "http://localhost:8080",
        NamespaceName:  "dubbo",
        IsBackupConfig: true,
        Secret:         "6ce3ff7e96a24335a9634fe9abca6d51",
    }

    client, _ := agollo.StartWithConfig(func() (*config.AppConfig, error) {
        return c, nil
    })
    fmt.Println("Apollo configuration initialized successfully")

    //Use your apollo key to test
    cache := client.GetConfigCache(c.NamespaceName)
    value, _ := cache.Get("key")
    fmt.Println(value)
}

More Examples

Demo Project: agollo_demo

Other Languages:: Use agollo-agent as a local agent for languages like PHP.

Check out our Wiki or godoc for more information.

If you find this tool useful or encounter any issues, please let me know via email or by creating an issue

User

Contribution

  • Source Code: https://github.com/apolloconfig/agollo/
  • Issue Tracker: https://github.com/apolloconfig/agollo/issues

License

The project is licensed under the Apache 2 license.

Reference

Apollo: https://github.com/apolloconfig/apollo

Extension points exported contracts — how you extend this code

ContentParser (Interface)
ContentParser 内容转换 [5 implementers]
utils/parse/parser.go
AbsComponent (Interface)
AbsComponent 定时组件 [4 implementers]
component/common.go
LoadBalance (Interface)
LoadBalance 负载均衡器 [4 implementers]
cluster/load_balance.go
HTTPAuth (Interface)
HTTPAuth http 授权 [3 implementers]
protocol/auth/auth.go
ChangeListener (Interface)
ChangeListener 监听器 [3 implementers]
storage/change_event.go
CacheFactory (Interface)
CacheFactory 缓存组件工厂接口 [3 implementers]
agcache/cache.go
FileHandler (Interface)
FileHandler 备份文件读写 [3 implementers]
env/file/file_handler.go
Client (Interface)
Client apollo 客户端接口 [1 implementers]
client.go

Core symbols most depended-on inside this repo

GetHost
called by 40
env/config/config.go
Debugf
called by 31
component/log/log.go
GetNotificationsMap
called by 27
env/config/config.go
Errorf
called by 25
component/log/log.go
GetFileHandler
called by 21
extension/file.go
GetConfig
called by 18
client.go
GetNotify
called by 17
env/config/config.go
Parse
called by 15
utils/parse/parser.go

Shape

Function 296
Method 200
Struct 54
Interface 14
TypeAlias 2

Languages

Go100%

Modules by API surface

client.go44 symbols
storage/repository.go36 symbols
component/log/log.go28 symbols
client_test.go25 symbols
env/config/config.go24 symbols
component/remote/async_test.go24 symbols
start_test.go22 symbols
component/log/log_test.go17 symbols
storage/repository_test.go12 symbols
storage/event_dispatch.go12 symbols
storage/change_event.go12 symbols
extension/cache_test.go12 symbols

For agents

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

⬇ download graph artifact