api

package
v1.2.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package api implements the API route for servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

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

Caller api route caller

func NewCaller

func NewCaller(bot *coolq.CQBot) *Caller

NewCaller create a new API caller

func (*Caller) Call

func (c *Caller) Call(action string, spec *onebot.Spec, p Getter) global.MSG

Call specific API

func (*Caller) Use

func (c *Caller) Use(middlewares ...Handler)

Use add handlers to the API caller

type Getter

type Getter interface {
	Get(string) gjson.Result
}

Getter 参数获取

type Handler

type Handler func(action string, spe *onebot.Spec, p Getter) global.MSG

Handler 中间件

Jump to

Keyboard shortcuts

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