restful

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugMode indicates mode is debug.
	DebugMode = "debug"
	// ReleaseMode indicates mode is release.
	ReleaseMode = "release"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

Message 消息

func NewMessage

func NewMessage(conf *config.Config, log logr.Logger) (*Message, error)

NewMessage createNewMessage

func (*Message) BatchMessage

func (m *Message) BatchMessage(c *gin.Context)

BatchMessage 批量发消息

func (*Message) DeleteMessage

func (m *Message) DeleteMessage(c *gin.Context)

DeleteMessage delete message_list by id

func (*Message) GetMessageByID

func (m *Message) GetMessageByID(c *gin.Context)

GetMessageByID 根据id得到返回值

func (*Message) MessageList

func (m *Message) MessageList(c *gin.Context)

MessageList get message_list by condition

func (*Message) SaveMessage

func (m *Message) SaveMessage(c *gin.Context)

SaveMessage 保存消息,但是不发送消息、在上一次草稿的基础之上,直接发送消息,直接发送消息,

type Record

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

Record 消息发送结构体

func NewRecord

func NewRecord(conf *config.Config, log logr.Logger) (*Record, error)

NewRecord NewRecord

func (*Record) AllRead

func (m *Record) AllRead(c *gin.Context)

AllRead update already read basis of receiverID

func (*Record) CenterMsByID

func (m *Record) CenterMsByID(c *gin.Context)

CenterMsByID find message by id

func (*Record) DeleteByIDs

func (m *Record) DeleteByIDs(c *gin.Context)

DeleteByIDs delete message by IDs

func (*Record) GetMesSendList

func (m *Record) GetMesSendList(c *gin.Context)

GetMesSendList get by condition

func (*Record) GetNumber

func (m *Record) GetNumber(c *gin.Context)

GetNumber dep reciver get not read number

func (*Record) ReadByIDs

func (m *Record) ReadByIDs(c *gin.Context)

ReadByIDs read message by Ids

type Router

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

Router 路由

func NewRouter

func NewRouter(ctx context.Context, c *config.Config, rf []RouterOption, log logr.Logger) (*Router, error)

NewRouter 开启路由

func (*Router) Close

func (r *Router) Close()

Close 关闭服务

func (*Router) Run

func (r *Router) Run()

Run 启动服务

type RouterOption

type RouterOption func(*gin.RouterGroup) error

func WithBus

func WithBus(bus *core.Bus) RouterOption

func WithSender

func WithSender(cz *service.CacheZone, manager *wm.Manager) RouterOption

func WithWebSocket

func WithWebSocket(ctx context.Context, ws *Websocket) RouterOption

type Template

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

Template Controller

func NewTemplate

func NewTemplate(conf *config.Config, log logr.Logger) (*Template, error)

NewTemplate 创建

func (*Template) CreateTemplate

func (t *Template) CreateTemplate(c *gin.Context)

CreateTemplate 生成Template 模板

func (*Template) DeleteTemplate

func (t *Template) DeleteTemplate(c *gin.Context)

DeleteTemplate 删除

func (*Template) QueryTemplatePage

func (t *Template) QueryTemplatePage(c *gin.Context)

QueryTemplatePage 条件查询

func (*Template) UpdateTemplate

func (t *Template) UpdateTemplate(c *gin.Context)

UpdateTemplate update

type Websocket

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

func NewWebsocket

func NewWebsocket(ctx context.Context, conf *config.Config, manager *wm.Manager, log logr.Logger) (*Websocket, error)

func (*Websocket) Handler

func (w *Websocket) Handler(c *gin.Context)

Handler Handler

Jump to

Keyboard shortcuts

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