Skip to content
Snippets Groups Projects
Select Git revision
  • 9800aee62cbf3f54ce55487d272753c6f2c35504
  • release default protected
  • more-testing
  • attempt-vax90b1
  • attempt-1
  • conversion protected
  • linux
  • v0.9.1 protected
  • v0.9.0 protected
9 results

messages.go

Blame
  • messages.go 670 B
    // Package folders are all the routines and sql for managing folders.
    package folders
    
    import "time"
    
    // CreateMessage creates a new folder.
    func (s *Store) CreateMessage(author, subject, message, folder string, permanent, shutdown int, expiration *time.Time) error {
    	_, err := s.db.Exec(
    		`INSERT INTO messages
    			(id, folder, author, subject, message, permanent, shutdown, expiration)
    			VALUES
    			($1, $2, $3, $4, $5, $6, $7, $8)`,
    		1, // TODO: how to set this.
    		folder,
    		author,
    		subject,
    		message,
    		permanent,
    		shutdown,
    		expiration, // TODO: handle this being NULL
    	)
    	// TODO: process this error a bit more to give a better error message.
    	return err
    }