model

package
v0.0.0-...-9e72f66 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertName

type AlertName struct {
	AlertName string `json:"alert_name"`
}

AlertName ...

type AuthEmail

type AuthEmail struct {
	Email string `json:"email"`
}

AuthEmail ...

type AuthLoginDTO

type AuthLoginDTO struct {
	Email          string `validate:"required" json:"email"`
	MasterPassword string `validate:"required" json:"master_password"`
}

AuthLoginDTO ...

type AuthLoginResponse

type AuthLoginResponse struct {
	AccessToken     string `json:"access_token"`
	RefreshToken    string `json:"refresh_token"`
	TransmissionKey string `json:"transmission_key"`
	Type            string `json:"type"`
	*UserDTO
	*SubscriptionAuthDTO
}

AuthLoginResponse ...

type Backup

type Backup struct {
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
}

Backup Response

type ChangeMasterPasswordDTO

type ChangeMasterPasswordDTO struct {
	Email             string `validate:"required" json:"email"`
	OldMasterPassword string `validate:"required" json:"old_master_password"`
	NewMasterPassword string `validate:"required" json:"new_master_password"`
}

type CreditCard

type CreditCard struct {
	ID                 uint       `gorm:"primary_key" json:"id"`
	CreatedAt          time.Time  `json:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at"`
	DeletedAt          *time.Time `json:"deleted_at"`
	CardName           string     `json:"title"`
	CardholderName     string     `json:"cardholder_name" encrypt:"true"`
	Type               string     `json:"type" encrypt:"true"`
	Number             string     `json:"number" encrypt:"true"`
	VerificationNumber string     `json:"verification_number" encrypt:"true"`
	ExpiryDate         string     `json:"expiry_date" encrypt:"true"`
}

CreditCard ...

func ToCreditCard

func ToCreditCard(creditCardDTO *CreditCardDTO) *CreditCard

ToCreditCard ...

type CreditCardDTO

type CreditCardDTO struct {
	ID                 uint   `json:"id"`
	CardName           string `json:"title"`
	CardholderName     string `json:"cardholder_name"`
	Type               string `json:"type"`
	Number             string `json:"number"`
	VerificationNumber string `json:"verification_number"`
	ExpiryDate         string `json:"expiry_date"`
}

CreditCardDTO DTO object for CreditCard type

func ToCreditCardDTO

func ToCreditCardDTO(creditCard *CreditCard) *CreditCardDTO

ToCreditCardDTO ...

func ToCreditCardDTOs

func ToCreditCardDTOs(creditCards []*CreditCard) []*CreditCardDTO

ToCreditCardDTOs ...

type Email

type Email struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Title     string     `json:"title"`
	Email     string     `json:"email" encrypt:"true"`
	Password  string     `json:"password" encrypt:"true"`
}

Email ...

func ToEmail

func ToEmail(emailDTO *EmailDTO) *Email

ToEmail ...

type EmailDTO

