Documentation ¶
Index ¶
- func AddMembership(userid uint64, groupid uint64, role string, collection string, ...) bool
- func GetExpectedReplies(id uint64) []uint64
- func GetLatLng(id uint64) utils.LatLng
- func GetLoveJunkUser(ljuserid uint64, partnerkey string, firstname *string, lastname *string) (*fiber.Error, uint64)
- func GetPublicLocation(c *fiber.Ctx) error
- func GetSearchesForUser(c *fiber.Ctx) error
- func GetUser(c *fiber.Ctx) error
- func NewAuthMiddleware(config Config) fiber.Handler
- func ProfileSetPath(profileid uint64, url string, archived int, profile *UserProfile)
- func WhoAmI(c *fiber.Ctx) uint64
- type Aboutme
- type Config
- type Membership
- type MembershipHistory
- type MembershipTable
- type PersistentToken
- type Phone
- type Publiclocation
- type Ratings
- type Search
- type Tabler
- type User
- type UserEmail
- type UserInfo
- type UserProfile
- type UserProfileRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMembership ¶
func GetExpectedReplies ¶
func GetLoveJunkUser ¶
func GetPublicLocation ¶
func GetPublicLocation(c *fiber.Ctx) error
func GetSearchesForUser ¶
func GetSearchesForUser(c *fiber.Ctx) error
func NewAuthMiddleware ¶
func NewAuthMiddleware(config Config) fiber.Handler
func ProfileSetPath ¶
func ProfileSetPath(profileid uint64, url string, archived int, profile *UserProfile)
Types ¶
type Membership ¶
type Membership struct { MembershipTable Nameshort string `json:"nameshort"` Namefull string `json:"namefull"` Namedisplay string `json:"namedisplay"` Bbox string `json:"bbox"` Microvolunteeringallowed int `json:"microvolunteeringallowed"` }
This is the membership we return to the client. It includes some information not stored in the DB.
func GetMemberships ¶
func GetMemberships(id uint64) []Membership
type MembershipHistory ¶
type MembershipHistory struct { ID uint64 `json:"id" gorm:"primary_key"` Groupid uint64 `json:"groupid"` Userid uint64 `json:"userid"` Added time.Time `json:"added"` Collection string `json:"collection"` Processingrequired bool `json:"processingrequired"` }
func (MembershipHistory) TableName ¶
func (MembershipHistory) TableName() string
type MembershipTable ¶
type MembershipTable struct { ID uint64 `json:"id" gorm:"primary_key"` Groupid uint64 `json:"groupid"` Userid uint64 `json:"userid"` Added time.Time `json:"added"` Collection string `json:"collection"` Emailfrequency int `json:"emailfrequency"` Eventsallowed int `json:"eventsallowed"` Volunteeringallowed int `json:"volunteeringallowed"` Role string `json:"role"` }
func (MembershipTable) TableName ¶
func (MembershipTable) TableName() string
This corresponds to the DB table.
type PersistentToken ¶
type Phone ¶
type Publiclocation ¶
type User ¶
type User struct { ID uint64 `json:"id" gorm:"primary_key"` Firstname *string `json:"firstname"` Lastname *string `json:"lastname"` Fullname *string `json:"fullname"` Displayname string `json:"displayname" gorm:"-"` Profile UserProfile `json:"profile" gorm:"-"` Lastaccess time.Time `json:"lastaccess"` Info UserInfo `json:"info" gorm:"-"` Supporter bool `json:"supporter" gorm:"-"` Donated *time.Time `json:"donated" gorm:"-"` Spammer bool `json:"spammer" gorm:"-"` Showmod bool `json:"showmod" gorm:"-"` Lat float32 `json:"lat" gorm:"-"` // Exact for logged in user, approx for others. Lng float32 `json:"lng" gorm:"-"` Aboutme Aboutme `json:"aboutme" gorm:"-"` Phone string `json:"phone" gorm:"-"` Added time.Time `json:"added"` Lastclicked *time.Time `json:"phonelastclicked" gorm:"-"` Lastsent *time.Time `json:"phonelastsent" gorm:"-"` ExpectedReplies int `json:"expectedreplies" gorm:"-"` ExpectedChats []uint64 `json:"expectedchats" gorm:"-"` Ljuserid *uint64 `json:"ljuserid"` Deleted *time.Time `json:"deleted"` // Only returned for logged-in user. Email string `json:"email" gorm:"-"` Emails []UserEmail `json:"emails" gorm:"-"` Memberships []Membership `json:"memberships" gorm:"-"` Systemrole string `json:"systemrole""` Settings json.RawMessage `json:"settings"` // This is JSON stored in the DB as a string. Relevantallowed bool `json:"relevantallowed"` Newslettersallowed bool `json:"newslettersallowed"` Bouncing bool `json:"bouncing"` Trustlevel *string `json:"trustlevel"` Marketingconsent bool `json:"marketingconsent"` }
func GetUserById ¶
type UserInfo ¶
type UserInfo struct { Replies uint64 `json:"replies"` Taken uint64 `json:"taken"` Reneged uint64 `json:"reneged"` Collected uint64 `json:"collected"` Offers uint64 `json:"offers"` Wanteds uint64 `json:"wanteds"` Openoffers uint64 `json:"openoffers"` Openwanteds uint64 `json:"openwanteds"` Expectedreply uint64 `json:"expectedreply"` Openage uint64 `json:"openage"` Replytime uint64 `json:"replytime"` Ratings Ratings `json:"ratings" gorm:"-"` }
func GetUserInfo ¶
type UserProfile ¶
type UserProfileRecord ¶
type UserProfileRecord struct { ID uint64 `json:"id" gorm:"primary_key"` Profileid uint64 Url string Archived int Useprofile bool `json:"-"` }
func GetProfileRecord ¶
func GetProfileRecord(id uint64) UserProfileRecord
func (UserProfileRecord) TableName ¶
func (UserProfileRecord) TableName() string
Click to show internal directories.
Click to hide internal directories.