Documentation ¶
Index ¶
- Constants
- type AdminConfig
- type Categories
- type Category
- type DBMap
- type Editor
- type Field
- type FieldConditionalLogic
- type FieldGroup
- type FieldGroups
- type FieldLayout
- type FieldLocation
- type FieldValue
- type FieldWrapper
- type Fields
- type Form
- type FormField
- type FormFields
- type FormLabel
- type FormSubmission
- type FormSubmissions
- type FormValues
- type Forms
- type Layout
- type Layouts
- type Media
- type MediaConfig
- type MediaItems
- type MediaSize
- type MediaSizeOptions
- type MediaSizes
- type Mime
- type OptionDB
- type Options
- type OptionsDB
- type OptionsDBMap
- type PasswordReset
- type Post
- type PostCreate
- type PostData
- type PostDatum
- type PostFacebook
- type PostField
- type PostFields
- type PostMeta
- type PostOptions
- type PostSeo
- type PostTemplate
- type PostTwitter
- type PostType
- type Posts
- type Redirect
- type Redirects
- type Resource
- type Resources
- type Role
- type Roles
- type Site
- type Template
- type Templates
- type Theme
- type ThemeConfig
- type Themes
- type User
- type UserCreate
- type UserPart
- type UserPasswordReset
- type Users
- type UsersParts
Constants ¶
const ( HomeType = "home" PageType = "page" SingleType = "single" ArchiveType = "archive" CategoryType = "category" )
Use for PostType
const ( // The default banned role ID. BannedRoleID = 1 // The default contributor role ID. ContributorRoleID = 2 // The default author role ID. AuthorRoleID = 3 // The default editor role ID. EditorRoleID = 4 // The default admin role ID. AdminRoleID = 5 // The default owner role ID. OwnerRoleID = 6 )
const (
// WebPExtension defines the extension used for webp images.
WebPExtension = ".webp"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminConfig ¶
type Category ¶
type Category struct { Id int `sqlb:"id,skipAll" db:"id" json:"id"` //nolint UUID uuid.UUID `sqlb:"uuid" db:"uuid" json:"uuid"` Slug string `sqlb:"slug" db:"slug" json:"slug" binding:"required,max=150"` Name string `sqlb:"name" db:"name" json:"name" binding:"required,max=150"` Description *string `sqlb:"description" db:"description" json:"description" binding:"omitempty,max=500"` Resource string `sqlb:"resource" db:"resource" json:"resource" binding:"required,max=150"` ParentId *int `sqlb:"parent_id" db:"parent_id" json:"parent_id" binding:"omitempty,numeric"` //nolint ArchiveId *int `sqlb:"archive_id" db:"archive_id" json:"archive_id" binding:"omitempty,numeric"` //nolint CreatedAt time.Time `sqlb:"created_at,autoCreateTime" db:"created_at" json:"created_at"` UpdatedAt time.Time `sqlb:"updated_at,autoUpdateTime" db:"updated_at" json:"updated_at"` }
Category defines the groups used for categorising individual posts.
type DBMap ¶
type DBMap map[string]interface{}
DBMap defines the helper for unmarshalling into a map directly from the database.
type Editor ¶
type Editor struct { Modules []string `yaml:"modules" json:"modules"` Options map[string]interface{} `yaml:"options" json:"options"` }
Editor defines editor options for the admin interface.
type Field ¶
type Field struct { UUID uuid.UUID `json:"uuid"` Label string `json:"label"` Name string `json:"name"` Type string `json:"type"` Instructions string `json:"instructions"` Required bool `json:"required"` Logic [][]FieldConditionalLogic `json:"conditional_logic"` Wrapper *FieldWrapper `json:"wrapper"` Options map[string]interface{} `json:"options"` SubFields []Field `json:"sub_fields,omitempty"` Layouts map[string]FieldLayout `json:"layouts,omitempty"` }
Field defines an individual field type.
type FieldConditionalLogic ¶
type FieldConditionalLogic struct { Field string `json:"field"` Operator string `json:"operator"` Value string `json:"value"` }
FieldConditionalLogic defines the logic used to process a field and if one can be shown.
type FieldGroup ¶
type FieldGroup struct { UUID uuid.UUID `json:"uuid"` Title string `json:"title"` Fields []Field `json:"fields,omitempty"` Locations [][]FieldLocation `json:"location,omitempty"` }
FieldGroup defines a group of JSON fields.
type FieldLayout ¶
type FieldLayout struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Label string `json:"label"` Display string `json:"display"` SubFields []Field `json:"sub_fields,omitempty"` }
FieldLayout defines the structure of fields for individual pages and resources.
type FieldLocation ¶
FieldLocation defines where the FieldGroup will appear.
type FieldValue ¶
type FieldValue string
FieldValue defines the original value of the field in string form.
func (FieldValue) Int ¶
func (f FieldValue) Int() (int, error)
Int
Converts the field value to a string.
Returns errors.INVALID if the string convert failed.
func (FieldValue) IsEmpty ¶
func (f FieldValue) IsEmpty() bool
IsEmpty
Determines if the field is an empty string.
func (FieldValue) Slice ¶
func (f FieldValue) Slice() []string
Slice
Returns a slice of split field values by comma.
func (FieldValue) String ¶
func (f FieldValue) String() string
String
Stringer on the FieldValue type.
type FieldWrapper ¶
type FieldWrapper struct {
Width int `json:"width"`
}
FieldWrapper defines the container for field objects on the front end.
type Form ¶
type Form struct { Id int `db:"id" json:"id" binding:"numeric"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` Name string `db:"name" json:"name" binding:"required,max=500"` Fields FormFields `db:"fields" json:"fields"` Submissions FormSubmissions `db:"-" json:"submissions"` EmailSend types.BitBool `db:"email_send" json:"email_send"` EmailMessage string `db:"email_message" json:"email_message"` EmailSubject string `db:"email_subject" json:"email_subject"` Recipients string `db:"recipients" json:"recipients"` StoreDB types.BitBool `db:"store_db" json:"store_db"` Body interface{} `db:"-" json:"-"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
Form defines the data for sending data to the API from the client side.
func (*Form) GetRecipients ¶
GetRecipients Splits the recipients string and returns a slice of email addresses.
type FormField ¶
type FormField struct { Id int `db:"id" json:"id" binding:"numeric"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` FormId int `db:"form_id" json:"-"` //nolint Key string `db:"key" json:"key" binding:"required"` Label FormLabel `db:"label" json:"label" binding:"required"` Type string `db:"type" json:"type" binding:"required"` Validation string `db:"validation" json:"validation"` Required types.BitBool `db:"required" json:"required"` Options DBMap `db:"options" json:"options"` }
FormField defines a individual field from the pivot table.
type FormLabel ¶
type FormLabel string
FormLabel defines the label/name for form fields.
type FormSubmission ¶
type FormSubmission struct { Id int `db:"id" json:"id" binding:"numeric"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` FormId int `db:"form_id" json:"form_id"` //nolint Fields FormValues `db:"fields" json:"fields"` IPAddress string `db:"ip_address" json:"ip_address"` UserAgent string `db:"user_agent" json:"user_agent"` SentAt *time.Time `db:"sent_at" json:"sent_at"` }
FormSubmission defines a submission of the of a form.
type FormSubmissions ¶
type FormSubmissions []FormSubmission
FormSubmissions represents the slice of FormSubmission's.
type FormValues ¶
type FormValues map[string]interface{}
func (FormValues) JSON ¶
func (f FormValues) JSON() ([]byte, error)
func (FormValues) Scan ¶
func (f FormValues) Scan(value interface{}) error
Scan
Scanner for FormValues. unmarshal the FormValues when the entity is pulled from the database.
type Media ¶
type Media struct { Id int `db:"id" json:"id"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` Url string `db:"url" json:"url"` //nolint Title string `db:"title" json:"title"` Alt string `db:"alt" json:"alt"` Description string `db:"description" json:"description"` FilePath string `db:"file_path" json:"-"` FileSize int64 `db:"file_size" json:"file_size"` FileName string `db:"file_name" json:"file_name"` Sizes MediaSizes `db:"sizes" json:"sizes"` Mime Mime `db:"mime" json:"mime"` UserId int `db:"user_id" json:"user_id"` //nolint CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
Media defines the core media entity for Verbis.
func (*Media) IsOrganiseYearMonth ¶
IsOrganiseYearMonth
Returns a bool indicating if the file has been saved a year month path, i.e 2020/01.
func (*Media) PossibleFiles ¶
PossibleFiles
Returns a the possible files saved to the system after the files have been uploaded. Note: This does not include the upload path.
func (*Media) UploadPath ¶
UploadPath
Returns the upload path of the media item without the storage uploads path, for example: 2020/01/photo.jpg
type MediaConfig ¶
type MediaSize ¶
type MediaSize struct { UUID uuid.UUID `db:"uuid" json:"uuid"` Url string `db:"url" json:"url"` //nolint Name string `db:"name" json:"name"` SizeName string `db:"size_name" json:"size_name"` FileSize int64 `db:"file_size" json:"file_size"` Width int `db:"width" json:"width"` Height int `db:"height" json:"height"` Crop bool `db:"crop" json:"crop"` }
MediaSize defines an individual media size that's stored in the database.
type MediaSizeOptions ¶
type MediaSizeOptions struct { Name string `db:"name" json:"name" binding:"required,numeric"` Width int `db:"width" json:"width" binding:"required,numeric"` Height int `db:"height" json:"height" binding:"required,numeric"` Crop bool `db:"crop" json:"crop"` }
MediaSizeOptions defines the options for saving different image sizes when uploaded.
type MediaSizes ¶
MediaSizes defines the map of MediaSizes, by key value pair.
func (MediaSizes) Scan ¶
func (m MediaSizes) Scan(value interface{}) error
Scan
Scanner for MediaSize. unmarshal the MediaSize when the entity is pulled from the database.
type Mime ¶
type Mime string
Mime TODO
type OptionDB ¶
type OptionDB struct { ID int `db:"id" json:"id"` Name string `db:"option_name" json:"option_name" binding:"required"` Value json.RawMessage `db:"option_value" json:"option_value" binding:"required"` }
OptionDB represents a singular entity of an option that's stored in the database.
type Options ¶
type Options struct { // Site SiteTitle string `json:"site_title" binding:"required"` SiteDescription string `json:"site_description" binding:"required"` SiteLogo string `json:"site_logo" binding:"required"` SiteUrl string `json:"site_url" binding:"required,url"` //nolint // Theme ActiveTheme string `json:"active_theme" binding:"required"` Homepage int `json:"homepage"` // General GeneralLocale string `json:"general_locale" binding:"required"` // Contact ContactEmail string `json:"contact_email" binding:"omitempty,email"` ContactTelephone string `json:"contact_telephone"` ContactAddress string `json:"contact_address"` // Social SocialFacebook string `json:"social_facebook" binding:"omitempty,url"` SocialTwitter string `json:"social_twitter" binding:"omitempty,url"` SocialInstagram string `json:"social_instagram" binding:"omitempty,url"` SocialLinkedIn string `json:"social_linkedin" binding:"omitempty,url"` SocialYoutube string `json:"social_youtube" binding:"omitempty,url"` SocialPinterest string `json:"social_pinterest" binding:"omitempty,url"` // Code Injection CodeInjectionHead string `json:"codeinjection_head" binding:"omitempty"` CodeInjectionFoot string `json:"codeinjection_foot" binding:"omitempty"` // Meta MetaTitle string `json:"meta_title" binding:"omitempty"` MetaDescription string `json:"meta_description" binding:"omitempty"` MetaFacebookTitle string `json:"meta_facebook_title" binding:"omitempty"` MetaFacebookDescription string `json:"meta_facebook_description" binding:"omitempty"` MetaFacebookImageId int `json:"meta_facebook_image_id" binding:"numeric"` //nolint MetaTwitterTitle string `json:"meta_twitter_title" binding:"omitempty"` MetaTwitterDescription string `json:"meta_twitter_description" binding:"omitempty"` MetaTwitterImageID int `json:"meta_twitter_image_id" binding:"omitempty,numeric"` // SEO SeoPrivate bool `json:"seo_private"` SeoSitemapServe bool `json:"seo_sitemap_serve"` SeoSitemapRedirects bool `json:"seo_sitemap_redirects"` SeoSitemapExcluded []string `json:"seo_sitemap_excluded"` SeoEnforceSlash bool `json:"seo_enforce_slash"` SeoRobotsServe bool `json:"seo_robots_serve"` SeoRobots string `json:"seo_robots"` // Breadcrumbs BreadcrumbsEnable bool `json:"breadcrumbs_enable"` BreadcrumbsTitle string `json:"breadcrumbs_title"` BreadcrumbsSeparator string `json:"breadcrumbs_separator"` BreadcrumbsHomepageText string `json:"breadcrumbs_homepage_text"` BreadcrumbsHideHomePage bool `json:"breadcrumbs_hide_homepage"` // Media MediaCompression int `json:"media_compression" binding:"required"` MediaConvertWebP bool `json:"media_convert_webp"` MediaServeWebP bool `json:"media_serve_webp"` MediaUploadMaxSize int64 `json:"media_upload_max_size" binding:"numeric"` MediaUploadMaxWidth int64 `json:"media_upload_max_width" binding:"numeric"` MediaUploadMaxHeight int64 `json:"media_upload_max_height" binding:"numeric"` MediaOrganiseDate bool `json:"media_organise_year_month"` MediaSizes MediaSizes `json:"media_images_sizes"` // Server Cache CacheServerTemplates bool `json:"cache_server_templates"` CacheServerFields bool `json:"cache_server_field_layouts"` // Frontend Caching CacheFrontend bool `json:"cache_frontend"` CacheFrontendRequest string `json:"cache_frontend_request"` CacheFrontendSeconds int64 `json:"cache_frontend_seconds"` CacheFrontendExtension []string `json:"cache_frontend_extensions"` // Gzip Gzip bool `json:"gzip"` GzipCompression string `json:"gzip_compression"` GzipUsePaths bool `json:"gzip_use_paths"` GzipExcludedExtensions []string `json:"gzip_excluded_extensions"` GzipExcludedPaths []string `json:"gzip_excluded_paths"` // Minify MinifyHTML bool `json:"minify_html"` MinifyJS bool `json:"minify_js"` MinifyCSS bool `json:"minify_css"` MinifySVG bool `json:"minify_svg"` MinifyJSON bool `json:"minify_json"` MinifyXML bool `json:"minify_xml"` // Forms FormSendEmailAddresses []string `json:"form_send_email_addresses"` FormFromEmailAddress string `json:"form_from_email_addresses"` FormIncludeLogo bool `json:"form_email_include_logo"` FormEmailDisclosure string `json:"form_email_disclosure"` }
Options defines the main system options defined in the store this is used throughout the application for user defined choices.
type OptionsDBMap ¶
type OptionsDBMap map[string]interface{}
OptionsDBMap defines the map of key value pair options that are stored in the database, used for marshalling and unmarshalling into the Options struct.
type PasswordReset ¶
type PasswordReset struct { Id int `db:"id" json:"-"` //nolint Email string `db:"email" json:"email" binding:"required,email"` Token string `db:"token" json:"token" binding:"required,email"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
PasswordReset defines the struct for interacting with the password resets table.
type Post ¶
type Post struct { Id int `db:"id" json:"id" binding:"numeric"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` Slug string `db:"slug" json:"slug" binding:"required,max=150"` Permalink string `db:"-" json:"permalink"` Title string `db:"title" json:"title" binding:"required,max=500"` Status string `db:"status" json:"status,omitempty"` Resource string `db:"resource" json:"resource"` PageTemplate string `db:"page_template" json:"page_template,omitempty" binding:"max=150"` PageLayout string `db:"layout" json:"layout,omitempty" binding:"required,max=150"` CodeInjectionHead string `db:"codeinjection_head" json:"codeinjection_head,omitempty"` CodeInjectionFoot string `db:"codeinjection_foot" json:"codeinjection_foot,omitempty"` UserId int `db:"user_id" json:"-"` //nolint IsArchive types.BitBool `db:"archive" json:"archive"` PublishedAt *time.Time `db:"published_at" json:"published_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` SeoMeta PostOptions `db:"options" json:"options"` }
Post defines the main page entity of Verbis.
type PostCreate ¶
type PostCreate struct { Post Author int `json:"author,omitempty" binding:"numeric"` Category *int `json:"category,omitempty" binding:"omitempty,numeric"` Fields PostFields `json:"fields,omitempty"` }
PostCreate defines the data when a post is created.
type PostDatum ¶
type PostDatum struct { Post `json:"post"` Author UserPart `json:"author"` Category *Category `json:"category"` Layout []FieldGroup `json:"layout,omitempty"` Fields PostFields `json:"fields,omitempty"` Type PostType `json:"type"` }
PostDatum defines the post including author, category, layout and field information.
func (*PostDatum) IsHomepage ¶
IsHomepage
Determines if the post is the homepage by comparing the domain options.
func (*PostDatum) Tpl ¶
func (p *PostDatum) Tpl() PostTemplate
Tpl
Converts a PostDatum to a PostTemplate and hides layouts.
type PostFacebook ¶
type PostFacebook struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` ImageId int `json:"image_id,omitempty" binding:"numeric"` //nolint }
PostFacebook defines the opengraph meta information used when calling the VerbisHeader.
type PostField ¶
type PostField struct { //Id int `db:"id" json:"-"` //nolint PostId int `db:"post_id" json:"-"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid" binding:"required"` Type string `db:"type" json:"type"` Name string `db:"name" json:"name"` Key string `db:"field_key" json:"key"` Value interface{} `json:"-"` OriginalValue FieldValue `db:"value" json:"value"` }
PostField defines the individual field that is attached to a post.
func (*PostField) IsValueJSON ¶
IsValueJSON
Determines if the value is valid JSON and has the key words - key and value.
func (*PostField) TypeIsInSlice ¶
TypeIsInSlice
Determines if the given field values is in the slice passed.
type PostMeta ¶
type PostMeta struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Twitter PostTwitter `json:"twitter,omitempty"` Facebook PostFacebook `json:"facebook,omitempty"` }
PostMeta defines the global meta information for the post used when calling the VerbisHeader.
type PostOptions ¶
type PostOptions struct { Id int `json:"-"` //nolint PostId int `json:"-" binding:"required|numeric"` //nolint Meta *PostMeta `db:"meta" json:"meta"` Seo *PostSeo `db:"seo" json:"seo"` EditLock string `db:"edit_lock" json:"edit_lock"` }
PostOptions defines the global post options that includes post meta and post seo information.
type PostSeo ¶
type PostSeo struct { Private bool `json:"private"` ExcludeSitemap bool `json:"exclude_sitemap"` Canonical string `json:"canonical"` }
PostSeo defines the options for Seo on the post, including if the post is indexable, if it should appear in the sitemap and any canonical overrides.
type PostTemplate ¶
PostTemplate defines the Post data for templates when they are used in the front end.
type PostTwitter ¶
type PostTwitter struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` ImageId int `json:"image_id,omitempty" binding:"numeric"` //nolint }
PostTwitter defines the twitter meta information used when calling the VerbisHeader.
type PostType ¶
type PostType struct { PageType string Data interface{} }
PostType defines the type of page that has been served, It can be an archive, single, home, page or any type defined by the constants below.
type Redirect ¶
type Redirect struct { Id int `db:"id" json:"id"` //nolint From string `db:"from_path" json:"from_path" binding:"required"` To string `db:"to_path" json:"to_path" binding:"required"` Code int `db:"code" json:"code" binding:"required,numeric"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
Redirects defines the data used for redirecting http requests.
type Resource ¶
type Resource struct { Name string `yaml:"name" json:"name"` FriendlyName string `yaml:"friendly_name" json:"friendly_name"` SingularName string `yaml:"singular_name" json:"singular_name"` Slug string `yaml:"slug" json:"slug"` Icon string `yaml:"icon" json:"icon"` Hidden bool `yaml:"hidden" json:"hidden"` HideCategorySlug bool `yaml:"hide_category_slug" json:"hide_category_slug"` AvailableTemplates []string `yaml:"available_templates" json:"available_templates"` }
Resource defines an individual resource or custom post type declared in the theme config.
type Role ¶
type Role struct { Id int `db:"id" json:"id" binding:"required,numeric"` //nolint Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` }
Role defines the role a user has, from the pivot table.
type Site ¶
type Site struct { Title string `json:"title"` Description string `json:"description"` Logo string `json:"logo"` Url string `json:"url"` //nolint Version string `json:"version"` }
Site defines the global Verbis object that is used in the public facing API (without credentials). The version is the version of Verbis the application is currently running.
type Template ¶
Template defines a page template that are available from the theme's template directory.
type Theme ¶
type Theme struct { Title string `yaml:"title" json:"title"` Description string `yaml:"description" json:"description"` Version string `yaml:"version" json:"version"` Screenshot string `yaml:"-" json:"screenshot"` Name string `yaml:"-" json:"name"` Active bool `yaml:"-" json:"active"` }
Theme defines the information for the currently active theme.
type ThemeConfig ¶
type ThemeConfig struct { Theme Theme `yaml:"theme" json:"theme"` Resources Resources `yaml:"resources" json:"resources"` AssetsPath string `yaml:"assets_path" json:"assets_path"` FileExtension string `yaml:"file_extension" json:"file_extension"` TemplateDir string `yaml:"template_dir" json:"template_dir"` LayoutDir string `yaml:"layout_dir" json:"layout_dir"` Admin AdminConfig `yaml:"admin" json:"admin"` Media MediaConfig `yaml:"media" json:"media"` Editor Editor `yaml:"editor" json:"editor"` }
ThemeConfig defines the data used for unmarshalling the config.yml file found in the theme's directory.
type User ¶
type User struct { UserPart Password string `db:"password" json:"password,omitempty" binding:""` Token string `db:"token" json:"token,omitempty"` TokenLastUsed *time.Time `db:"token_last_used" json:"token_last_used,omitempty"` }
User defines the main author entity for Verbis.
func (*User) HideCredentials ¶
HideCredentials
Returns a new UserPart, hiding any sensitive information such as passwords and tokens.
func (*User) HidePassword ¶
func (u *User) HidePassword()
HidePassword
Sets the users password to an empty string.
type UserCreate ¶
type UserCreate struct { User Password string `db:"password" json:"password,omitempty" binding:"required,min=8,max=60"` ConfirmPassword string `json:"confirm_password,omitempty" binding:"required,eqfield=Password,required"` }
PostCreate defines the data when a user is created.
type UserPart ¶
type UserPart struct { Id int `db:"id" json:"id"` //nolint UUID uuid.UUID `db:"uuid" json:"uuid"` FirstName string `db:"first_name" json:"first_name" binding:"required,max=150,alpha"` LastName string `db:"last_name" json:"last_name" binding:"required,max=150,alpha"` Email string `db:"email" json:"email" binding:"required,email,max=255"` Website string `db:"website" json:"website,omitempty" binding:"omitempty,url"` Facebook string `db:"facebook" json:"facebook"` Twitter string `db:"twitter" json:"twitter"` Linkedin string `db:"linked_in" json:"linked_in"` Instagram string `db:"instagram" json:"instagram"` Biography string `db:"biography" json:"biography"` Role Role `db:"roles" json:"role"` ProfilePictureID *int `db:"profile_picture_id" json:"profile_picture_id"` EmailVerifiedAt *time.Time `db:"email_verified_at" json:"email_verified_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
UserPart defines the User with non-sensitive information.
type UserPasswordReset ¶
type UserPasswordReset struct { DBPassword string `json:"-" binding:""` CurrentPassword string `json:"current_password" binding:"required,password"` NewPassword string `json:"new_password" binding:"required,min=8,max=60"` ConfirmPassword string `json:"confirm_password" binding:"eqfield=NewPassword,required"` }
UserPasswordReset defines the data for when a user resets their password.
type Users ¶
type Users []User
Users represents the slice of User's.
func (Users) HideCredentials ¶
func (u Users) HideCredentials() UsersParts
HideCredentials
Returns a slice of UserParts from the given input, hiding any sensitive information such as passwords and tokens.