Giter Site home page Giter Site logo

zy84338719 / agollo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apolloconfig/agollo

0.0 1.0 0.0 886 KB

🚀Go client for ctrip/apollo (https://github.com/apolloconfig/apollo)

Home Page: https://www.apolloconfig.com

License: Apache License 2.0

Go 100.00%

agollo's Introduction

Agollo - Go Client for Apollo

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

方便Golang接入配置中心框架 Apollo 所开发的Golang版本客户端。

Features

  • 支持多 IP、AppID、namespace
  • 实时同步配置
  • 灰度配置
  • 延迟加载(运行时)namespace
  • 客户端,配置文件容灾
  • 自定义日志,缓存组件
  • 支持配置访问秘钥

Usage

快速入门

导入 agollo

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

启动 agollo

package main

import (
	"fmt"
	"github.com/apolloconfig/agollo/v4"
	"github.com/apolloconfig/agollo/v4/env/config"
)

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

	client, _ := agollo.StartWithConfig(func() (*config.AppConfig, error) {
		return c, nil
	})
	fmt.Println("初始化Apollo配置成功")

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

更多用法

使用Demoagollo_demo

其他语言agollo-agent 做本地agent接入,如:PHP

欢迎查阅 Wiki 或者 godoc 获取更多有用的信息

如果你觉得该工具还不错或者有问题,一定要让我知道,可以发邮件或者留言

User

Contribution

License

The project is licensed under the Apache 2 license.

Reference

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

agollo's People

Contributors

zouyx avatar mergify[bot] avatar why444216978 avatar lj99boy avatar ichiro999 avatar siwenzhe avatar withlin avatar dependabot[bot] avatar onanying avatar casper-mars avatar zanderme avatar yldian avatar wubin1989 avatar dependabot-preview[bot] avatar cloverstd avatar jiajunhuang avatar codfrm avatar nobodyiam avatar jiangguangxing avatar marxel-cn avatar winggao avatar fatelei avatar hxzqlh avatar bugmind avatar yellowmarlboro avatar zenghur avatar daemon365 avatar zxdstyle avatar nanashake avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.