Documentation ¶
Index ¶
Constants ¶
const ( LINE_STICKER_STATIC = "line_s" //普通貼圖 LINE_STICKER_ANIMATION = "line_a" //動態貼圖 LINE_STICKER_POPUP = "line_p" //全螢幕 LINE_STICKER_POPUP_EFFECT = "line_f" //特效 LINE_EMOJI_STATIC = "line_e" //表情貼 LINE_EMOJI_ANIMATION = "line_i" //動態表情貼 LINE_STICKER_MESSAGE = "line_m" //訊息 LINE_STICKER_NAME = "line_n" //隨你填 KAKAO_EMOTICON = "kakao_e" //KAKAOTALK普通貼圖 StoreLine = "line" StoreKakao = "kakao" WARN_KAKAO_PREFER_SHARE_LINK = "prefer share link for kakao" )
Line sticker types
Variables ¶
var BSDTAR_BIN = "bsdtar"
Functions ¶
func ParseImportLink ¶
Parse a LINE or Kakao link and fetch metadata. The metadata can be used to call prepareImportStickers. Returns a string and an error. String act as a warning message, empty string means no warning yield.
Attention: During this step, ld.Amount, ld.Files and ld.IsAnimated will NOT be available!
func PrepareImportStickers ¶
func PrepareImportStickers(ctx context.Context, ld *LineData, workDir string, needConvert bool) error
Prepare import stickers files. A context is provided, which can be used to interrupt the process. When this function returns, stickers are ready to be sent to execAutoCommit. However, wg inside each LineFile might still not being done yet, wg.Wait() is required for individual sticker file.
ld.Amount, ld.Files and ld.IsAnimated will be produced after return.
Types ¶
type KakaoJson ¶
type KakaoJson struct {
Result KakaoJsonResult
}
type KakaoJsonResult ¶
type LineData ¶
type LineData struct { //Waitgroup for when linedata become available. Wg sync.WaitGroup //Store type, defined in const. Store string //Store link Link string //Store links for different langs I18nLinks []string //Sticker download link, typically ZIP. DLink string //Sticker download links. DLinks []string //Sticker file paths. Files []*LineFile //Sticker category, defined in const. Category string //Sticker pack ID. Id string //Sticker title appeared in store. Title string //I18n titles for LINE sticker packs, TitleWg must be waited before using this field. I18nTitles []string //WaitGroup for I18nTitles TitleWg sync.WaitGroup IsAnimated bool Amount int }
This is called linedata due to historical reason, instead, it handles "import" data, which includes kakao and line by far.