models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExtension

func GetExtension(fileName string) string

Types

type Admin

type Admin struct {
	ID           uuid.UUID `json:"id"`
	Username     string    `json:"name"`
	PasswordHash string    `json:"password"`
	CreatedAt    time.Time `json:"creation_date"`
}

type AppConfig

type AppConfig struct {
	Port int `yaml:"port" json:"port"`
}

func NewAppConfig

func NewAppConfig(port int) AppConfig

type AuthConfig

type AuthConfig struct {
	Enabled bool `yaml:"authentication" json:"authentication"`
}

func NewAuthConfig

func NewAuthConfig(enabled bool) AuthConfig

type Config

type Config struct {
	App     AppConfig     `yaml:"server" json:"server"`
	Storage StorageConfig `yaml:"storage" json:"storage"`
	Auth    AuthConfig    `yaml:"auth" json:"auth"`
	Logging LoggingConfig `yaml:"logging" json:"logging"`
}

func (*Config) ApplyOverrides

func (c *Config) ApplyOverrides(port int, authEnabled *bool, loggingLevel string)

func (*Config) Validate

func (c *Config) Validate() error

type File

type File struct {
	ID        uuid.UUID  `json:"id"`
	FolderID  *uuid.UUID `json:"folder_id,omitempty"`
	Name      string     `json:"name"`
	Path      string     `json:"path"`
	Size      int64      `json:"size"`
	Pin       *string    `json:"pin,omitempty"`
	Extension string     `json:"extension"`
	MIMEType  string     `json:"mime_type"`
	ModTime   time.Time  `json:"mod_time"`
	CreatedAt time.Time  `json:"created_at"`
}

type Folder

type Folder struct {
	ID        uuid.UUID `json:"id" form:"id"`
	Name      string    `json:"name" form:"name"`
	Path      string
	PinCode   *string    `json:"pin_code,omitempty" form:"pin_code"`
	CreatedAt time.Time  `json:"created_at" form:"created_at"`
	Size      int64      `json:"size" form:"size"`
	ParentID  *uuid.UUID `json:"parent_id,omitempty" form:"parent_id"`
	SubFolder []Folder   `json:"folders" form:"folders"`
	Files     []File     `json:"files" form:"files"`
}

type LoggingConfig

type LoggingConfig struct {
	Enabled bool   `yaml:"logging" json:"logging"`
	Level   string `yaml:"logging_level" json:"logging_level"`
}

func NewLoggingConfig

func NewLoggingConfig(enabled bool, level string) LoggingConfig

type StorageConfig

type StorageConfig struct {
	BasePath    string `yaml:"base_path" json:"base_path"`
	MaxFileSize int64  `yaml:"max_size" json:"max_size"`
}

func NewStorageConfig

func NewStorageConfig(basePath string, maxFileSize int64) StorageConfig

type User

type User struct {
	ID           uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey"`
	UserName     string    `gorm:"column:username;unique;not null"`
	Email        string    `gorm:"column:email;unique;not null"`
	PasswordHash string    `gorm:"column:password_hash;not null"`
	CreatedAt    time.Time `gorm:"column:created_at"`
}

Jump to

Keyboard shortcuts

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