Documentation
¶
Index ¶
- Constants
- func GenerateCookie(cookieSecret *securecookie.SecureCookie, name string, value string, ...) *http.Cookie
- func GenerateExpiredCookie(name string) *http.Cookie
- func GenerateToken(secretKey []byte, userID string, expDuration time.Duration) (string, error)
- func GetKeysFromEmail(email string) (string, string)
- func NewHashedUUID(hashItem string) string
- func NewPostRecordPK(userID string) string
- func NewPostRecordSK(postID string) string
- func NewUUID() string
- func NewUserRecordKey(id string) string
- func ParseCookie(r *http.Request, cookieSecret *securecookie.SecureCookie, name string) (string, error)
- type Claims
- type DeleteFilesDto
- type LoginDto
- type Post
- type PostDto
- type PostRecord
- type Record
- type RegisterDto
- type User
- type UserRecord
Constants ¶
View Source
const COOKIE_NAME = "jwt"
View Source
const PostRecordType = "post"
View Source
const UserRecordType = "user"
Variables ¶
This section is empty.
Functions ¶
func GenerateCookie ¶
func GenerateCookie(cookieSecret *securecookie.SecureCookie, name string, value string, expDuration time.Duration, secure bool) *http.Cookie
func GenerateExpiredCookie ¶
func GenerateToken ¶
func GetKeysFromEmail ¶
func NewHashedUUID ¶
func NewPostRecordPK ¶
func NewPostRecordSK ¶
func NewUserRecordKey ¶
func ParseCookie ¶
func ParseCookie(r *http.Request, cookieSecret *securecookie.SecureCookie, name string) (string, error)
Types ¶
type DeleteFilesDto ¶
type Post ¶
type Post struct { ID string `dynamodbav:"ID" json:"id"` Name string `dynamodbav:"Name" json:"name"` Description string `dynamodbav:"Description" json:"description"` Files map[string]string `dynamodbav:"Files" json:"files"` UserID string `dynamodbav:"UserID" json:"userID"` CreatedAt time.Time `dynamodbav:"CreatedAt" json:"createdAt"` }
func NewPostFromRecord ¶
func NewPostFromRecord(pr PostRecord) Post
type PostRecord ¶
func NewPostRecord ¶
func NewPostRecord(post Post) PostRecord
type RegisterDto ¶
type User ¶
type User struct { ID string `dynamodbav:"ID" json:"id"` Email string `dynamodbav:"Email" json:"email"` Password string `dynamodbav:"Password" json:"-"` CreatedAt time.Time `dynamodbav:"CreatedAt" json:"createdAt"` }
func NewUser ¶
func NewUser(userData RegisterDto) User
func NewUserFromRecord ¶
func NewUserFromRecord(ur UserRecord) User
type UserRecord ¶
func NewUserRecord ¶
func NewUserRecord(user User) UserRecord
Click to show internal directories.
Click to hide internal directories.