type EmailDTO struct {
	ID       uint   `json:"id"`
	Title    string `json:"title"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

EmailDTO ...

func ToEmailDTO

func ToEmailDTO(email *Email) *EmailDTO

ToEmailDTO ...

func ToEmailDTOs

func ToEmailDTOs(emails []*Email) []*EmailDTO

ToEmailDTOs ...

type Language

type Language struct {
	Categories           string `yaml:"categories" json:"categories"`
	Logins               string `yaml:"logins" json:"logins"`
	CreditCards          string `yaml:"credit_cards" json:"credit_cards"`
	Notes                string `yaml:"notes" json:"notes"`
	Emails               string `yaml:"emails" json:"emails"`
	Identities           string `yaml:"identities" json:"identities"`
	LicenseKeys          string `yaml:"license_keys" json:"license_keys"`
	AllItems             string `yaml:"all_items" json:"all_items"`
	Favorites            string `yaml:"favorites" json:"favorites"`
	Trash                string `yaml:"trash" json:"trash"`
	Server               string `yaml:"server" json:"server"`
	Host                 string `yaml:"host" json:"host"`
	Port                 string `yaml:"port" json:"port"`
	Protocol             string `yaml:"protocol" json:"protocol"`
	LicenseKey           string `yaml:"license_key" json:"license_key"`
	Key                  string `yaml:"key" json:"key"`
	URL                  string `yaml:"url" json:"url"`
	BankName             string `yaml:"bank_name" json:"bank_name"`
	BankCode             string `yaml:"bank_code" json:"bank_code"`
	AccountName          string `yaml:"account_name" json:"account_name"`
	AccountNumber        string `yaml:"account_number" json:"account_number"`
	Iban                 string `yaml:"iban" json:"iban"`
	Currency             string `yaml:"currency" json:"currency"`
	CardName             string `yaml:"card_name" json:"card_name"`
	CardholderName       string `yaml:"cardholder_name" json:"cardholder_name"`
	Type                 string `yaml:"type" json:"type"`
	Number               string `yaml:"number" json:"number"`
	VerificationNumber   string `yaml:"verification_number" json:"verification_number"`
	ExpiryDate           string `yaml:"expiry_date" json:"expiry_date"`
	Note                 string `yaml:"note" json:"note"`
	Export               string `yaml:"export" json:"export"`
	Import               string `yaml:"import" json:"import"`
	Backup               string `yaml:"backup" json:"backup"`
	Restore              string `yaml:"restore" json:"restore"`
	SelectBackup         string `yaml:"select_backup" json:"select_backup"`
	BackupName           string `yaml:"backup_name" json:"backup_name"`
	Email                string `yaml:"email" json:"email"`
	Username             string `yaml:"username" json:"username"`
	Password             string `yaml:"password" json:"password"`
	MasterPassword       string `yaml:"master_password" json:"master_password"`
	MasterPasswordAlert  string `yaml:"master_password_alert" json:"master_password_alert"`
	Signin               string `yaml:"signin" json:"signin"`
	Logout               string `yaml:"logout" json:"logout"`
	BaseURL              string `yaml:"base_url" json:"base_url"`
	SignToDashboard      string `yaml:"sign_to_dashboard" json:"sign_to_dashboard"`
	UseThis              string `yaml:"use_this" json:"use_this"`
	Save                 string `yaml:"save" json:"save"`
	Cancel               string `yaml:"cancel" json:"cancel"`
	Yes                  string `yaml:"yes" json:"yes"`
	No                   string `yaml:"no" json:"no"`
	Refresh              string `yaml:"refresh" json:"refresh"`
	Copy                 string `yaml:"copy" json:"copy"`
	Show                 string `yaml:"show" json:"show"`
	Hide                 string `yaml:"hide" json:"hide"`
	Delete               string `yaml:"delete" json:"delete"`
	Update               string `yaml:"update" json:"update"`
	New                  string `yaml:"new" json:"new"`
	Required             string `yaml:"required" json:"required"`
	AreYouSure           string `yaml:"are_you_sure" json:"are_you_sure"`
	AutoGeneratePassword string `yaml:"auto_generate_password" json:"auto_generate_password"`
	UsedPassword         string `yaml:"used_password" json:"used_password"`
	ConfirmUsedPassword  string `yaml:"confirm_used_password" json:"confirm_used_password"`
	CreatedAt            string `yaml:"created_at" json:"created_at"`
	UpdatedAt            string `yaml:"updated_at" json:"updated_at"`
	DeletedAt            string `yaml:"deleted_at" json:"deleted_at"`
	NetworkError         string `yaml:"network_error" json:"network_error"`
	Error                string `yaml:"error" json:"error"`
	Success              string `yaml:"success" json:"success"`
}

Language ...

type Login

type Login struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Title     string     `json:"title"`
	URL       string     `json:"url"`
	Username  string     `json:"username" encrypt:"true"`
	Password  string     `json:"password" encrypt:"true"`
	Extra     string     `json:"extra" encrypt:"true"`
}

Login ...

func ToLogin

func ToLogin(loginDTO *LoginDTO) *Login

ToLogin ...

type LoginDTO

type LoginDTO struct {
	ID       uint   `json:"id"`
	Title    string `json:"title"`
	URL      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
	Extra    string `json:"extra"`
}

LoginDTO DTO object for Login type

func ToLoginDTO

func ToLoginDTO(login *Login) *LoginDTO

ToLoginDTO ...

func ToLoginDTOs

func ToLoginDTOs(logins []*Login) []*LoginDTO

ToLoginDTOs ...

type Note

type Note struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Title     string     `json:"title"`
	Note      string     `json:"note" encrypt:"true"`
}

Note ...

func ToNote

func ToNote(noteDTO *NoteDTO) *Note

ToNote ...

type NoteDTO

type NoteDTO struct {
	ID    uint   `json:"id"`
	Title string `json:"title"`
	Note  string `json:"note"`
}

NoteDTO ...

func ToNoteDTO

func ToNoteDTO(note *Note) *NoteDTO

ToNoteDTO ...

func ToNoteDTOs

func ToNoteDTOs(notes []*Note) []*NoteDTO

ToNoteDTOs ...

type Password

type Password struct {
	Password string `json:"password"`
}

Password ...

type Payload

type Payload struct {
	Data string `json:"data"`
}

Payload ...

type Response

type Response struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

Response ...

type RestoreDTO

type RestoreDTO struct {
	Name string `json:"name"`
}

RestoreDTO file name for restore

type Server

type Server struct {
	ID              uint       `gorm:"primary_key" json:"id"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
	DeletedAt       *time.Time `json:"deleted_at"`
	Title           string     `json:"title"`
	IP              string     `json:"ip" encrypt:"true"`
	Username        string     `json:"username" encrypt:"true"`
	Password        string     `json:"password" encrypt:"true"`
	URL             string     `json:"url"`
	HostingUsername string     `json:"hosting_username" encrypt:"true"`
	HostingPassword string     `json:"hosting_password" encrypt:"true"`
	AdminUsername   string     `json:"admin_username" encrypt:"true"`
	AdminPassword   string     `json:"admin_password" encrypt:"true"`
	Extra           string     `json:"extra" encrypt:"true"`
}

