api

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatHistoryQuery added in v1.1.0

type ChatHistoryQuery struct {
	Session string
	Around  int
	Before  int
	After   int
	Limit   int
}

type Server

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

func NewServer

func NewServer(host string, port int, token string) *Server

func (*Server) SetChatHandler

func (s *Server) SetChatHandler(fn func(ctx context.Context, sessionKey, content string) (string, error))

func (*Server) SetChatHistoryHandler

func (s *Server) SetChatHistoryHandler(fn func(query ChatHistoryQuery) []map[string]interface{})

func (*Server) SetConfigAfterHook

func (s *Server) SetConfigAfterHook(fn func(forceRuntimeReload bool) error)

func (*Server) SetConfigPath

func (s *Server) SetConfigPath(path string)

func (*Server) SetCronHandler

func (s *Server) SetCronHandler(fn func(action string, args map[string]interface{}) (interface{}, error))

func (*Server) SetGatewayVersion

func (s *Server) SetGatewayVersion(v string)

func (*Server) SetLogFilePath

func (s *Server) SetLogFilePath(path string)

func (*Server) SetMessageBus added in v1.0.2

func (s *Server) SetMessageBus(mb *bus.MessageBus)

func (*Server) SetProtectedRoute

func (s *Server) SetProtectedRoute(path string, handler http.Handler)

func (*Server) SetSessionSearchHandler added in v1.1.0

func (s *Server) SetSessionSearchHandler(fn func(query SessionSearchQuery) []map[string]interface{})

func (*Server) SetToken

func (s *Server) SetToken(token string)

func (*Server) SetToolsCatalogHandler

func (s *Server) SetToolsCatalogHandler(fn func() interface{})

func (*Server) SetWeixinChannel added in v1.0.1

func (s *Server) SetWeixinChannel(ch *channels.WeixinChannel)

func (*Server) SetWorkspacePath

func (s *Server) SetWorkspacePath(path string)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type SessionSearchQuery added in v1.1.0

type SessionSearchQuery struct {
	Query          string
	Limit          int
	Kinds          []string
	ExcludeCurrent bool
	Session        string
}

Jump to

Keyboard shortcuts

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