Categorygithub.com/leisc/aliyun-acm
modulepackage
2.0.7+incompatible
Repository: https://github.com/leisc/aliyun-acm.git
Documentation: pkg.go.dev

# README

aliyun-acm

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

Usage

package main

import (
	"fmt"
	"github.com/xiaojiaoyu100/aliyun-acm"
)


func Handle(config aliacm.Config)  {
	fmt.Println(string(config.Content))
}

func main() {
	d, err := aliacm.New(
		"your_addr",
		"your_tenant",
		"your_access_key",
		"your_secret_key")
	if err != nil {
		return
	}
	var f = func(h aliacm.Unit, err error) {
		fmt.Println(err)
	}
	d.SetHook(f)
	unit := aliacm.Unit{
		Group: "your_group",
		DataID: "your_data_id",
		FetchOnce: true, // 有且仅拉取一次
		OnChange: Handle,
	}
	d.Add(unit)
	select{}
}

# Functions

GbkToUtf8 converts gbk encoded bytes to utf-8 encoded bytes.
HMACSHA1Encrypt 计算hmac sha1.
Md5 计算md5值.
New 产生Diamond实例.

# Constants

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

# Structs

Config 返回配置.
DeleteConfigRequest 删除配置请求.
Diamond 提供了操作阿里云ACM的能力.
GetAllConfigByTenantRequest 获取空间配置.
GetAllConfigByTenantResponse 获取空间配置回复.
GetConfigRequest 获取配置参数.
Option 参数设置.
PageItem 每一项.
PublishConfigRequest 发布配置请求.
Unit 配置基本单位.

# Type aliases

Handler 提供了配置的回调,.
Hook 提供了长轮询失败发生的回调.
URL for api construction.