Documentation ¶
Index ¶
- func APIRateLimit(ak *APIKey) (rate.Limit, int)
- func Bootstrap(ctx context.Context, name, email, password, key string)
- func CacheRateLimit(c *CachedSite) (rate.Limit, int)
- func ChangeSiteVisibility(ctx context.Context, site *Site, public bool)
- func Check(ctx context.Context) bool
- func CleanupDOmain(domain string) string
- func CloseDB(db *gorm.DB) error
- func CountOwnedSites(ctx context.Context, uid uint64) int64
- func CreateApiKey(ctx context.Context, key, name string, uid uint64)
- func CreateSite(ctx context.Context, usr *User, domain string, public bool) bool
- func Database(cfg *config.Options) string
- func DeleteGoal(ctx context.Context, gid, domain string) bool
- func DeleteSharedLink(ctx context.Context, shared *SharedLink)
- func DeleteSite(ctx context.Context, site *Site)
- func EnableWeeklyReport(ctx context.Context, site *Site, usr *User)
- func Exists(ctx context.Context, where func(db *gorm.DB) *gorm.DB) bool
- func Get(ctx context.Context) *gorm.DB
- func GetRole(ctx context.Context) string
- func GoalName(g *Goal) string
- func HashAPIKey(ctx context.Context, key string) string
- func LOG(ctx context.Context, err error, msg string, ...)
- func NewUser(u *User, r *http.Request) (validation map[string]string, err error)
- func Open(path string) (*gorm.DB, error)
- func PasswordMatch(u *User, pwd string) bool
- func PreloadSite(ctx context.Context, u *Site, preload ...string)
- func PreloadUser(ctx context.Context, u *User, preload ...string)
- func ProcessAPIKey(ctx context.Context, key string) (hash, prefix string)
- func QuerySitesToCache(ctx context.Context, fn func(*CachedSite)) (count float64)
- func Role(ctx context.Context, uid, sid uint64) (role string)
- func SafeDomain(s *Site) string
- func Set(ctx context.Context, dbs *gorm.DB) context.Context
- func SetPassword(ctx context.Context, pwd string) (err string)
- func SetRole(ctx context.Context, role string) context.Context
- func SetSite(ctx context.Context, site *Site) context.Context
- func SetUser(ctx context.Context, usr *User) context.Context
- func SharedLinkURL(base string, site *Site, link *SharedLink) string
- func SiteHasGoals(ctx context.Context, domain string) bool
- func UpdateAPIKeyUse(ctx context.Context, aid uint64)
- func UpdateSharedLink(ctx context.Context, shared *SharedLink, name, password string)
- func UpdateSiteStartDate(ctx context.Context, sid uint64, start time.Time)
- func UserIsMember(ctx context.Context, uid, sid uint64) bool
- func ValidateGoals(event, path string) bool
- func ValidateSiteDomain(ctx context.Context, domain string) (good, bad string)
- type APIKey
- type CachedSite
- type CheckStatEmail
- type CreateSiteEmail
- type EmailVerificationCode
- type FeedbackEmail
- type Goal
- type IntroEmail
- type Invitation
- type MonthlyReport
- type SentMonthlyReport
- type SentRenewalNotification
- type SentWeeklyReport
- type SharedLink
- type Site
- type SiteMembership
- type SiteOverView
- type SpikeNotification
- type Subscription
- type User
- type WeeklyReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bootstrap ¶
Create a user and API key. No validation is done. If A User exists no further operations are done.
func CacheRateLimit ¶
func CacheRateLimit(c *CachedSite) (rate.Limit, int)
func CleanupDOmain ¶
func CountOwnedSites ¶
CountOwnedSites counts sites owned by the user.
func DeleteSharedLink ¶
func DeleteSharedLink(ctx context.Context, shared *SharedLink)
func DeleteSite ¶
func PasswordMatch ¶
func QuerySitesToCache ¶
func QuerySitesToCache(ctx context.Context, fn func(*CachedSite)) (count float64)
func SafeDomain ¶
func SharedLinkURL ¶
func SharedLinkURL(base string, site *Site, link *SharedLink) string
func UpdateAPIKeyUse ¶
func UpdateSharedLink ¶
func UpdateSharedLink(ctx context.Context, shared *SharedLink, name, password string)
func UpdateSiteStartDate ¶
func ValidateGoals ¶
Types ¶
type CachedSite ¶
type CheckStatEmail ¶
type CheckStatEmail = schema.CheckStatEmail
type CreateSiteEmail ¶
type CreateSiteEmail = schema.CreateSiteEmail
type EmailVerificationCode ¶
type EmailVerificationCode = schema.EmailVerificationCode
type FeedbackEmail ¶
type FeedbackEmail = schema.FeedbackEmail
type IntroEmail ¶
type IntroEmail = schema.IntroEmail
type Invitation ¶
type Invitation = schema.Invitation
type MonthlyReport ¶
type MonthlyReport = schema.MonthlyReport
type SentMonthlyReport ¶
type SentMonthlyReport = schema.SentMonthlyReport
type SentRenewalNotification ¶
type SentRenewalNotification = schema.SentRenewalNotification
type SentWeeklyReport ¶
type SentWeeklyReport = schema.SentWeeklyReport
type SharedLink ¶
type SharedLink = schema.SharedLink
func CreateSharedLink ¶
func CreateSharedLink(ctx context.Context, sid uint64, name, password string) *SharedLink
func GetSharedLink ¶
func GetSharedLink(ctx context.Context, sid uint64, name string) *SharedLink
func GetSharedLinkWithSlug ¶
func GetSharedLinkWithSlug(ctx context.Context, sid uint64, slug string) *SharedLink
type SiteMembership ¶
type SiteMembership = schema.SiteMembership
type SiteOverView ¶
type SiteOverView struct {
Site *Site
}
type SpikeNotification ¶
type SpikeNotification = schema.SpikeNotification
type Subscription ¶
type Subscription = schema.Subscription
type WeeklyReport ¶
type WeeklyReport = schema.WeeklyReport
Click to show internal directories.
Click to hide internal directories.