lark

package
v1.6.5-rc49 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMessage   = errors.New("invalid message")
	ErrInvalidSignature = errors.New("invalid signature")
)

Functions

func Build

func Build(ctx context.Context, title, level, content string) ([]byte, error)

func ResponseHook

func ResponseHook(body []byte) error

func TagElementToMap

func TagElementToMap(e TagElement) (map[string]interface{}, error)

func TagElementsToMap

func TagElementsToMap(elem ...TagElement) ([][]map[string]interface{}, error)

Types

type Content

type Content struct {
	Post map[string]ContentBody `json:"post"`
}

type ContentBody

type ContentBody struct {
	Title           string                     `json:"title"`
	ContentElements [][]map[string]interface{} `json:"content"`
}

type ElementHref

type ElementHref struct {
	Text string `mapstructure:"text"`
	Ref  string `mapstructure:"href"`
}

func (*ElementHref) Tag

func (v *ElementHref) Tag() string

type ElementImg

type ElementImg struct {
	ImageKey string `mapstructure:"image_key"`
	W        int    `mapstructure:"width"`
	H        int    `mapstructure:"height"`
}

func (*ElementImg) Tag

func (v *ElementImg) Tag() string

type ElementPin

type ElementPin struct {
	UserID string `mapstructure:"user_id"`
}

func (*ElementPin) Tag

func (v *ElementPin) Tag() string

type ElementText

type ElementText struct {
	Text string `mapstructure:"text"`
}

func (*ElementText) Tag

func (v *ElementText) Tag() string

type TagElement

type TagElement interface {
	Tag() string
}

Jump to

Keyboard shortcuts

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