Categorygithub.com/xiaojiaoyu100/aliyun-acm/v2
modulepackage
2.2.1
Repository: https://github.com/xiaojiaoyu100/aliyun-acm.git
Documentation: pkg.go.dev

# README

aliyun-acm

aliyun-acm是对阿里云应用配置管理的封装

GoDoc

Usage

package main

import (
	"fmt"
	aliacm "github.com/xiaojiaoyu100/aliyun-acm/v2"
	"github.com/xiaojiaoyu100/aliyun-acm/v2/config"
	"github.com/xiaojiaoyu100/aliyun-acm/v2/info"
	"github.com/xiaojiaoyu100/aliyun-acm/v2/observer"
)

func handle(coll map[info.Info]*config.Config) {
    i := info.Info{DataID:"YourGroup", Group: "YourDataID"}
	configI, ok := coll[i]
    if !ok {
        return 
    }   
    
    a := info.Info{DataID:"YourAnotherGroup", Group:"YourAnotherDataID"}
    configA, ok := coll[a]
    if !ok {
        return 
    }   
}

func main() {
	d, err := aliacm.New(
    		aliacm.WithAcm("addr", "tenant", "accessKey", "secretKey"),
    		// aliacm.WithKms("regionId", "accessKey", "secretKey"),
    	)
	if err != nil {
		fmt.Println(err)
		return
	}

	o1, err := observer.New(
		observer.WithInfo(
			info.Info{Group: "YourGroup", DataID: "YourDataID"},
			),
		observer.WithHandler(handle))
	if err != nil {
		return
	}
	o2, err := observer.New(
		observer.WithInfo(
			info.Info{Group: "YourGroup", DataID: "YourDataID"},
			info.Info{Group: "YourAnotherGroup", DataID: "YourAnotherDataID"},
			),
		observer.WithHandler(handle))
	if err != nil {
		return
	}

	var f = func(err error) {
		fmt.Println(err)
	}
	d.SetHook(f)

	d.Register(o1, o2)
        d.NotifyAll()

	select{}
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

GbkToUtf8 converts gbk encoded bytes to utf-8 encoded bytes.
HMACSHA1Encrypt 计算hmac sha1.
Md5 计算md5值.
New 产生Diamond实例.
WithAcm 初始化Acm配置.
WithKms 初始化Kms Client.

# Constants

ApAddr 澳大利亚(悉尼).
BJAddr 华北 2(北京).
DefaultGroup 默认组.
HKAddr 香港.
HZAddr 华东 1(杭州).
PublicAddr 公网(测试).
QDAddr 华北 1(青岛).
SHAddr 华东 2(上海).
ShanghaiFinance1Addr 华东 2(上海)金融云.
SingaporeAddr 新加坡.
SZAddr 华南 1(深圳).
USEast1Addr 美国(弗吉尼亚).
USWest1Addr 美国(硅谷).

# Structs

DeleteConfigRequest 删除配置请求.
Diamond 提供了操作阿里云ACM的能力.
GetAllConfigByTenantRequest 获取空间配置.
GetAllConfigByTenantResponse 获取空间配置回复.
GetConfigRequest 获取配置参数.
No description provided by the author
InfoParam long pull 参数.
Option 参数设置.
PageItem 每一项.
PublishConfigRequest 发布配置请求.

# Type aliases

Error ACM错误.
Hook 重要错误.
Setter configures the diamond.
URL for api construction.