goacm

package module
v0.0.0-...-524fbf8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 19 Imported by: 0

README

Aliyun ACM SDK for Golang

Build Status GoDoc

Aliyun acm sdk for golang, support multiple IP

Usage

import "github.com/goapt/goacm"

client, err := goacm.NewClient(func(c *Client) {
    c.AccessKey = "******"
    c.SecretKey = "******"
    c.EndPoint  = "acm.aliyun.com"
    c.NameSpace = "******"
})

if err != nil {
    log.Fatal(err)
}

//get config
ret, err := client.GetConfig("test", "DEFAULT_GROUP")

//Subscribe
ret, err := client.Subscribe("test", "DEFAULT_GROUP","")

//publish config
ret, err := client.Publish("test", "DEFAULT_GROUP","test")

//remove config
ret, err := client.Delete("test", "DEFAULT_GROUP")

License

The SDK is open-sourced software licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func GbkToUtf8Reader

func GbkToUtf8Reader(s io.Reader) io.Reader

return utf8

func MustGbkToUtf8

func MustGbkToUtf8(s []byte) []byte

func MustUtf8ToGbk

func MustUtf8ToGbk(s []byte) []byte

func Utf8ToGbk

func Utf8ToGbk(s []byte) ([]byte, error)

func Utf8ToGbkReader

func Utf8ToGbkReader(s io.Reader) io.Reader

return gbk

Types

type Client

type Client struct {
	AccessKey string
	SecretKey string
	EndPoint  string
	NameSpace string
	TimeOut   int

	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(option func(c *Client)) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(dateId, group string) (string, error)

func (*Client) GetAllConfigs

func (c *Client) GetAllConfigs(pageNo, pageSize int) (string, error)

func (*Client) GetConfig

func (c *Client) GetConfig(dataId, group string) (string, error)

func (*Client) GetServers

func (c *Client) GetServers() map[int]string

func (*Client) Publish

func (c *Client) Publish(dataId, group, content string) (string, error)

func (*Client) Subscribe

func (c *Client) Subscribe(dataId, group, contentMd5 string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL