zoukankan      html  css  js  c++  java
  • go 访问apollo配置

    package main
    import (
    "fmt"
    "github.com/zouyx/agollo/v4"
    "github.com/zouyx/agollo/v4/env/config"
    )

    func main() {
    c := &config.AppConfig{
    AppID: "xx",
    Cluster: "dev",
    IP: "http://xxx:xx",
    NamespaceName: "application",
    }


    client, err := agollo.StartWithConfig(func() (*config.AppConfig, error) {
    return c, nil
    })
    if err != nil {
    fmt.Println(err)
    panic(err)
    }
    fmt.Println("init Apollo success")
    //Use your apollo key to test
    value := client.GetStringValue("xxx","")
    fmt.Println("redishost:" + value)
    }
  • 相关阅读:
    Go
    Go
    Go
    Go
    Go
    Go
    爬虫常用相关库
    Go
    python基础第7天(day19)
    python基础第五天(day17)元组,集合,字符串操作 字符编码:
  • 原文地址:https://www.cnblogs.com/wangyu19900123/p/14890037.html
Copyright © 2011-2022 走看看