Documentation
¶
Index ¶
- Variables
- func ValidEventType(eventType EventType) bool
- type Config
- type Event
- type EventType
- type Manager
- func (m *Manager) AddEventHook(name string, eventType EventType) error
- func (m *Manager) AddSound(path string) error
- func (m *Manager) Close()
- func (m *Manager) GetSound(name string) (*Sound, error)
- func (m *Manager) PlaySound(ctx context.Context, name string) error
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) SendEvent(ctx context.Context, event Event)
- type Sound
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSoundNotFound = errors.New("sound not found")
Functions ¶
func ValidEventType ¶
Types ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() *Config
type EventType ¶
type EventType string
const ( EventInit EventType = "init" EventGitCommitCreate EventType = "git_commit_create" EventGitCommitPush EventType = "git_push" EventFileCreate EventType = "file_create" EventFileWrite EventType = "file_write" EventFileRemove EventType = "file_remove" EventPackageCreate EventType = "package_create" EventPackageUpgrade EventType = "package_upgrade" EventPackageRemove EventType = "package_remove" )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) AddEventHook ¶
AddEventHook takes the 'name' of a sound (the filename, not the full path), and configures Manager to play it whenever an event of 'eventType' is received.
Click to show internal directories.
Click to hide internal directories.