domain

package
v0.0.0-...-b6b6a87 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AudioSentEventType event.Type = "events.audio.sent"
View Source
const DoneProcessingFilesEventType event.Type = "events.files.processed"

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioSentEvent

type AudioSentEvent struct {
	event.BaseEvent
	UserID        string
	GuildID       string
	ChannelID     string
	Username      string
	UserAvatarURL string
	Mp3Fullname   string
	FileName      string
	AttachmentID  string
}

func NewAudioSentEvent

func NewAudioSentEvent(id string, userID string, guildID string, channelID string, username string, userAvatarURL string, mp3Fullname string, fileName string, attachmentID string) AudioSentEvent

func (AudioSentEvent) Type

func (e AudioSentEvent) Type() event.Type

type DoneProcessingFilesEvent

type DoneProcessingFilesEvent struct {
	event.BaseEvent
}

func NewDoneProcessingFilesEvent

func NewDoneProcessingFilesEvent(id string) DoneProcessingFilesEvent

func (DoneProcessingFilesEvent) Type

type FileRepository

type FileRepository interface {
	GetFullPath(fileName string) string
	Open(fileName string) (*os.File, error)
	CreateEmpty(fileName string) (*os.File, error)
	DeleteAll(fileNames ...string)
}

type LockedUserRepository

type LockedUserRepository interface {
	GetCurrentLock(guildID string) (string, chan bool)
	ReleaseUserLock(guildID string)
	SetLock(guildID string, userID string)
}

type MP3Decoder

type MP3Decoder interface {
	// GetDuration returns the duration of the mp3 file in seconds
	GetDuration(file *os.File) float64
}

type VoiceData

type VoiceData struct {
	GuildID   string
	ID        string
	Timestamp time.Time
	Name      string
	UserID    string
	Duration  int
}

type VoiceDataRepository

type VoiceDataRepository interface {
	Save(data VoiceData) error
	GetOnRange(guildID string, from time.Time, to time.Time) ([]VoiceData, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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