Server ...

func ToServer

func ToServer(serverDTO *ServerDTO) *Server

ToServer ...

type ServerDTO

type ServerDTO struct {
	ID              uint   `json:"id"`
	Title           string `json:"title"`
	IP              string `json:"ip"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	URL             string `json:"url"`
	HostingUsername string `json:"hosting_username"`
	HostingPassword string `json:"hosting_password"`
	AdminUsername   string `json:"admin_username"`
	AdminPassword   string `json:"admin_password"`
	Extra           string `json:"extra"`
}

ServerDTO DTO object for Server type

func ToServerDTO

func ToServerDTO(server *Server) *ServerDTO

ToServerDTO ...

func ToServerDTOs

func ToServerDTOs(servers []*Server) []*ServerDTO

ToServerDTOs ...

type Subscription

type Subscription struct {
	ID             uint       `gorm:"primary_key" json:"id"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	DeletedAt      *time.Time `json:"deleted_at"`
	CancelledAt    time.Time  `json:"cancelled_at"`
	Type           string     `json:"type"`
	SubscriptionID int        `json:"subscription_id"`
	PlanID         int        `json:"plan_id"`
	UserID         int        `json:"user_id"`
	Email          string     `json:"email"`
	Status         string     `json:"status"`
	UpdateURL      string     `json:"update_url"`
	CancelURL      string     `json:"cancel_url"`
}

Subscription ...

func RequestToSub

func RequestToSub(r *http.Request) *Subscription

ToSubscription ...

func ToSubscription

func ToSubscription(subscriptionDTO *SubscriptionDTO) *Subscription

ToSubscription ...

type SubscriptionAuthDTO

type SubscriptionAuthDTO struct {
	Type      string `json:"type"`
	Status    string `json:"status"`
	UpdateURL string `json:"update_url"`
	CancelURL string `json:"cancel_url"`
}

func ToSubscriptionAuthDTO

func ToSubscriptionAuthDTO(subscription *Subscription) *SubscriptionAuthDTO

ToSubscriptionAuthDTO ...

type SubscriptionDTO

type SubscriptionDTO struct {
	ID             uint      `gorm:"primary_key" json:"id"`
	CancelledAt    time.Time `json:"cancelled_at"`
	SubscriptionID int       `json:"subscription_id"`
	PlanID         int       `json:"plan_id"`
	UserID         int       `json:"user_id"`
	Email          string    `json:"email"`
	Status         string    `json:"status"`
	UpdateURL      string    `json:"update_url"`
	CancelURL      string    `json:"cancel_url"`
}

SubscriptionDTO DTO object for Subscription type

func ToSubscriptionDTO

func ToSubscriptionDTO(subscription *Subscription) *SubscriptionDTO

ToSubscriptionDTO ...

type SubscriptionHook

