Documentation ¶
Index ¶
- Constants
- Variables
- type Soundbite
- type SoundbiteModel
- func (m *SoundbiteModel) Delete(name, uid string) error
- func (m *SoundbiteModel) Exists(name, hash string) (bool, error)
- func (m *SoundbiteModel) Get(name string) (*Soundbite, error)
- func (m *SoundbiteModel) GetAll() ([]*Soundbite, error)
- func (m *SoundbiteModel) Initialize() error
- func (m *SoundbiteModel) Insert(name, username, uid, filepath, filehash string) (int, error)
- func (m *SoundbiteModel) UpdateName(oldName, newName string) error
Constants ¶
View Source
const (
TIME_LAYOUT = "2006-01-02 15:04:05"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Soundbite ¶
type Soundbite struct { ID int Name string Username string UserID string FilePath string FileHash string Created time.Time }
Struct to present a record in the 'soundbites' table
type SoundbiteModel ¶
Struct that holds the database connectivity
func (*SoundbiteModel) Delete ¶
func (m *SoundbiteModel) Delete(name, uid string) error
Deletes the soundbite if the user_id and name belong to the same record
func (*SoundbiteModel) Exists ¶
func (m *SoundbiteModel) Exists(name, hash string) (bool, error)
Check whether a soundbite exists based on the name of the command and it's filehash
func (*SoundbiteModel) Get ¶
func (m *SoundbiteModel) Get(name string) (*Soundbite, error)
Gets a Soundbite based on the name command
func (*SoundbiteModel) GetAll ¶
func (m *SoundbiteModel) GetAll() ([]*Soundbite, error)
Get all the soundbites in the 'soundbites' table
func (*SoundbiteModel) Initialize ¶
func (m *SoundbiteModel) Initialize() error
Initialize the 'soundbites' table in the sqlite db
func (*SoundbiteModel) Insert ¶
func (m *SoundbiteModel) Insert(name, username, uid, filepath, filehash string) (int, error)
Insert Soundbites metadata into the 'soundbites' table
func (*SoundbiteModel) UpdateName ¶
func (m *SoundbiteModel) UpdateName(oldName, newName string) error
Click to show internal directories.
Click to hide internal directories.