项目作者: apolloconfig

项目描述 :
🚀Go client for ctrip/apollo (https://github.com/ctripcorp/apollo)
高级语言: Go
项目地址: git://github.com/apolloconfig/agollo.git
创建时间: 2017-06-23T03:17:45Z
项目社区:https://github.com/apolloconfig/agollo

开源协议:Apache License 2.0

下载


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

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

Initialize agollo

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/apolloconfig/agollo/v4"
  5. "github.com/apolloconfig/agollo/v4/env/config"
  6. )
  7. func main() {
  8. c := &config.AppConfig{
  9. AppID: "testApplication_yang",
  10. Cluster: "dev",
  11. IP: "http://localhost:8080",
  12. NamespaceName: "dubbo",
  13. IsBackupConfig: true,
  14. Secret: "6ce3ff7e96a24335a9634fe9abca6d51",
  15. }
  16. client, _ := agollo.StartWithConfig(func() (*config.AppConfig, error) {
  17. return c, nil
  18. })
  19. fmt.Println("Apollo configuration initialized successfully")
  20. //Use your apollo key to test
  21. cache := client.GetConfigCache(c.NamespaceName)
  22. value, _ := cache.Get("key")
  23. fmt.Println(value)
  24. }

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

License

The project is licensed under the Apache 2 license.

Reference

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