Documentation ¶
Index ¶
- Constants
- func ContentHandle(path string, c []byte, l astikit.SeverityLogger) httprouter.Handle
- func DirHandle(path string) httprouter.Handle
- func ParseRunnableStartPayload(m *Message) (name string, err error)
- func ParseRunnableStopPayload(m *Message) (name string, err error)
- func ParseUIDisconnectedPayload(m *Message) (name string, err error)
- func ParseUIMessageNamesAddPayload(m *Message) (names []string, err error)
- func ParseUIMessageNamesDeletePayload(m *Message) (names []string, err error)
- func ParseWorkerDisconnectedPayload(m *Message) (worker string, err error)
- func WriteHTTPData(l astikit.SeverityLogger, rw http.ResponseWriter, data interface{})
- func WriteHTTPError(l astikit.SeverityLogger, rw http.ResponseWriter, code int, err error)
- type BaseOperatable
- type BaseRunnable
- func (r *BaseRunnable) Dispatch(m *Message)
- func (r *BaseRunnable) Metadata() Metadata
- func (r *BaseRunnable) NewTask() *astikit.Task
- func (r *BaseRunnable) OnMessage(m *Message) (err error)
- func (r *BaseRunnable) RootCtx() context.Context
- func (r *BaseRunnable) SetDispatchFunc(f DispatchFunc)
- func (r *BaseRunnable) SetRootCtx(ctx context.Context)
- func (r *BaseRunnable) SetTaskFunc(f astikit.TaskFunc)
- func (r *BaseRunnable) Start(ctx context.Context) (err error)
- func (r *BaseRunnable) Status() string
- func (r *BaseRunnable) Stop()
- type BaseRunnableOptions
- type DispatchConditions
- type DispatchFunc
- type Dispatcher
- type Error
- type Identifier
- type Listenable
- type Listenables
- type Message
- func NewListenablesRegisterMessage(from Identifier, to *Identifier, l Listenables) (m *Message, err error)
- func NewMessage() *Message
- func NewRunnableCrashedMessage(from Identifier, to *Identifier) *Message
- func NewRunnableDoneMessage(to *Identifier, d RunnableDone) (m *Message, err error)
- func NewRunnableStartedMessage(from Identifier, to *Identifier) *Message
- func NewRunnableStoppedMessage(from Identifier, to *Identifier) *Message
- func NewUIDisconnectedMessage(from Identifier, to *Identifier, name string) (m *Message, err error)
- func NewUIMessageNamesAddMessage(from Identifier, to *Identifier, names []string) (m *Message, err error)
- func NewUIMessageNamesDeleteMessage(from Identifier, to *Identifier, names []string) (m *Message, err error)
- func NewUIWelcomeMessage(from Identifier, to *Identifier, w WelcomeUI) (m *Message, err error)
- func NewWorkerDisconnectedMessage(from Identifier, to *Identifier, worker string) (m *Message, err error)
- func NewWorkerRegisterMessage(from Identifier, to *Identifier, w Worker) (m *Message, err error)
- func NewWorkerRegisteredMessage(from Identifier, to *Identifier, w Worker) (m *Message, err error)
- func NewWorkerWelcomeMessage(from Identifier, to *Identifier, w WelcomeWorker) (m *Message, err error)
- type MessageHandler
- type Metadata
- type Operatable
- type Runnable
- type RunnableDone
- type RunnableMessage
- type ServerOptions
- type UI
- type WelcomeUI
- type WelcomeWorker
- type Worker
Constants ¶
View Source
const ( IndexIdentifierType = "index" RunnableIdentifierType = "runnable" UIIdentifierType = "ui" WorkerIdentifierType = "worker" )
Identifier types
View Source
const ( ListenablesRegisterMessage = "listenables.register" RunnableCrashedMessage = "runnable.crashed" RunnableDoneMessage = "runnable.done" RunnableStartMessage = "runnable.start" RunnableStartedMessage = "runnable.started" RunnableStopMessage = "runnable.stop" RunnableStoppedMessage = "runnable.stopped" UIDisconnectedMessage = "ui.disconnected" UIMessageNamesAddMessage = "ui.message.names.add" UIMessageNamesDeleteMessage = "ui.message.names.delete" UIPingMessage = "ui.ping" UIRegisterMessage = "ui.register" UIWelcomeMessage = "ui.welcome" WorkerDisconnectedMessage = "worker.disconnected" WorkerRegisterMessage = "worker.register" WorkerRegisteredMessage = "worker.registered" WorkerWelcomeMessage = "worker.welcome" )
Message names
View Source
const ( RunningStatus = "running" StoppedStatus = "stopped" )
Statuses
Variables ¶
This section is empty.
Functions ¶
func ContentHandle ¶
func ContentHandle(path string, c []byte, l astikit.SeverityLogger) httprouter.Handle
func DirHandle ¶
func DirHandle(path string) httprouter.Handle
func WriteHTTPData ¶
func WriteHTTPData(l astikit.SeverityLogger, rw http.ResponseWriter, data interface{})
func WriteHTTPError ¶
func WriteHTTPError(l astikit.SeverityLogger, rw http.ResponseWriter, code int, err error)
Types ¶
type BaseOperatable ¶
type BaseOperatable struct {
// contains filtered or unexported fields
}
func NewBaseOperatable ¶
func NewBaseOperatable() *BaseOperatable
func (*BaseOperatable) AddRoute ¶
func (o *BaseOperatable) AddRoute(path, method string, h httprouter.Handle)
func (*BaseOperatable) AddTemplate ¶
func (o *BaseOperatable) AddTemplate(n string, c []byte)
func (*BaseOperatable) Routes ¶
func (o *BaseOperatable) Routes() map[string]map[string]httprouter.Handle
func (*BaseOperatable) Templates ¶
func (o *BaseOperatable) Templates() map[string][]byte
type BaseRunnable ¶
type BaseRunnable struct {
// contains filtered or unexported fields
}
func NewBaseRunnable ¶
func NewBaseRunnable(o BaseRunnableOptions) *BaseRunnable
func (*BaseRunnable) Dispatch ¶
func (r *BaseRunnable) Dispatch(m *Message)
func (*BaseRunnable) Metadata ¶
func (r *BaseRunnable) Metadata() Metadata
func (*BaseRunnable) NewTask ¶
func (r *BaseRunnable) NewTask() *astikit.Task
func (*BaseRunnable) OnMessage ¶
func (r *BaseRunnable) OnMessage(m *Message) (err error)
func (*BaseRunnable) RootCtx ¶
func (r *BaseRunnable) RootCtx() context.Context
func (*BaseRunnable) SetDispatchFunc ¶
func (r *BaseRunnable) SetDispatchFunc(f DispatchFunc)
func (*BaseRunnable) SetRootCtx ¶
func (r *BaseRunnable) SetRootCtx(ctx context.Context)
func (*BaseRunnable) SetTaskFunc ¶
func (r *BaseRunnable) SetTaskFunc(f astikit.TaskFunc)
func (*BaseRunnable) Status ¶
func (r *BaseRunnable) Status() string
func (*BaseRunnable) Stop ¶
func (r *BaseRunnable) Stop()
type BaseRunnableOptions ¶
type DispatchConditions ¶
type DispatchConditions struct { From *Identifier Name *string Names map[string]bool To *Identifier }
type DispatchFunc ¶
type DispatchFunc func(m *Message)
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(ctx context.Context, t astikit.TaskFunc, l astikit.SeverityLogger) *Dispatcher
func (*Dispatcher) Close ¶
func (d *Dispatcher) Close()
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(m *Message)
func (*Dispatcher) On ¶
func (d *Dispatcher) On(c DispatchConditions, h MessageHandler)
type Identifier ¶
type Identifier struct { Name *string `json:"name,omitempty"` Type string `json:"type,omitempty"` Types map[string]bool `json:"types,omitempty"` Worker *string `json:"worker,omitempty"` }
func NewIndexIdentifier ¶
func NewIndexIdentifier() *Identifier
func NewRunnableIdentifier ¶
func NewRunnableIdentifier(runnable, worker string) *Identifier
func NewUIIdentifier ¶
func NewUIIdentifier(name string) *Identifier
func NewWorkerIdentifier ¶
func NewWorkerIdentifier(name string) *Identifier
func (Identifier) Clone ¶
func (i Identifier) Clone() (o *Identifier)
func (Identifier) WorkerName ¶
func (i Identifier) WorkerName() string
type Listenable ¶
type Listenables ¶
func ParseListenablesRegisterPayload ¶
func ParseListenablesRegisterPayload(m *Message) (l Listenables, err error)
type Message ¶
type Message struct { From Identifier `json:"from"` ID int `json:"id,omitempty"` Name string `json:"name"` Payload json.RawMessage `json:"payload,omitempty"` To *Identifier `json:"to,omitempty"` }
func NewListenablesRegisterMessage ¶
func NewListenablesRegisterMessage(from Identifier, to *Identifier, l Listenables) (m *Message, err error)
func NewMessage ¶
func NewMessage() *Message
func NewRunnableCrashedMessage ¶
func NewRunnableCrashedMessage(from Identifier, to *Identifier) *Message
func NewRunnableDoneMessage ¶
func NewRunnableDoneMessage(to *Identifier, d RunnableDone) (m *Message, err error)
func NewRunnableStartedMessage ¶
func NewRunnableStartedMessage(from Identifier, to *Identifier) *Message
func NewRunnableStoppedMessage ¶
func NewRunnableStoppedMessage(from Identifier, to *Identifier) *Message
func NewUIDisconnectedMessage ¶
func NewUIDisconnectedMessage(from Identifier, to *Identifier, name string) (m *Message, err error)
func NewUIMessageNamesAddMessage ¶
func NewUIMessageNamesAddMessage(from Identifier, to *Identifier, names []string) (m *Message, err error)
func NewUIMessageNamesDeleteMessage ¶
func NewUIMessageNamesDeleteMessage(from Identifier, to *Identifier, names []string) (m *Message, err error)
func NewUIWelcomeMessage ¶
func NewUIWelcomeMessage(from Identifier, to *Identifier, w WelcomeUI) (m *Message, err error)
func NewWorkerDisconnectedMessage ¶
func NewWorkerDisconnectedMessage(from Identifier, to *Identifier, worker string) (m *Message, err error)
func NewWorkerRegisterMessage ¶
func NewWorkerRegisterMessage(from Identifier, to *Identifier, w Worker) (m *Message, err error)
func NewWorkerRegisteredMessage ¶
func NewWorkerRegisteredMessage(from Identifier, to *Identifier, w Worker) (m *Message, err error)
func NewWorkerWelcomeMessage ¶
func NewWorkerWelcomeMessage(from Identifier, to *Identifier, w WelcomeWorker) (m *Message, err error)
type MessageHandler ¶
type Operatable ¶
type RunnableDone ¶
func ParseRunnableDonePayload ¶
func ParseRunnableDonePayload(m *Message) (d RunnableDone, err error)
type RunnableMessage ¶
type ServerOptions ¶
type UI ¶
func ParseUIRegisterPayload ¶
type WelcomeWorker ¶
type WelcomeWorker struct { UIMessageNames []string `json:"ui_message_names,omitempty"` Workers []Worker `json:"workers,omitempty"` }
func ParseWorkerWelcomePayload ¶
func ParseWorkerWelcomePayload(m *Message) (w WelcomeWorker, err error)
type Worker ¶
type Worker struct { Addr string `json:"addr,omitempty"` Name string `json:"name"` Runnables []RunnableMessage `json:"runnables,omitempty"` }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
abilities
|
|
audio_input
Generated by cmd/operatable DO NOT EDIT
|
Generated by cmd/operatable DO NOT EDIT |
speech_to_text
Generated by cmd/operatable DO NOT EDIT
|
Generated by cmd/operatable DO NOT EDIT |
cmd
|
|
Click to show internal directories.
Click to hide internal directories.