models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type At

type At struct {
	AtMobiles []string `json:"atMobiles"`
	AtAll     bool     `json:"atAll"`
}

type Button

type Button struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type Image

type Image struct {
	Bytes  []byte `json:"bytes"`
	Base64 string `json:"base64"`
	MD5    string `json:"md5"`
}
type Link struct {
	Title  string `json:"title"`
	URL    string `json:"url"`
	PicURL string `json:"picURL"`
}

type Payload

type Payload struct {
	Raw      string   `json:"raw"`
	Title    string   `json:"title"`
	Text     string   `json:"text"`
	Markdown string   `json:"markdown"` // Don't put Title content in Markdown
	Files    []string `json:"files"`
	Images   []Image  `json:"images"`
	Links    []Link   `json:"links"`
	Buttons  []Button `json:"buttons"`
	At       At       `json:"at"`
}

The purpse of Payload is to hide the complexity of constructing channel-specific Msg. Because each specific channel provides suitable Payload2MsgFn(s) convertion functions for its supported msgType(s).

type PayloadGenerator

type PayloadGenerator interface {
	ToPayload() *Payload
}

type Sender

type Sender interface {
	Send(payload *Payload) error
	SendMsg(msg interface{}) error
	SendMsgT(msgType string, msg interface{}) error
}

Jump to

Keyboard shortcuts

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