Documentation ¶
Index ¶
- func GetLinksByUser(id string) (*[]Link, error)
- func GetVisits(link_id, start_time string) *[]VisitsPerDay
- func HashPassword(password []byte) (string, error)
- func InitModels()
- func ValidAPIKey(keyString string) (string, error)
- type APIKey
- type EmailVerification
- type GDPRData
- type GenericResponse
- type JWTClaims
- type Link
- func (link *Link) Create() error
- func (link *Link) Delete() error
- func (link *Link) Get() error
- func (link *Link) GetBySlug() error
- func (link *Link) Put(uid string, field string, value interface{}) error
- func (link *Link) Read() error
- func (link *Link) Search() error
- func (link *Link) Update() error
- type PasswordResetToken
- type User
- type UserAuth
- type Visit
- type VisitsPerDay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLinksByUser ¶
GetLinksByUser eturns each link owned by given user id
func GetVisits ¶
func GetVisits(link_id, start_time string) *[]VisitsPerDay
func HashPassword ¶
HashPassword returns a hashed version of given password
func ValidAPIKey ¶
Types ¶
type APIKey ¶
type APIKey struct { ID string `gorm:"primaryKey;type:string;default:uuid_generate_v4()" json:"id,omitempty"` UserID string CreatedAt int64 `gorm:"autoCreateTime" json:"created_at,omitempty"` }
func GenerateAPIKey ¶
type EmailVerification ¶
type EmailVerification struct { Email string jwt.StandardClaims }
EmailVerification jwt claims to be used to verify an email
type GenericResponse ¶
type GenericResponse struct {
Data string `json:"data,omitempty"`
}
GenericResponse contains a generic string
type JWTClaims ¶
type JWTClaims struct { UserID string jwt.StandardClaims }
JWTClaims claims of the jwt
type Link ¶
type Link struct { ID string `gorm:"primaryKey;type:string;default:uuid_generate_v4()" json:"id,omitempty"` OwnerID string `json:"owner_id"` Slug string `gorm:"unique" json:"slug,omitempty"` URL string `json:"url,omitempty"` UnlockTime int64 `json:"unlock_time"` Password string `json:"password"` Visits int `json:"visits"` CreatedAt int64 `gorm:"autoCreateTime" json:"created_at,omitempty"` UpdatedAt int64 `gorm:"autoUpdateTime" json:"updated_at,omitempty"` Lease int64 `json:"lease,omitempty"` }
Link structure containing slug/URL pairs
type PasswordResetToken ¶
type PasswordResetToken struct { User jwt.StandardClaims }
PasswordResetToken contains whole user field and standard claims
type User ¶
type User struct { UID string `gorm:"primaryKey" json:"uid,omitempty"` Username string `json:"display_name,omitempty"` Email string `gorm:"unique" json:"email,omitempty"` CreatedAt int64 `gorm:"autoCreateTime" json:"created_at,omitempty"` UpdatedAt int64 `gorm:"autoUpdateTime" json:"updated_at,omitempty"` }
User structure containing non-authenticative information
type UserAuth ¶
type UserAuth struct { UID string `gorm:"primaryKey;type:string;default:uuid_generate_v4()" json:"uid,omitempty"` Username string `gorm:"unique" json:"username,omitempty"` Email string `gorm:"unique" json:"email,omitempty"` Hash string `json:"hash,omitempty"` Enabled bool `json:"enabled"` Admin bool `json:"admin"` }
UserAuth contains credentials stored serverside
func (*UserAuth) ChangePassword ¶
func (*UserAuth) GetByEmail ¶
func (*UserAuth) VerifyPassword ¶
VerifyPassword compares provided plaintext password against stored hash
type VisitsPerDay ¶
Click to show internal directories.
Click to hide internal directories.