asset

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldName = "media"

	TypeImage = "image" // 图片(image): 10M,支持PNG\JPEG\JPG\GIF格式
	TypeVoice = "voice" // 语音(voice):2M,播放长度不超过60s,支持AMR\MP3格式
	TypeVideo = "video" // 视频(video):10MB,支持MP4格式
	TypeThumb = "thumb" // 缩略图(thumb):64KB,支持 JPG 格式
)

Variables

This section is empty.

Functions

func CmdMediaUpload

func CmdMediaUpload(arg *CmdMediaUploadParams) error

CmdMediaUpload 新增临时素材 微信公众号/小程序

func ValidateMediaType

func ValidateMediaType(v string) error

ValidateMediaType 验证

Types

type CmdMediaUploadParams

type CmdMediaUploadParams struct {
	UserAgent   string
	AccessToken string
	AppID       string
	AppSecret   string
	MediaType   string
	File        string
}

func (*CmdMediaUploadParams) Validate

func (t *CmdMediaUploadParams) Validate() error

type MediaMeta

type MediaMeta struct {
	Type      string `json:"type"`
	MediaID   string `json:"media_id"`
	CreatedAt int64  `json:"created_at"`
}

func MediaUpload

func MediaUpload(accessToken, mediaType, filename string) (*MediaMeta, error)

MediaUpload 微信公众号/小程序 新增临时素材 媒体文件在微信后台保存时间为3天,即3天后media_id失效。

func (MediaMeta) String

func (t MediaMeta) String() string

type MediaResponse

type MediaResponse struct {
	weixin.ResponseMeta
	MediaMeta
}

Jump to

Keyboard shortcuts

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