wecom

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts map[string]any) (channel.Channel, error)

New creates a WeCom channel adapter.

Types

type HTTPChannel

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

HTTPChannel implements channel.Channel for WeCom HTTP webhook.

func (*HTTPChannel) Name

func (p *HTTPChannel) Name() string

func (*HTTPChannel) ReconstructReplyCtx

func (p *HTTPChannel) ReconstructReplyCtx(sessionKey string) (any, error)

func (*HTTPChannel) RegisterHTTPRoutes

func (p *HTTPChannel) RegisterHTTPRoutes(r chi.Router, callbackPath string, handler channel.MessageHandler)

func (*HTTPChannel) Reply

func (p *HTTPChannel) Reply(ctx context.Context, rctx any, content string) error

func (*HTTPChannel) Send

func (p *HTTPChannel) Send(ctx context.Context, rctx any, content string) error

func (*HTTPChannel) Start

func (p *HTTPChannel) Start(handler channel.MessageHandler) error

func (*HTTPChannel) Stop

func (p *HTTPChannel) Stop() error

type WSChannel

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

WSChannel implements channel.Channel using WeChat Work WebSocket long-connection mode.

func (*WSChannel) AppendStream added in v0.4.0

func (p *WSChannel) AppendStream(ctx context.Context, rctx any, streamID string, content string) error

AppendStream appends content to an existing stream.

func (*WSChannel) FinishStream added in v0.4.0

func (p *WSChannel) FinishStream(ctx context.Context, rctx any, streamID string, finalContent string) error

FinishStream ends the streaming message with final content.

func (*WSChannel) Name

func (p *WSChannel) Name() string

func (*WSChannel) ReconstructReplyCtx

func (p *WSChannel) ReconstructReplyCtx(sessionKey string) (any, error)

func (*WSChannel) Reply

func (p *WSChannel) Reply(ctx context.Context, rctx any, content string) error

func (*WSChannel) Send

func (p *WSChannel) Send(ctx context.Context, rctx any, content string) error

func (*WSChannel) Start

func (p *WSChannel) Start(handler channel.MessageHandler) error

func (*WSChannel) StartStream added in v0.4.0

func (p *WSChannel) StartStream(ctx context.Context, rctx any, content string) (string, error)

StartStream starts a new streaming message, returns the stream ID.

func (*WSChannel) Stop

func (p *WSChannel) Stop() error

Jump to

Keyboard shortcuts

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