Documentation
¶
Index ¶
- Variables
- func CreateToken(email string) (string, error)
- func DecryptGitToken(encryptedGitToken string) (string, error)
- func DecryptValue(value, encryptionKey string) (string, error)
- func EncryptGitToken(gitToken string) (string, error)
- func EncryptValue(value, encryptionKey string) (string, error)
- func ExtractToken(r *http.Request) string
- func ExtractTokenID(token string) (string, error)
- func Hash(password string) ([]byte, error)
- func Pretty(data interface{})
- func TokenClaims(token *jwt.Token) (jwt.MapClaims, error)
- func TokenValid(r *http.Request) (string, error)
- func VerifyPassword(hashedPassword, password string) error
- type GitProfile
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminEmail string
View Source
var ApiSecret string
View Source
var DevMode bool
View Source
var JetsEncriptionKey string
View Source
var TokenExpiration int
Functions ¶
func CreateToken ¶
func DecryptGitToken ¶
func DecryptValue ¶
func EncryptGitToken ¶
func EncryptValue ¶
func ExtractToken ¶
func ExtractTokenID ¶
func TokenValid ¶
Check if token is valid, if valid returns the associated email
func VerifyPassword ¶
Types ¶
type GitProfile ¶
type GitProfile struct {
Name string `json:"git_name"`
Email string `json:"git_email"`
GitHandle string `json:"git_handle"`
GitToken string `json:"git_token"`
}
func GetGitProfile ¶
func GetGitProfile(dbpool *pgxpool.Pool, userEmail string) (GitProfile, error)
type User ¶
type User struct {
Name string `json:"name"`
Email string `json:"user_email"`
Password string `json:"password"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Token string `json:"token"`
DevMode string `json:"dev_mode"`
IsActive int `json:"is_active"`
UserGitProfile GitProfile `json:"gitProfile"`
// contains filtered or unexported fields
}
func (*User) BeforeSave ¶
func (*User) GetCapabilities ¶
func (*User) HasCapability ¶
Click to show internal directories.
Click to hide internal directories.