policy

package
v0.0.0-...-53bda00 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGgStyleRGB

func GetGgStyleRGB(r int, g int, b int) (float64, float64, float64)

func GetGgStyleRGBA

func GetGgStyleRGBA(r int, g int, b int, a int) (float64, float64, float64, float64)

func ImgToBytes

func ImgToBytes(img image.Image, imgType ImageType) []byte

func ImgWriteText

func ImgWriteText(fileName string, text string, drawStringConfig DrawStringConfig, imgDir embed.FS, fontDir embed.FS) (image.Image, error)

func ImgWriteTextDefault

func ImgWriteTextDefault(fileName string, text string, imgDir embed.FS, fontDir embed.FS) (image.Image, error)

func UnicodeIndex

func UnicodeIndex(str, substr string) int

Types

type ContentItem

type ContentItem struct {
	Img      string   `json:"img"`
	Emoji    []string `json:"emoji"`
	Emoticon []string `json:"emoticon"`
	Keyword  []string `json:"keyword"`
	Role     []string `json:"role"`
}

type DrawStringConfig

type DrawStringConfig struct {
	Ax          float64
	Ay          float64
	FontFamily  string
	TextBgColor *RGBA
}

type ImageType

type ImageType int
const (
	Unknown ImageType = iota
	Png
	Jpg
	Jpeg
	Gif
)

func GetImgTypeByFileName

func GetImgTypeByFileName(fileName string) ImageType

type ImgDef

type ImgDef struct {
	Version string        `json:"version"`
	Content []ContentItem `json:"content"`
}

func (*ImgDef) GetMaps

func (d *ImgDef) GetMaps() SymbolMaps

type RGBA

type RGBA struct {
	R int
	G int
	B int
	A int
}

type Reply

type Reply struct {
	Type ReplyType
	Body []byte
}

func UserText

func UserText(userText string, symbolMaps *SymbolMaps, imgDir embed.FS, fontDir embed.FS) Reply

type ReplyType

type ReplyType int
const (
	Failed ReplyType = iota
	Text
	Image
)

type SymbolMaps

type SymbolMaps struct {
	EmojiMap map[string]mapset.Set
	EmotiMap map[string]mapset.Set
	KwordMap map[string]mapset.Set
	RoleMap  map[string]mapset.Set
}

func (*SymbolMaps) ContainsAny

func (s *SymbolMaps) ContainsAny(key string) bool

func (*SymbolMaps) ContainsEmoji

func (s *SymbolMaps) ContainsEmoji(key string) bool

func (*SymbolMaps) ContainsEmoti

func (s *SymbolMaps) ContainsEmoti(key string) bool

func (*SymbolMaps) ContainsKword

func (s *SymbolMaps) ContainsKword(key string) bool

func (*SymbolMaps) ContainsRole

func (s *SymbolMaps) ContainsRole(key string) bool

Jump to

Keyboard shortcuts

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