Skip to content
Projets

À propos

🚀 Client Go pour ctrip/apollo (https://github.com/apolloconfig/apollo)

Outils de développement

Comment ces chiffres sont mesurés

What you can do

  • Support for multiple IPs, AppIDs, and namespaces
  • Real-time configuration synchronization
  • Gray release configuration
  • Lazy loading (runtime) namespaces

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

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

License

The project is licensed under the Apache 2 license.

Reference

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

Explorer des projets similaires

Chargement…