Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticationMiddleware ¶
Check Authorization token
func DomainMiddleware ¶
Make all domain structs available as martini middleware
Types ¶
type AuthenticationRequest ¶
type Channel ¶
type Channel struct { Uid string `json:"uid"` Name string `json:"name",binding:"required"` Description string `json:"description",binding:"required"` Private bool `json:"isPrivate",binding:"required"` CreatedBy UserUid `json:"createdBy"` // the user UID of the admin Members []UserUid `json:"members"` }
type ChannelDomain ¶
type ChannelDomain struct {
Collection *mgo.Collection
}
func (ChannelDomain) CreateChannel ¶
func (cd ChannelDomain) CreateChannel(channel *Channel, userUid *UserUid) (*string, error)
Creates a new channel, returns the Channel ID
func (ChannelDomain) GetUserChannels ¶
func (cd ChannelDomain) GetUserChannels(userUid *UserUid) (*[]Channel, error)
Returns all channels this user is in
func (ChannelDomain) ListChannels ¶
func (cd ChannelDomain) ListChannels() (*[]Channel, error)
type UserDomain ¶
type UserDomain struct {
Collection *mgo.Collection
}
func (UserDomain) Authenticate ¶
func (ud UserDomain) Authenticate(ar *AuthenticationRequest) (*string, error)
Attempts to authenticate a user and returns a JWT if successful
func (UserDomain) CreateUser ¶
func (ud UserDomain) CreateUser(newUser *NewUser) (*UserUid, error)
Creates a User from a NewUser struct. Returns the new user's UID
Click to show internal directories.
Click to hide internal directories.