cmdservice

package
v0.0.0-...-e2e6f4c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Package cmdservice implements hosting of command-sets which can be called by clients via an HTTP-based API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, service string, req commands.HostCommandSet) error

func Wrap

Types

type BP

type BP struct {
	Name       string
	Service    string
	Bind, Self string
	WS         *webservice.Server
}

func Boilerplate

func Boilerplate(name string) *BP

func (*BP) Run

func (bp *BP) Run(sets ...Set)

type Command

type Command struct {
	commands.Command
	Handler webservice.HandlerFunc
}

func Based

func Based(base commands.Command, f func(ipc.MessageContext) ipc.Response) Command

func Simple

func Simple(invoke []string, f func(ipc.MessageContext) ipc.Response) Command

type Set

type Set struct {
	Platform string
	ID       string
	Tag      string
	Commands []Command
	Whisper  bool
}

Jump to

Keyboard shortcuts

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