wecomrobot

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRobot = "default"

DefaultRobot can be used for general usage. If the construction function called, an option can be provided to setup the default robot. Currently, it can be used for DirectSend() as a name to illustrate which robot should be used to delivery.

Variables

View Source
var ErrRobotName = errors.New("no valid robot found, please check the name of robot you provided")

ErrRobotName represents there is no valid named robot that has been registered before.

Functions

func DirectSend

func DirectSend(ctx context.Context, name, msg string) error

DirectSend will send a message directly

func Get

func Get(name string) *wecomrobot

func Load

func Load(src []byte) error

func New

func New(endpoint string, opts ...Option) *wecomrobot

func Register

func Register(name string, robot *wecomrobot)

Register can be called multiple times so that many rebots can be acceptable message delivers.

Types

type Option

type Option func(o *Options)

func WithDefaultRegistration

func WithDefaultRegistration() Option

func WithReminder added in v0.0.2

func WithReminder(reminder string) Option

type Options

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

Jump to

Keyboard shortcuts

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