Documentation ¶
Index ¶
- func CheckCaptcha(db *periwinkle.Tx, userInput string, captchaID string) bool
- func DbDrop(db *periwinkle.Tx) locale.Error
- func DbSchema(db *periwinkle.Tx) locale.Error
- func DbSeed(db *periwinkle.Tx) locale.Error
- func DeleteUnusedTwilioNumber(db *periwinkle.Tx, num string) locale.Error
- func GetTwilioNumberByUserAndGroup(db *periwinkle.Tx, userid string, groupid string) string
- func IsAdmin(db *periwinkle.Tx, userID string, group Group) bool
- func IsSubscribed(db *periwinkle.Tx, userID string, group Group) int
- func PostJoin(m [3]int) map[string]string
- func RandomString(size int) string
- func ReadExist(m [2]int) map[string]string
- func Reverse(m map[string]string) []int
- func UseCaptcha(db *periwinkle.Tx, id, token string) bool
- type Admin
- type Captcha
- type Group
- func GetAllGroups(db *periwinkle.Tx) []Group
- func GetGroupByID(db *periwinkle.Tx, id string) *Group
- func GetGroupByUserAndTwilioNumber(db *periwinkle.Tx, userid string, twilioNum string) *Group
- func GetGroupsByMember(db *periwinkle.Tx, user User) []Group
- func GetPublicAndSubscribedGroups(db *periwinkle.Tx, user User) []Group
- func NewGroup(db *periwinkle.Tx, name string, existence []int, read []int, post []int, ...) *Group
- type Medium
- type Message
- type Session
- type ShortURL
- type Subscription
- type TwilioNumber
- type TwilioPool
- type TwilioSMSMessage
- type User
- func (u *User) CheckPassword(password string) bool
- func (usr *User) Delete(db *periwinkle.Tx)
- func (u *User) GetFrontEndSubscriptions(db *periwinkle.Tx) []Subscription
- func (u *User) GetSubscriptions(db *periwinkle.Tx) []Subscription
- func (usr *User) Save(db *periwinkle.Tx)
- func (u *User) SetPassword(password string)
- type UserAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCaptcha ¶
func CheckCaptcha(db *periwinkle.Tx, userInput string, captchaID string) bool
func DeleteUnusedTwilioNumber ¶
func DeleteUnusedTwilioNumber(db *periwinkle.Tx, num string) locale.Error
func GetTwilioNumberByUserAndGroup ¶
func GetTwilioNumberByUserAndGroup(db *periwinkle.Tx, userid string, groupid string) string
func IsSubscribed ¶
func IsSubscribed(db *periwinkle.Tx, userID string, group Group) int
func RandomString ¶
func UseCaptcha ¶
func UseCaptcha(db *periwinkle.Tx, id, token string) bool
Types ¶
type Captcha ¶
type Captcha struct { ID string `json:"-"` Value string `json:"value"` Token string `json:"-"` Expiration time.Time `json:"expiration_time"` }
func GetCaptchaByID ¶
func GetCaptchaByID(db *periwinkle.Tx, id string) *Captcha
func NewCaptcha ¶
func NewCaptcha(db *periwinkle.Tx) *Captcha
func (*Captcha) Save ¶
func (o *Captcha) Save(db *periwinkle.Tx)
type Group ¶
type Group struct { ID string `json:"group_id"` ReadPublic int `json:"readpublic"` ReadConfirmed int `json:"readconfirmed"` ExistencePublic int `json:"existencepublic"` ExistenceConfirmed int `json:"existenceconfirmed"` PostPublic int `json:"postpublic"` PostConfirmed int `json:"postconformed"` PostMember int `json:"postmember"` JoinPublic int `json:"joinpublic"` JoinConfirmed int `json:"joinconfirmed"` JoinMember int `json:"joinmember"` Subscriptions []Subscription `json:"subscriptions"` }
A Group or mailing list that users may subscribe to.
func GetAllGroups ¶
func GetAllGroups(db *periwinkle.Tx) []Group
func GetGroupByID ¶
func GetGroupByID(db *periwinkle.Tx, id string) *Group
func GetGroupByUserAndTwilioNumber ¶
func GetGroupByUserAndTwilioNumber(db *periwinkle.Tx, userid string, twilioNum string) *Group
func GetGroupsByMember ¶
func GetGroupsByMember(db *periwinkle.Tx, user User) []Group
func GetPublicAndSubscribedGroups ¶
func GetPublicAndSubscribedGroups(db *periwinkle.Tx, user User) []Group
func (*Group) Delete ¶
func (grp *Group) Delete(db *periwinkle.Tx)
func (*Group) GetSubscriberIDs ¶
func (grp *Group) GetSubscriberIDs(db *periwinkle.Tx) []string
func (*Group) GetSubscriptions ¶
func (grp *Group) GetSubscriptions(db *periwinkle.Tx) []Subscription
func (*Group) Save ¶
func (o *Group) Save(db *periwinkle.Tx)
type Message ¶
type Message struct { ID string GroupID string `json:"-" sql:"type:varchar(255) REFERENCES groups(id) ON DELETE CASCADE ON UPDATE RESTRICT"` Unique string }
func GetMessageByID ¶
func GetMessageByID(db *periwinkle.Tx, id string) *Message
func NewMessage ¶
type Session ¶
type Session struct { ID string `json:"session_id"` UserID string `json:"user_id" sql:"type:varchar(255) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE"` LastUsed time.Time `json:"-"` }
func GetSessionByID ¶
func GetSessionByID(db *periwinkle.Tx, id string) *Session
func NewSession ¶
func NewSession(db *periwinkle.Tx, user *User, password string) *Session
func (*Session) Delete ¶
func (o *Session) Delete(db *periwinkle.Tx)
func (*Session) Save ¶
func (o *Session) Save(db *periwinkle.Tx)
type ShortURL ¶
type ShortURL struct { ID string Dest string //*url.URL // TODO: figure out how to have (un)marshalling happen automatically }
func GetShortURLByID ¶
func GetShortURLByID(db *periwinkle.Tx, id string) *ShortURL
func NewShortURL ¶
func NewShortURL(db *periwinkle.Tx, u *url.URL) *ShortURL
func (*ShortURL) Save ¶
func (o *ShortURL) Save(db *periwinkle.Tx)
type Subscription ¶
type Subscription struct { AddressID int64 `sql:"type:bigint REFERENCES user_addresses(id) ON DELETE CASCADE ON UPDATE RESTRICT"` GroupID string `sql:"type:varchar(255) REFERENCES groups(id) ON DELETE CASCADE ON UPDATE RESTRICT"` Confirmed bool }
func NewSubscription ¶
func NewSubscription(db *periwinkle.Tx, addressID int64, groupID string, confirmed bool) Subscription
func (*Subscription) Delete ¶
func (sub *Subscription) Delete(db *periwinkle.Tx)
type TwilioNumber ¶
func GetAllUsedTwilioNumbers ¶
func GetAllUsedTwilioNumbers(db *periwinkle.Tx) (ret []TwilioNumber)
func GetTwilioNumberByID ¶
func GetTwilioNumberByID(db *periwinkle.Tx, id int64) *TwilioNumber
type TwilioPool ¶
type TwilioPool struct { UserID string `json:"user_id" sql:"type:varchar(255) REFERENCES users(id) ON DELETE CASCADE ON UPDATE RESTRICT"` GroupID string `json:"group_id" sql:"type:varchar(255) REFERENCES groups(id) ON DELETE CASCADE ON UPDATE RESTRICT"` NumberID int64 `json:"number_id" sql:"type:bigint REFERENCES twilio_numbers(id) ON DELETE RESTRICT ON UPDATE RESTRICT"` }
func AssignTwilioNumber ¶
func AssignTwilioNumber(db *periwinkle.Tx, userid string, groupid string, twilioNum string) *TwilioPool
func GetTwilioPoolByUserID ¶
func GetTwilioPoolByUserID(db *periwinkle.Tx, userid string) []TwilioPool
type TwilioSMSMessage ¶
type TwilioSMSMessage struct { MessageSID string `json:"MessageSid" sql:"type:varchar(34)"` MessageStatus string ErrorCode string }
func GetTwilioSMSMessageBySID ¶
func GetTwilioSMSMessageBySID(db *periwinkle.Tx, sid string) *TwilioSMSMessage
func (*TwilioSMSMessage) Delete ¶
func (o *TwilioSMSMessage) Delete(db *periwinkle.Tx)
func (*TwilioSMSMessage) Save ¶
func (o *TwilioSMSMessage) Save(db *periwinkle.Tx)
type User ¶
type User struct { ID string `json:"user_id"` FullName string `json:"fullname"` PwHash []byte `json:"-"` Addresses []UserAddress `json:"addresses"` }
func GetUserByAddress ¶
func GetUserByAddress(db *periwinkle.Tx, medium string, address string) *User
func GetUserByID ¶
func GetUserByID(db *periwinkle.Tx, id string) *User
func (*User) CheckPassword ¶
func (*User) Delete ¶
func (usr *User) Delete(db *periwinkle.Tx)
func (*User) GetFrontEndSubscriptions ¶
func (u *User) GetFrontEndSubscriptions(db *periwinkle.Tx) []Subscription
func (*User) GetSubscriptions ¶
func (u *User) GetSubscriptions(db *periwinkle.Tx) []Subscription
func (*User) Save ¶
func (usr *User) Save(db *periwinkle.Tx)
func (*User) SetPassword ¶
type UserAddress ¶
type UserAddress struct { // TODO: add a "verified" boolean ID int64 `json:"-"` UserID string `json:"-" sql:"type:varchar(255) REFERENCES users(id) ON DELETE CASCADE ON UPDATE RESTRICT"` Medium string `json:"medium" sql:"type:varchar(255) REFERENCES media(id) ON DELETE RESTRICT ON UPDATE RESTRICT"` Address string `json:"address"` SortOrder uint64 `json:"sort_order"` Confirmed bool `json:"confirmed"` }
func GetAddressesByUserAndMedium ¶
func GetAddressesByUserAndMedium(db *periwinkle.Tx, userID string, medium string) []UserAddress
func NewUserAddress ¶
func NewUserAddress(db *periwinkle.Tx, userID string, medium string, address string, confirmed bool) UserAddress
func (UserAddress) AsEmailAddress ¶
func (addr UserAddress) AsEmailAddress() string
func (*UserAddress) GetSubscriptions ¶
func (addr *UserAddress) GetSubscriptions(db *periwinkle.Tx) []Subscription
Click to show internal directories.
Click to hide internal directories.