lark

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAudioLength added in v1.2.5

func GetAudioLength(reader io.Reader, bitRateKbps float64) (int, error)

Types

type Client

type Client interface {
	UploadFile(ctx context.Context, fileName string, fileType LarkFileType, fileContent io.Reader) (fileKey string, err error)
	UploadMediaFile(ctx context.Context, fileName string, fileType LarkFileType, fileDuration int, fileContent io.Reader) (fileKey string, err error)
	UploadMessageImage(ctx context.Context, imageContent io.Reader) (imageKey string, err error)
	UploadAvatarImage(ctx context.Context, imageContent io.Reader) (imageKey string, err error)
	SendTextMessage(ctx context.Context, receiver Receiver, text string) (err error)
	SendMarkdownMessage(ctx context.Context, receiver Receiver, markdownHeader, markdownContent string, theme LarkMarkdownMessageTheme) (err error)
	SendImageMessage(ctx context.Context, receiver Receiver, imageContent io.Reader) (err error)
	SendAudioMessage(ctx context.Context, receiver Receiver, opusAudioMilliSeconds int, opusAudioContent io.Reader) (err error)
	GetMessageResourceFile(ctx context.Context, messageID string, fileKey string) (fileContent io.Reader, err error)
}

func NewClient

func NewClient(cfg Config) Client

type Config

type Config struct {
	AppID     string `json:"app_id" yaml:"app_id" xml:"app_id"`
	AppSecret string `json:"app_secret" yaml:"app_secret" xml:"app_secret"`
}

type LarkFileType

type LarkFileType string
const (
	LarkFileTypeOpus   LarkFileType = "opus"
	LarkFileTypeMp4    LarkFileType = "mp4"
	LarkFileTypePdf    LarkFileType = "pdf"
	LarkFileTypeDoc    LarkFileType = "doc"
	LarkFileTypeXls    LarkFileType = "xls"
	LarkFileTypePpt    LarkFileType = "ppt"
	LarkFileTypeStream LarkFileType = "stream"
)

func (LarkFileType) String

func (t LarkFileType) String() string

type LarkImageType

type LarkImageType string
const (
	LarkImageTypeMessage LarkImageType = "message"
	LarkImageTypeAvatar  LarkImageType = "avatar"
)

func (LarkImageType) String

func (t LarkImageType) String() string

type LarkMarkdownMessageTheme

type LarkMarkdownMessageTheme string
const (
	LarkMarkdownMessageThemeBlue      LarkMarkdownMessageTheme = "blue"
	LarkMarkdownMessageThemeWathet    LarkMarkdownMessageTheme = "wathet"
	LarkMarkdownMessageThemeTurquoise LarkMarkdownMessageTheme = "turquoise"
	LarkMarkdownMessageThemeGreen     LarkMarkdownMessageTheme = "green"
	LarkMarkdownMessageThemeYellow    LarkMarkdownMessageTheme = "yellow"
	LarkMarkdownMessageThemeOrange    LarkMarkdownMessageTheme = "orange"
	LarkMarkdownMessageThemeRed       LarkMarkdownMessageTheme = "red"
	LarkMarkdownMessageThemeCarmine   LarkMarkdownMessageTheme = "carmine"
	LarkMarkdownMessageThemeViolet    LarkMarkdownMessageTheme = "violet"
	LarkMarkdownMessageThemePurple    LarkMarkdownMessageTheme = "purple"
	LarkMarkdownMessageThemeIndigo    LarkMarkdownMessageTheme = "indigo"
	LarkMarkdownMessageThemeGrey      LarkMarkdownMessageTheme = "grey"
)

func (LarkMarkdownMessageTheme) String

func (t LarkMarkdownMessageTheme) String() string

type LarkReceiverIdType

type LarkReceiverIdType string
const (
	LarkReceiverIdTypeOpenID  LarkReceiverIdType = "open_id"
	LarkReceiverIdTypeUserID  LarkReceiverIdType = "user_id"
	LarkReceiverIdTypeUnionID LarkReceiverIdType = "union_id"
	LarkReceiverIdTypeEmail   LarkReceiverIdType = "email"
	LarkReceiverIdTypeChatID  LarkReceiverIdType = "chat_id"
)

func (LarkReceiverIdType) String

func (t LarkReceiverIdType) String() string

type Receiver added in v1.2.5

type Receiver struct {
	Type     LarkReceiverIdType `json:"type" yaml:"type" xml:"type"`             // 接收方类型
	Receiver string             `json:"receiver" yaml:"receiver" xml:"receiver"` // 接收方ID,根据type不同而不同
}

Receiver 飞书消息接收方

Directories

Path Synopsis
im

Jump to

Keyboard shortcuts

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