analyze

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotMatch = errors.New("not match")
View Source
var ErrRateLimit = errors.New("rate remaining is zero")
View Source
var (
	Functions = []Menu{
		{Name: "menu", Fn: PrintMenu, Match: Equal},
		{Name: "签到", Fn: SignIn, Match: Equal},
		{Name: "绑定位置", Fn: BindArea, Match: Prefix},
	}
)

Functions

func Analyze

func Analyze(ctx context.Context, params Params) (string, error)

func BindArea

func BindArea(ctx context.Context, params Params) (string, error)

func Equal

func Equal(s, v string) bool

func InitLimiter

func InitLimiter()

func Prefix

func Prefix(s, v string) bool

func PrintMenu

func PrintMenu(_ context.Context, _ Params) (string, error)

func SignIn

func SignIn(ctx context.Context, params Params) (string, error)

func SimpleReply

func SimpleReply(ctx context.Context, params Params) (string, error)

SimpleReply 简单回复

func SyncReply

func SyncReply(ctx context.Context)

SyncReply 同步 回复

Types

type Limiter

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

func (*Limiter) Rate

func (l *Limiter) Rate(ctx context.Context, name string, quid int) error

Rate TODO 限流 防止封号 (2t/min CD)

type Menu struct {
	Name  string
	Fn    func(context.Context, Params) (string, error)
	Match func(s, v string) bool
}

type Params

type Params struct {
	QUID    int    `json:"quid"`
	Message string `json:"message"`
}

type QReplyRow

type QReplyRow struct {
	Msg   string   `json:"msg"`
	Reply []string `json:"reply"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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