Documentation
¶
Index ¶
- Constants
- func Accept(src core.ContentType, targets ...core.ContentType) bool
- func AcceptInput(component core.ManyInputLimit, targetType core.ContentType) bool
- func AcceptOutput(component core.ManyOutputLimit, targetType core.ContentType) bool
- func BuildTextContentByBytes(data []byte, charset string) core.TextContent
- func BuildTextContentByStr(text string) core.TextContent
- func DefaultSubject() core.Subject
- func LimitType(types ...core.ContentType) []core.ContentType
- func NewSubject(size int) core.Subject
- type BytesTextContent
- type StringContent
Constants ¶
View Source
const ( // Username 用户名 Username core.SubjectMark = iota // Email 电子邮箱 Email // MailSubject 邮件主题 MailSubject )
Variables ¶
This section is empty.
Functions ¶
func Accept ¶
func Accept(src core.ContentType, targets ...core.ContentType) bool
Accept 判断指定的 src 在 targets 上是否可以被接受
func AcceptInput ¶
func AcceptInput(component core.ManyInputLimit, targetType core.ContentType) bool
AcceptInput 判断指定的多输入类型组件是否可以接受目标类型
func AcceptOutput ¶
func AcceptOutput(component core.ManyOutputLimit, targetType core.ContentType) bool
AcceptOutput 判断指定的多输出类型组件是否可以接受目标类型
func BuildTextContentByBytes ¶
func BuildTextContentByBytes(data []byte, charset string) core.TextContent
BuildTextContentByBytes 通过字节数组构建 TextContent 对象
func BuildTextContentByStr ¶
func BuildTextContentByStr(text string) core.TextContent
BuildTextContentByStr 通过字符串构建 TextContent 对象
Types ¶
type BytesTextContent ¶
BytesTextContent 字节数组型文本内容模型
func (BytesTextContent) Bytes ¶
func (content BytesTextContent) Bytes() []byte
Bytes 返回内容的 Byte 数组表现形式
func (BytesTextContent) GetCharset ¶
func (content BytesTextContent) GetCharset() string
func (BytesTextContent) GetText ¶
func (content BytesTextContent) GetText() string
func (BytesTextContent) GetType ¶
func (content BytesTextContent) GetType() core.ContentType
GetType 获取内容类型
type StringContent ¶
type StringContent struct {
// 内容体
Text string
}
StringContent 字符串型文本内容模型
func (StringContent) GetCharset ¶
func (content StringContent) GetCharset() string
GetCharset 获取该文本的字符编码
func (StringContent) GetType ¶
func (content StringContent) GetType() core.ContentType
GetType 获取内容类型
Click to show internal directories.
Click to hide internal directories.