model

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserUuid string `json:"userUuid"`
	jwt.RegisteredClaims
}

func NewClaims

func NewClaims(userUuid uuid.UUID) *Claims

type Image

type Image struct {
	Uuid string `json:"uuid"`

	Filename string `json:"filename"`

	S3Key string `json:"s3_key"`

	CreatedAt time.Time `json:"created_at"`

	Link string `json:"link"`

	User User `json:"user"`
}

func DecodeMessageToImage

func DecodeMessageToImage(message []byte) (*Image, error)

type Invite

type Invite struct {
	Code    string `json:"code"`
	Claimed bool   `json:"claimed"`
}

type NewSession

type NewSession struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func DecodeRequestToNewSession

func DecodeRequestToNewSession(r *http.Request) (*NewSession, error)

type NewUser

type NewUser struct {
	Name string `json:"name,omitempty"`

	Username string `json:"username"`

	Email string `json:"email"`

	Password string `json:"password"`

	InviteCode string `json:"invite_code"`
}

func DecodeRequestToNewUser

func DecodeRequestToNewUser(r *http.Request) (*NewUser, error)

type Otp

type Otp struct {
	User User `json:"user,omitempty"`

	Code string `json:"code,omitempty"`
}

func DecodeRequestToOtp

func DecodeRequestToOtp(r *http.Request) (*Otp, error)

type PasswordReset

type PasswordReset struct {
	Email    string
	Password string
}

func DecodeRequestToPasswordReset

func DecodeRequestToPasswordReset(r *http.Request) (*PasswordReset, error)

type Role

type Role string
const (
	USER      Role = "user"
	MODERATOR Role = "moderator"
	ADMIN     Role = "admin"
)

List of Role

type Session

type Session struct {
	User  *User  `json:"user"`
	Token string `json:"token,omitempty"`
}

Session struct for Session

func CreateSession

func CreateSession(user *User, token string) *Session

type SessionRefresh

type SessionRefresh struct {
	Token string `json:"token"`
}

SessionRefresh struct for SessionRefresh

func DecodeRequestToSessionRefresh

func DecodeRequestToSessionRefresh(r *http.Request) *SessionRefresh

type SessionToken

type SessionToken struct {
	Token string `json:"token"`
}

func DecodeRequestToSessionToken

func DecodeRequestToSessionToken(r *http.Request) *SessionToken

type User

type User struct {
	Uuid string `json:"uuid"`

	Name string `json:"name,omitempty"`

	Username string `json:"username"`

	ProfilePic string `json:"profile_pic,omitempty"`

	BioMessage string `json:"bio_message,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Role Role `json:"role,omitempty"`

	IsBanned bool `json:"is_banned,omitempty"`

	Birthday string `json:"birthday,omitempty"`

	AddressStreet string `json:"address_street,omitempty"`

	AddressCity string `json:"address_city,omitempty"`

	AddressZip string `json:"address_zip,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`

	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

func DecodeRequestToUser

func DecodeRequestToUser(r *http.Request) (*User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL