models

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Type    string
	Message string
}

type Auth

type Auth struct {
	User
}

type ConfigS3

type ConfigS3 struct {
	S3AccessKey string `json:"s3accesskey" validate:"required,s3accesskey"`
	S3SecretKey string `json:"s3secretkey" validate:"required,s3secretkey"`
	S3Region    string `json:"s3region" validate:"required,s3region"`
	S3URL       string `json:"s3url" validate:"required,s3url"`
}

func (*ConfigS3) FillConfig

func (cfg *ConfigS3) FillConfig(input ConfigS3)

func (*ConfigS3) IsEmpty

func (cfg *ConfigS3) IsEmpty() bool

type File

type File struct {
	Name string `json:"name"` // Name of the file
	Key  string `json:"key"`  // S3 key for the file
}

type Folder

type Folder struct {
	Name    string   `json:"name"`  // Name of the folder
	Key     string   `json:"key"`   // S3 key for the folder
	Files   []File   `json:"files"` // List of files in the folder
	Folders []Folder `json:"folders"`
}

type LoginPayload

type LoginPayload struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8"`
}

func (*LoginPayload) CheckPassword

func (lp *LoginPayload) CheckPassword(encryptedPassword string) error

type OTPInput

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

type PasswordPayload

type PasswordPayload struct {
	Password string `json:"password" validate:"required,min=8"`
}
type PayloadPublicLink struct {
	Link           string `json:"link" validate:"required,link"`
	RealRootBucket string `json:"real_root_bucket" validate:"required,bucket"`
	RealRootPath   string `json:"real_root_path" validate:"required,path"`
	AccessKey      string `json:"access_key" validate:"accesskey"`
	AccessType     string `json:"access_type"  validate:"required,accesstype"`
	Privacy        string `json:"privacy"  validate:"required,privacy"`
}
type PublicLink struct {
	ID   string `json:"id"`
	Link string `json:"link"`
	// PublicPath   string `json:"public_path"`
	RealRootBucket string `json:"real_root_bucket"`
	RealRootPath   string `json:"real_root_path"`
	AccessKey      string `json:"access_key"`
	AccessType     string `json:"access_type"`
	Privacy        string `json:"privacy"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type RegisterPayload

type RegisterPayload struct {
	Username string `json:"username" validate:"required,min=4,max=10"`
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8"`
}

type S3Response

type S3Response struct {
	Folders []Folder `json:"folders"` // List of folders
}

type Security

type Security struct {
	AccessType  string
	Privacy     string
	IsPermitted bool
}

type User

type User struct {
	ID       uuid.UUID `json:"id"`
	Username string    `json:"username" validate:"required,min=4,max=8"`
	Email    string    `json:"email" validate:"required,email"`
	Password string    `json:"password" validate:"required,min=8"`

	OtpEnabled  bool `json:"otp_enabled"`
	OtpVerified bool `json:"otp_verified"`

	OtpSecret  string `json:"otp_secret"`
	OtpAuthUrl string `json:"otp_auth_url"`

	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*User) CheckPassword

func (u *User) CheckPassword(encryptedPassword string) error

func (*User) EncryptPassword

func (u *User) EncryptPassword(password string) error

type ValidateLinkCreate

type ValidateLinkCreate struct {
	Link string `json:"link" validate:"required,link"`
}

type ValidateLinkUpdate

type ValidateLinkUpdate struct {
	ID   string `json:"id" validate:"required"`
	Link string `json:"link" validate:"required,link"`
}

Jump to

Keyboard shortcuts

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