serverchan_sdk

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 4 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ServerChan SDK for Golang

这是用于调用 ServerChan 推送服务的 Go SDK,包名为 serverchan-sdk,仓库地址为 github.com/easychen/serverchan-sdk-golang。

安装

go get github.com/easychen/serverchan-sdk-golang

使用示例

package main

import (
    "fmt"
    "github.com/easychen/serverchan-sdk-golang"
)

func main() {
    sendkey := "your-sendkey"
    title := "Test Message"
    desp := "This is a test message"
    
    resp, err := serverchan_sdk.ScSend(sendkey, title, desp, nil)
    if err != nil {
        fmt.Println("Error:", err)
    } else {
        fmt.Println("Response:", resp)
    }
}

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScSendOptions

type ScSendOptions struct {
	Tags    string `json:"tags,omitempty"`
	Short   string `json:"short,omitempty"`
	Noip    int    `json:"noip,omitempty"`
	Channel string `json:"channel,omitempty"`
	Openid  string `json:"openid,omitempty"`
}

type ScSendResponse

type ScSendResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

func ScSend

func ScSend(sendkey, title, desp string, options *ScSendOptions) (*ScSendResponse, error)

Jump to

Keyboard shortcuts

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