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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldName = "media"

	TypeImage = "image" // 图片(image):10MB,支持JPG,PNG格式
	TypeVoice = "voice" // 语音(voice) :2MB,播放长度不超过60s,仅支持AMR格式
	TypeVideo = "video" // 视频(video) :10MB,支持MP4格式
	TypeFile  = "file"  // 普通文件(file):20MB
)

Variables

This section is empty.

Functions

func CmdWorkMediaUpload

func CmdWorkMediaUpload(arg *CmdWorkMediaUploadParams) error

CmdWorkMediaUpload 上传临时素材

func ValidateMediaType

func ValidateMediaType(v string) error

ValidateMediaType 验证

Types

type CmdWorkMediaUploadParams

type CmdWorkMediaUploadParams struct {
	UserAgent   string
	AccessToken string
	CorpID      string
	CorpSecret  string
	MediaType   string
	File        string
}

func (*CmdWorkMediaUploadParams) Validate

func (t *CmdWorkMediaUploadParams) Validate() error

type MediaMeta

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

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