iface

package
v0.0.0-...-d5cfa09 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AudioStatePlaying  = "PLAYING"
	AudioStateStoped   = "STOPED"
	AudioStatePaused   = "PAUSED"
	AudioStateFinished = "FINISHED"
)

Variables

View Source
var (
	DefaultRegistry = &Registry{
		services: make(map[string]*service),
	}
)

Functions

func RegisterService

func RegisterService(receiver interface{}, name string) error

Types

type AudioPlayer

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

func NewAudioPlayer

func NewAudioPlayer() *AudioPlayer

func (*AudioPlayer) Context

func (a *AudioPlayer) Context() *proto.Message

func (*AudioPlayer) Pause

func (a *AudioPlayer) Pause(m *proto.Message) error

func (*AudioPlayer) Play

func (a *AudioPlayer) Play(m *proto.Message) error

func (*AudioPlayer) Resume

func (a *AudioPlayer) Resume(m *proto.Message) error

func (*AudioPlayer) Stop

func (a *AudioPlayer) Stop(m *proto.Message) error

type Contexter

type Contexter interface {
	Context() *proto.Message
}

type Registry

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

Registry负责注册所有的用户接口对象,提供Dispatch方法来分发指令到具体的对象 同时也提供Context方法返回当前所有对象的状态

func (*Registry) Context

func (r *Registry) Context() []*proto.Message

func (*Registry) Dispatch

func (r *Registry) Dispatch(m *proto.Message) error

func (*Registry) GetService

func (r *Registry) GetService(namespace string) interface{}

func (*Registry) RegisterService

func (r *Registry) RegisterService(receiver interface{}, name string) error

type Screen

type Screen struct {
}

func (*Screen) RenderVoiceInputText

func (s *Screen) RenderVoiceInputText(m *proto.Message) error

type ScreenExtendedCard

type ScreenExtendedCard struct {
}

func (*ScreenExtendedCard) RenderPlayerInfo

func (s *ScreenExtendedCard) RenderPlayerInfo(m *proto.Message) error

type VoiceInput

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

func NewVoiceInput

func NewVoiceInput() *VoiceInput

func (*VoiceInput) Listen

func (v *VoiceInput) Listen(m *proto.Message) error

func (*VoiceInput) StopListen

func (v *VoiceInput) StopListen(m *proto.Message) error

type VoiceOutput

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

func NewVoiceOutput

func NewVoiceOutput() *VoiceOutput

func (*VoiceOutput) Pause

func (v *VoiceOutput) Pause(m *proto.Message) error

func (*VoiceOutput) Speak

func (v *VoiceOutput) Speak(m *proto.Message) error

Jump to

Keyboard shortcuts

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