Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2023 Changes in this version + const MaterialTypeImage + const MaterialTypeNews + const MaterialTypeThumb + const MaterialTypeVideo + const MaterialTypeVoice + func AddNews(clt *core.Client, news *News) (mediaId string, err error) + func Delete(clt *core.Client, mediaId string) (err error) + func Download(clt *core.Client, mediaId, filepath string) (written int64, err error) + func DownloadToWriter(clt *core.Client, mediaId string, writer io.Writer) (written int64, err error) + func UpdateNews(clt *core.Client, mediaId string, index int, article *Article) (err error) + func UploadImage(clt *core.Client, _filepath string) (mediaId, url string, err error) + func UploadImageFromReader(clt *core.Client, filename string, reader io.Reader) (mediaId, url string, err error) + func UploadThumb(clt *core.Client, _filepath string) (mediaId, url string, err error) + func UploadThumbFromReader(clt *core.Client, filename string, reader io.Reader) (mediaId, url string, err error) + func UploadVideo(clt *core.Client, _filepath string, title, introduction string) (mediaId string, err error) + func UploadVideoFromReader(clt *core.Client, filename string, reader io.Reader, ...) (mediaId string, err error) + func UploadVoice(clt *core.Client, _filepath string) (mediaId string, err error) + func UploadVoiceFromReader(clt *core.Client, filename string, reader io.Reader) (mediaId string, err error) + type Article struct + Author string + Content string + ContentSourceURL string + Digest string + ShowCoverPic int + ThumbMediaId string + Title string + URL string + type BatchGetNewsResult struct + ItemCount int + Items []NewsInfo + TotalCount int + func BatchGetNews(clt *core.Client, offset, count int) (rslt *BatchGetNewsResult, err error) + type BatchGetResult struct + ItemCount int + Items []MaterialInfo + TotalCount int + func BatchGet(clt *core.Client, materialType string, offset, count int) (rslt *BatchGetResult, err error) + type MaterialCountInfo struct + ImageCount int + NewsCount int + VideoCount int + VoiceCount int + func GetMaterialCount(clt *core.Client) (info *MaterialCountInfo, err error) + type MaterialInfo struct + MediaId string + Name string + URL string + UpdateTime int64 + type MaterialIterator struct + func NewMaterialIterator(clt *core.Client, materialType string, offset, count int) (iter *MaterialIterator, err error) + func (iter *MaterialIterator) HasNext() bool + func (iter *MaterialIterator) NextPage() (items []MaterialInfo, err error) + func (iter *MaterialIterator) TotalCount() int + type News struct + Articles []Article + func GetNews(clt *core.Client, mediaId string) (news *News, err error) + type NewsInfo struct + Content struct{ ... } + MediaId string + UpdateTime int64 + type NewsIterator struct + func NewNewsIterator(clt *core.Client, offset, count int) (iter *NewsIterator, err error) + func (iter *NewsIterator) HasNext() bool + func (iter *NewsIterator) NextPage() (items []NewsInfo, err error) + func (iter *NewsIterator) TotalCount() int + type Video struct + Description string + DownloadURL string + Title string + func GetVideo(clt *core.Client, mediaId string) (info *Video, err error)