Documentation ¶
Index ¶
Constants ¶
View Source
const (
LAGRANGE_ONEBOT string = "Lagrange.OneBot"
)
Variables ¶
View Source
var ( ErrWebsocketNotConnected = errors.New("websocket not connected") ErrWebsocketClosed = errors.New("websocket closed before response received") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Vendor() string SendEvent(_ *common.OctopusEvent) (*common.OctopusEvent, error) Dispose() }
type LimbClient ¶
type LimbClient struct {
// contains filtered or unexported fields
}
func NewLimbClient ¶
func NewLimbClient(vendor string, config *common.Configure, conn *websocket.Conn, out chan<- *common.OctopusEvent) *LimbClient
func (*LimbClient) Dispose ¶
func (lc *LimbClient) Dispose()
func (*LimbClient) SendEvent ¶
func (lc *LimbClient) SendEvent(event *common.OctopusEvent) (*common.OctopusEvent, error)
send event to limb client, and return response
func (*LimbClient) Vendor ¶
func (lc *LimbClient) Vendor() string
type LimbService ¶
type LimbService struct {
// contains filtered or unexported fields
}
func NewLimbService ¶
func NewLimbService(config *common.Configure, in <-chan *common.OctopusEvent, out chan<- *common.OctopusEvent) *LimbService
func (*LimbService) ServeHTTP ¶
func (ls *LimbService) ServeHTTP(w http.ResponseWriter, r *http.Request)
handle client connnection
func (*LimbService) Start ¶
func (ls *LimbService) Start()
func (*LimbService) Stop ¶
func (ls *LimbService) Stop()
type OnebotClient ¶
type OnebotClient struct {
// contains filtered or unexported fields
}
func NewOnebotClient ¶
func NewOnebotClient(vendor *common.Vendor, agent string, config *common.Configure, conn *websocket.Conn, out chan<- *common.OctopusEvent) *OnebotClient
func (*OnebotClient) Dispose ¶
func (oc *OnebotClient) Dispose()
func (*OnebotClient) SendEvent ¶
func (oc *OnebotClient) SendEvent(event *common.OctopusEvent) (*common.OctopusEvent, error)
send event to onebot client, and return response
func (*OnebotClient) Vendor ¶
func (oc *OnebotClient) Vendor() string
Click to show internal directories.
Click to hide internal directories.