core

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoContent       = errors.New("NoContent")
	ErrTooLargeContent = errors.New("TooLargeContent")
	ErrInvalidContent  = errors.New("InvalidContent")
)

error define

Functions

This section is empty.

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core instance

func New

func New() *Core

New core instance

func (*Core) APIHandler

func (c *Core) APIHandler() http.Handler

APIHandler return handler for http

func (*Core) Close

func (c *Core) Close()

Close & cleaup for core

func (*Core) Init added in v0.9.0

func (c *Core) Init(opts *logic.Options) error

Init core with option

type JSONString added in v1.1.0

type JSONString string

JSONString define boolean string

func (*JSONString) UnmarshalJSON added in v1.1.0

func (s *JSONString) UnmarshalJSON(data []byte) error

UnmarshalJSON for boolean string

type MsgParam added in v1.1.1

type MsgParam struct {
	Token             *model.Token
	Text              string
	Link              string
	Title             string
	Sound             string
	AutoCopy          string
	CopyText          string
	Filename          string
	Priority          int
	InterruptionLevel string
	Actions           []string
	TimeContent       TimeContent
}

MsgParam parse message parameters

func (*MsgParam) ParseAudio added in v1.1.6

func (m *MsgParam) ParseAudio(c *Core, ctx *gin.Context) (*model.Message, error)

ParseAudio process audio

func (*MsgParam) ParseForm added in v1.1.1

func (m *MsgParam) ParseForm(c *Core, ctx *gin.Context)

ParseForm process form

func (*MsgParam) ParseFormData added in v1.1.1

func (m *MsgParam) ParseFormData(c *Core, ctx *gin.Context) (*model.Message, error)

ParseFormData process multipart/form-data

func (*MsgParam) ParseImage added in v1.1.1

func (m *MsgParam) ParseImage(c *Core, ctx *gin.Context) (*model.Message, error)

ParseImage process image

func (*MsgParam) ParseJSON added in v1.1.1

func (m *MsgParam) ParseJSON(c *Core, ctx *gin.Context)

ParseJSON process application/json

func (*MsgParam) ParsePlainText added in v1.1.1

func (m *MsgParam) ParsePlainText(ctx *gin.Context)

ParsePlainText process text/plain

type TimeContent added in v1.2.2

type TimeContent struct {
	Code      string
	Timestamp *time.Time
	Items     []*model.MsgTimeItem
}

TimeContent define timeline content

Jump to

Keyboard shortcuts

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