models

package
v0.0.0-...-20c7f3d Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FileRequestsCollection = "file_requests"
View Source
const SettingsCollection = "settings"
View Source
const TokensCollection = "tokens"
View Source
const UploadsCollection = "uploads"
View Source
const UsersCollection = "users"

Variables

View Source
var ForbiddenSettingsKeys = []string{"backgrounds", "logo"} // Keys that are managed by their own endpoint.

Functions

This section is empty.

Types

type File

type File struct {
	Id              string  `json:"id" bson:"_id"`
	Name            string  `json:"name" bson:"name"`
	Size            int64   `json:"size" bson:"size"`
	PreviewUrl      *string `json:"preview_url,omitempty" bson:"preview_url,omitempty"`
	ThumbnailUrl    *string `json:"thumbnail_url,omitempty" bson:"thumbnail_url,omitempty"`
	ThumbnailHeight *int    `json:"thumbnail_height" bson:"thumbnail_height"`
	ThumbnailWidth  *int    `json:"thumbnail_width" bson:"thumbnail_width"`
}

type FileRequest

type FileRequest struct {
	Id          string   `json:"id" bson:"_id"`
	Name        string   `json:"name" bson:"name"`
	Description string   `json:"description" bson:"description"`
	Public      bool     `json:"public" bson:"public"`
	Uploads     []Upload `json:"uploads" bson:"uploads,omitempty"` // virtual field
}

type Image

type Image struct {
	Id        string  `json:"id" bson:"id"`
	Url       string  `json:"url" bson:"url"`
	Remote    bool    `json:"-" bson:"remote"`
	Extension *string `json:"-" bson:"extension"`
}
type Link struct {
	Id   string `json:"id" bson:"id"`
	Name string `json:"name" bson:"name"`
	Url  string `json:"url" bson:"url"`
}

type MailConfig

type MailConfig struct {
	RecipientEmails []string `json:"recipient_emails,omitempty" bson:"recipient_emails,omitempty"`
	SenderEmail     string   `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
	Message         string   `json:"message,omitempty" bson:"message,omitempty"`
	Language        string   `json:"language" bson:"language"`
}

type SanitizedUser

type SanitizedUser struct {
	Id        string `json:"id" bson:"_id,omitempty"`
	FirstName string `json:"first_name" bson:"first_name"`
	LastName  string `json:"last_name" bson:"last_name"`
	Email     string `json:"email" bson:"email"`
}

type Setting

type Setting struct {
	Id    string      `json:"-" bson:"_id"`
	Name  string      `json:"name" bson:"name"`
	Value interface{} `json:"value" bson:"value"`
}

type SocialNetwork

type SocialNetwork struct {
	Id  string `json:"id" bson:"id"`
	Key string `json:"key" bson:"key"`
	Url string `json:"url" bson:"url"`
}

type Token

type Token struct {
	Id           string  `json:"id" bson:"_id"`
	Name         string  `json:"name" bson:"name"`
	Ip           string  `json:"ip" bson:"ip"`
	CreationDate int64   `json:"creation_date" bson:"creation_date"`
	Token        *string `json:"token,omitempty" bson:"-"`
}

func (*Token) BeforeCreate

func (token *Token) BeforeCreate() error

type Upload

type Upload struct {
	Id             string   `json:"id" bson:"_id,omitempty"`
	Name           string   `json:"name" bson:"name"`
	Files          []*File  `json:"files" bson:"files"`
	Backgrounds    []*Image `json:"backgrounds" bson:"backgrounds"`
	DownloadCount  int      `json:"download_count" bson:"download_count"`
	Public         bool     `json:"public" bson:"public"`
	Ready          bool     `json:"-" bson:"ready"`
	Gallery        bool     `json:"gallery" bson:"gallery"`
	RequestId      string   `json:"request_id" bson:"request_id"`
	Date           int64    `json:"date" bson:"date"`
	ExpirationDate *int64   `json:"expiration_date,omitempty" bson:"expiration_date,omitempty"`
}

func (*Upload) BeforeCreate

func (upload *Upload) BeforeCreate()

func (*Upload) Size

func (upload *Upload) Size() constants.ByteSize

type User

type User struct {
	Id        string `json:"id" bson:"_id,omitempty" valid:"-"`
	FirstName string `json:"first_name" bson:"first_name" valid:"required"`
	LastName  string `json:"last_name" bson:"last_name" valid:"required"`
	Password  string `json:"password" bson:"password" valid:"required"`
	Email     string `json:"email" bson:"email" valid:"email,required"`
}

func (*User) BeforeCreate

func (user *User) BeforeCreate() error

func (*User) Sanitize

func (user *User) Sanitize() SanitizedUser

Jump to

Keyboard shortcuts

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