type SubscriptionHook struct {
	AlertID             string `json:"alert_id"`
	AlertName           string `json:"alert_name"`
	CancelURL           string `json:"cancel_url"`
	CheckoutID          string `json:"checkout_id"`
	Currency            string `json:"currency"`
	Email               string `json:"email"`
	EventTime           string `json:"event_time"`
	LinkedSubscriptions string `json:"linked_subscriptions"`
	MarketingConsent    string `json:"marketing_consent"`
	Passthrough         string `json:"passthrough"`
	Quantity            string `json:"quantity"`
	Source              string `json:"source"`
	Status              string `json:"status"`
	SubscriptionID      string `json:"subscription_id"`
	SubscriptionPlanID  string `json:"subscription_plan_id"`
	UnitPrice           string `json:"unit_price"`
	UpdateURL           string `json:"update_url"`
	UserID              string `json:"user_id"`
	PSignature          string `json:"p_signature"`
}

type Token

type Token struct {
	ID              int `gorm:"primary_key" json:"id"`
	UserID          int
	UUID            uuid.UUID `gorm:"type:uuid;type:varchar(100);"`
	Token           string    `gorm:"type:text;"`
	TransmissionKey string    `gorm:"type:text;"`
	ExpiryTime      time.Time
}

Token type

type TokenDetailsDTO

type TokenDetailsDTO struct {
	AccessToken     string `json:"access_token"`
	RefreshToken    string `json:"refresh_token"`
	AtExpiresTime   time.Time
	RtExpiresTime   time.Time
	AtUUID          uuid.UUID
	RtUUID          uuid.UUID
	TransmissionKey string `json:"transmission_key"`
}

TokenDetailsDTO ...

type URLs

type URLs struct {
	Items []string `json:"urls"`
}

URLs ...

func (*URLs) AddItem

func (urls *URLs) AddItem(item string)

AddItem ...

type User

type User struct {
	ID               uint       `gorm:"primary_key" json:"id"`
	UUID             uuid.UUID  `gorm:"type:uuid; type:varchar(100);"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	DeletedAt        *time.Time `json:"deleted_at"`
	Name             string     `json:"name"`
	Email            string     `json:"email"`
	MasterPassword   string     `json:"master_password"`
	Secret           string     `json:"secret"`
	Schema           string     `json:"schema"`
	Role             string     `json:"role"`
	ConfirmationCode string     `json:"confirmation_code"`
	EmailVerifiedAt  time.Time  `json:"email_verified_at"`
}

User model

func ToUser

func ToUser(userDTO *UserDTO) *User

ToUser ...

type UserDTO

type UserDTO struct {
	ID              uint      `json:"id"`
	UUID            uuid.UUID `json:"uuid"`
	Name            string    `json:"name" validate:"max=100"`
	Email           string    `json:"email" validate:"required,email"`
	MasterPassword  string    `json:"master_password,omitempty" validate:"required,max=100,min=6"`
	Secret          string    `json:"secret"`
	Schema          string    `json:"schema"`
	Role            string    `json:"role"`
	EmailVerifiedAt time.Time `json:"email_verified_at"`
}

UserDTO DTO object for User type

func ConvertUserDTO

func ConvertUserDTO(userSignup *UserSignup) *UserDTO

ConvertUserDTO converts UserSignup to UserDTO

func ToUserDTO

func ToUserDTO(user *User) *UserDTO

ToUserDTO ...

type UserDTOTable

type UserDTOTable struct {
	ID     uint      `json:"id"`
	UUID   uuid.UUID `json:"uuid"`
	Name   string    `json:"name"`
	Email  string    `json:"email"`
	Schema string    `json:"schema"`
	Role   string    `json:"role"`
}

UserDTOTable ...

func ToUserDTOTable

func ToUserDTOTable(user User) UserDTOTable

ToUserDTOTable ...

func ToUserDTOs

func ToUserDTOs(users []User) []UserDTOTable

ToUserDTOs ...

type UserSignup

type UserSignup struct {
	Name           string `json:"name" validate:"max=100"`
	Email          string `json:"email" validate:"required,email"`
	MasterPassword string `json:"master_password" validate:"required,max=100,min=6"`
	Recaptcha      string `json:"g_captcha_value"` // temporarily disabled
}

UserSignup object for Auth Signup endpoint

Jump to

Keyboard shortcuts

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