Help us shape the future of Go! Take the 2026 Go Developer Survey

lark

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCredentials

func ValidateCredentials(ctx context.Context, appID, appSecret string) error

Types

type ConfigProvider

type ConfigProvider func() (appID, appSecret string)

type Listener

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

func NewListener

func NewListener(handler messaging.EventHandler, configProvider ConfigProvider) *Listener

NewListener constructs a Listener. configProvider is required — callers must supply a function that returns (app_id, app_secret) at dispatch time so credential rotation doesn't require re-instantiating the listener at all (see Manager.startLocked). Tests that only exercise decoding may instantiate Listener directly without going through NewListener.

func (*Listener) Start

func (l *Listener) Start(ctx context.Context) error

func (*Listener) Stop

func (l *Listener) Stop()

Stop marks the listener as stopped so any in-flight or late-arriving events are dropped instead of being re-dispatched to the handler.

type Manager

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

func NewManager

func NewManager(handler messaging.EventHandler, configFn ConfigProvider) *Manager

func (*Manager) Restart

func (m *Manager) Restart()

func (*Manager) Start

func (m *Manager) Start(ctx context.Context)

func (*Manager) Stop

func (m *Manager) Stop()

Stop cancels the current listener. Called from the process shutdown path (cmd/web/main.go via Handler.StopIMListeners) so the WebSocket close races with HTTP shutdown deterministically — without it the read loop's "use of closed network connection" log fires after the rest of the shutdown sequence has already moved on. Also mirrors pkg/messaging/wechat.Manager.Stop so upstream code can treat both platforms symmetrically.

type Replier

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

func NewReplier

func NewReplier(configFn ConfigProvider) *Replier

func (*Replier) ReplyText

func (r *Replier) ReplyText(ctx context.Context, messageID, content string) error

func (*Replier) SendText

func (r *Replier) SendText(ctx context.Context, chatID, content string) error

Jump to

Keyboard shortcuts

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