cucloud

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 14 Imported by: 0

README

CuCloud

CUCloud is the cloud service brand of China Unicom

Usage

  1. Create a pair of accessKey and accessKeySecret in https://console.cucloud.cn/console/uiam/user/${your_id}/info
  2. Create a topic
// define accessKey and  accessKeySecret
accessKey := ""
secretKey := ""

// create client
cuCloudClient := New(accessKey, secretKey, "topic_name", "message title", "cloud region code", "account id", "notify type")

// send message
err := cuCloudClient.Send(context.Background(), "", "content")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CuCloud

type CuCloud struct {
	AccessKey       string
	SecretKey       string
	TopicName       string
	MessageTitle    string
	CloudRegionCode string
	AccountId       string
	NotifyType      string
	Client          http.Client
}

func New

func New(accessKey, secretKey, topicName, messageTitle, cloudRegionCode, accountId, notifyType string) *CuCloud

func (*CuCloud) Send

func (c *CuCloud) Send(ctx context.Context, subject, content string) error

type CuCloudResp

type CuCloudResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Result  string `json:"result"`
}

Jump to

Keyboard shortcuts

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