Documentation ¶
Index ¶
- func ChangePassword(userId, password string) map[string]interface{}
- func DeleteKey(keyId string) map[string]interface{}
- func DeleteUser(userId string) map[string]interface{}
- func FetchAllKeyAccessLog() map[string]interface{}
- func FetchAllKeys() map[string]interface{}
- func FetchAllUsers() map[string]interface{}
- func GetDB() *gorm.DB
- func GetKey(keyId string) map[string]interface{}
- func GetUser(userId string) map[string]interface{}
- func Login(email, password string) map[string]interface{}
- func SeedFirstUser()
- func UpdateUser(userId, name, email string) map[string]interface{}
- type Key
- type KeyAccessLog
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePassword ¶
func DeleteUser ¶
func FetchAllKeyAccessLog ¶
func FetchAllKeyAccessLog() map[string]interface{}
func FetchAllKeys ¶
func FetchAllKeys() map[string]interface{}
func FetchAllUsers ¶
func FetchAllUsers() map[string]interface{}
func SeedFirstUser ¶
func SeedFirstUser()
func UpdateUser ¶
Types ¶
type Key ¶
type Key struct { ID uint `gorm:"primary_key"` Domain string `gorm:"not null;unique_index" json:"domain"` Key string `gorm:"not null" json:"key"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ExpiredAt *time.Time `json:"expired_at"` UpdateKey bool `gorm:"-" json:"update_key"` }
a struct to represent key
func (*Key) FindByDomain ¶
type KeyAccessLog ¶
type KeyAccessLog struct { Domain string `gorm:"not null;index" json:"domain"` Key string `gorm:"not null" json:"key"` Referrer string `json:"referrer"` UserAgent string `json:"referrer"` RequestedAt time.Time `gorm:"not null" json:"requested_at"` Status bool `gorm:"not null" json:"update_key"` Message string `json:"message"` }
a struct to represent key access log
func (*KeyAccessLog) Create ¶
func (keyAccessLog *KeyAccessLog) Create() bool
Click to show internal directories.
Click to hide internal directories.