crud

package
v0.0.0-...-d885e2b Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Banned

type Banned struct {
	ID        int                `db:"id" json:"id,omitempty"`
	IPAddress string             `db:"ip_address" json:"ip_address,omitempty"`
	UserAgent library.NullString `db:"user_agent" json:"user_agent,omitempty"`
}

Banned used as object to comunicate with table banned

func (*Banned) Insert

func (obj *Banned) Insert() error

Insert used for insert single row from table banned

func (Banned) IsInitial

func (obj Banned) IsInitial() bool

IsInitial used for check this object empty or not

func (*Banned) Remove

func (obj *Banned) Remove(column string, value interface{}) error

Remove used for remove single row from table banned

func (*Banned) Select

func (obj *Banned) Select(column string, value interface{}) error

Select used for select single row from table banned

func (*Banned) Update

func (obj *Banned) Update() error

Update used for update single row from table banned

type Content

type Content struct {
	ID           int                      `db:"id" json:"id,omitempty"`
	Name         library.NullString       `db:"name" json:"name,omitempty"`
	Content      string                   `db:"content" json:"content,omitempty"`
	JSONSettings library.NullString       `db:"json_settings" json:"-"`
	AccessLevel  library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	CreatedBy    int                      `db:"created_by" json:"created_by,omitempty"`
	Settings     []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Pages        []Page                   `db:"-" json:"pages,omitempty"`
}

Content used as object to comunicate with table content

func (*Content) Insert

func (obj *Content) Insert() error

Insert used for insert single row from table content

func (Content) IsInitial

func (obj Content) IsInitial() bool

IsInitial used for check this object empty or not

func (*Content) Remove

func (obj *Content) Remove(column string, value ...interface{}) error

Remove used for remove single row from table content

func (*Content) Select

func (obj *Content) Select(column string, value interface{}) error

Select used for select single row from table content

func (*Content) SelectAll

func (obj *Content) SelectAll() (output []Content)

SelectAll used for select all row from table content

func (*Content) SelectBy

func (obj *Content) SelectBy(column string, value ...interface{}) (output []Content)

SelectBy used for select by column from table content

func (*Content) Update

func (obj *Content) Update() error

Update used for update single row from table content

type Data

type Data struct {
	Page        Page          `db:"-" json:"page,omitempty"`
	PageContent []PageContent `db:"-" json:"page_content,omitempty"`
}

Data used as object to store and get version data

type Extension

type Extension struct {
	ID           int                      `db:"id" json:"id,omitempty"`
	Extension    string                   `db:"extension" json:"extension,omitempty" form:"extension" binding:"required"`
	Type         string                   `db:"type" json:"type,omitempty" form:"type" binding:"required"`
	Handle       string                   `db:"handle" json:"handle,omitempty" form:"handle" binding:"required"`
	JSONSettings library.NullString       `db:"json_settings" json:"-"`
	UserID       int                      `db:"user_id" json:"user_id,omitempty"`
	AccessLevel  library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	Settings     []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Manifest     string                   `db:"-" json:"manifest,omitempty"`
}

Extension used as object to comunicate with table extension

func (*Extension) Insert

func (obj *Extension) Insert() error

Insert used for insert single row from table extension

func (Extension) IsInitial

func (obj Extension) IsInitial() bool

IsInitial used for check this object empty or not

func (*Extension) Remove

func (obj *Extension) Remove() error

Remove used for remove single row from table extension

func (*Extension) Select

func (obj *Extension) Select(extension, types, handle string) error

Select used for select single row from table extension

func (*Extension) SelectAll

func (obj *Extension) SelectAll() (output []Extension, err error)

SelectAll used for select all row from table extension

func (*Extension) SelectBy

func (obj *Extension) SelectBy(column string, value ...interface{}) (output []Extension)

SelectBy used for select by column from table extension

func (*Extension) Update

func (obj *Extension) Update() error

Update used for update single row from table extension

type Media

type Media struct {
	URL  string `db:"url" json:"url,omitempty"`
	Used int    `db:"used" json:"used,omitempty"`
}

Media used as object to comunicate with table media

func (*Media) Insert

func (obj *Media) Insert() error

Insert used for insert single row from table media

func (Media) IsInitial

func (obj Media) IsInitial() bool

IsInitial used for check this object empty or not

func (*Media) Remove

func (obj *Media) Remove(column string, value ...interface{}) error

Remove used for remove single row from table media

func (*Media) Select

func (obj *Media) Select(column string, value interface{}) error

Select used for select single row from table media

func (*Media) SelectAll

func (obj *Media) SelectAll() (output []Media)

SelectAll used for select all row from table media

func (*Media) SelectBy

func (obj *Media) SelectBy(column string, value ...interface{}) (output []Media)

SelectBy used for select by column from table media

func (*Media) Update

func (obj *Media) Update() error

Update used for update single row from table media

type Menu struct {
	ID           int                      `db:"id" json:"id,omitempty"`
	Name         string                   `db:"name" json:"name,omitempty"`
	JSONSettings library.NullString       `db:"json_settings" json:"-"`
	AccessLevel  library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	Settings     []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Item         []MenuItem               `db:"-" json:"item,omitempty"`
}

Menu used as object to comunicate with table menu

func (obj *Menu) Insert() error

Insert used for insert single row from table menu

func (obj Menu) IsInitial() bool

IsInitial used for check this object empty or not

func (obj *Menu) Remove(column string, value interface{}) error

Remove used for remove single row from table menu

func (obj *Menu) Select(column string, value interface{}) error

Select used for select single row from table menu

func (obj *Menu) SelectAll() (output []Menu, err error)

SelectAll used for select all row from table menu

func (obj *Menu) SelectBy(column string, value ...interface{}) (output []Menu)

SelectBy used for select by column from table content

func (obj *Menu) Update() error

Update used for update single row from table menu

type MenuByPosition []MenuItem

MenuByPosition used for sorting Menu Item object

func (a MenuByPosition) Len() int
func (a MenuByPosition) Less(i, j int) bool
func (a MenuByPosition) Swap(i, j int)
type MenuItem struct {
	ID           int                      `db:"id" json:"id,omitempty"`
	MenuID       int                      `db:"menu_id" json:"menu_id,omitempty"`
	Position     int                      `db:"position" json:"position,omitempty"`
	Level        int                      `db:"level" json:"level,omitempty"`
	PageID       library.NullInt64        `db:"page_id" json:"page_id,omitempty"`
	LinkLabel    library.NullString       `db:"link_label" json:"link_label,omitempty"`
	LinkURL      library.NullString       `db:"link_url" json:"link_url,omitempty"`
	LinkTarget   library.NullString       `db:"link_target" json:"link_target,omitempty"`
	JSONSettings library.NullString       `db:"json_settings" json:"-"`
	AccessLevel  library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	UserID       int                      `db:"user_id" json:"user_id,omitempty"`
	Settings     []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Page         Page                     `db:"-" json:"page,omitempty"`
	SubMenu      []*MenuItem              `db:"-" json:"sub_menu,omitempty"`
}

MenuItem used as object to comunicate with table menu_item

func (obj *MenuItem) Insert() error

Insert used for insert single row from table menu_item

func (obj MenuItem) IsInitial() bool

IsInitial used for check this object empty or not

func (obj *MenuItem) Remove(column string, value interface{}) error

Remove used for remove single row from table menu_item

func (obj *MenuItem) Select(column string, value interface{}) error

Select used for select single row from table menu_item

func (obj *MenuItem) SelectAll(id int) (output []MenuItem, err error)

SelectAll used for select all row from table menu item

func (obj *MenuItem) Update() error

Update used for update single row from table menu_item

type Page

type Page struct {
	ID            int                      `db:"id" json:"id,omitempty"`
	Active        int                      `db:"active" json:"active,omitempty"`
	Theme         library.NullString       `db:"theme" json:"theme,omitempty"`
	Name          string                   `db:"name" json:"name,omitempty" binding:"required"`
	Title         string                   `db:"title" json:"title,omitempty"`
	Link          string                   `db:"link" json:"link,omitempty"`
	Keywords      library.NullString       `db:"keywords" json:"keywords,omitempty"`
	Description   library.NullString       `db:"description" json:"description,omitempty"`
	JSONSettings  library.NullString       `db:"json_settings" json:"-"`
	AccessLevel   library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	CreatedBy     int                      `db:"created_by" json:"created_by,omitempty"`
	Settings      []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Collaborators []string                 `db:"-" json:"collaborators,omitempty"`
}

Page used as object to comunicate with table page

func (*Page) Insert

func (obj *Page) Insert() error

Insert used for insert single row from table page

func (Page) IsInitial

func (obj Page) IsInitial() bool

IsInitial used for check this object empty or not

func (*Page) Remove

func (obj *Page) Remove(column string, value interface{}) error

Remove used for remove single row from table page

func (*Page) Select

func (obj *Page) Select(column string, value interface{}) error

Select used for select single row from table page

func (*Page) SelectAll

func (obj *Page) SelectAll() (output []Page, err error)

SelectAll used for select all row from table page

func (*Page) SelectBy

func (obj *Page) SelectBy(column string, value ...interface{}) (output []Page)

SelectBy used for select by column from table page

func (*Page) Update

func (obj *Page) Update() error

Update used for update single row from table page

type PageArchive

type PageArchive struct {
	ID         int           `db:"id" json:"id,omitempty"`
	Name       string        `db:"name" json:"name,omitempty" binding:"required"`
	Title      string        `db:"title" json:"title,omitempty"`
	Link       string        `db:"link" json:"link,omitempty"`
	DataString string        `db:"data" json:"-"`
	Data       []PageVersion `db:"-" json:"data,omitempty"`
}

PageArchive used as object to comunicate with table page_archive

func (*PageArchive) Insert

func (obj *PageArchive) Insert() error

Insert used for insert single row from table page_archive

func (PageArchive) IsInitial

func (obj PageArchive) IsInitial() bool

IsInitial used for check this object empty or not

func (*PageArchive) Remove

func (obj *PageArchive) Remove(column string, value interface{}) error

Remove used for remove single row from table page_archive

func (*PageArchive) Select

func (obj *PageArchive) Select(column string, value interface{}) error

Select used for select single row from table page_archive

func (*PageArchive) SelectAll

func (obj *PageArchive) SelectAll() (output []PageArchive, err error)

SelectAll used for select all row from table page_archive

func (*PageArchive) SelectBy

func (obj *PageArchive) SelectBy(column string, value ...interface{}) (output []PageArchive)

SelectBy used for select by column from table page_archive

type PageByPosition

type PageByPosition []PageContent

PageByPosition used for sorting PageContent object

func (PageByPosition) Len

func (a PageByPosition) Len() int

func (PageByPosition) Less

func (a PageByPosition) Less(i, j int) bool

func (PageByPosition) Swap

func (a PageByPosition) Swap(i, j int)

type PageCollaboration

type PageCollaboration struct {
	ID     int                `db:"id" json:"id,omitempty"`
	PageID int                `db:"page_id" json:"page_id,omitempty"`
	UserID int                `db:"user_id" json:"user_id,omitempty"`
	Email  library.NullString `db:"email" json:"email,omitempty"`
}

PageCollaboration used as object to comunicate with table page_collaboration

func (*PageCollaboration) Exist

func (obj *PageCollaboration) Exist(pageID int, email string) bool

Exist used for check data from table page_collaboration is exist

func (*PageCollaboration) Insert

func (obj *PageCollaboration) Insert() error

Insert used for insert single row from table page_collaboration

func (PageCollaboration) IsInitial

func (obj PageCollaboration) IsInitial() bool

IsInitial used for check this object empty or not

func (*PageCollaboration) Remove

func (obj *PageCollaboration) Remove(column string, value interface{}) error

Remove used for remove single row from table page_collaboration

func (*PageCollaboration) Select

func (obj *PageCollaboration) Select(pageID, userID int) error

Select used for select single row from table page_collaboration

func (*PageCollaboration) SelectBy

func (obj *PageCollaboration) SelectBy(column string, value ...interface{}) (output []PageCollaboration)

SelectBy used for select by column from table page_collaboration

func (*PageCollaboration) Update

func (obj *PageCollaboration) Update() error

Update used for update single row from table page_collaboration

type PageContent

type PageContent struct {
	ID           int                      `db:"id" json:"id,omitempty"`
	PageID       int                      `db:"page_id" json:"page_id,omitempty" binding:"required"`
	ContentID    library.NullInt64        `db:"content_id" json:"content_id,omitempty"`
	Extension    library.NullString       `db:"extension" json:"extension,omitempty"`
	Location     string                   `db:"location" json:"location,omitempty" binding:"required"`
	Column       int                      `db:"column" json:"column,omitempty" binding:"required"`
	Position     int                      `db:"position" json:"position,omitempty" binding:"required"`
	JSONSettings library.NullString       `db:"json_settings" json:"-"`
	AccessLevel  library.NullInt64        `db:"access_level" json:"access_level,omitempty"`
	Settings     []map[string]interface{} `db:"-" json:"json_settings,omitempty"`
	Content      Content                  `db:"-" json:"content,omitempty"`
}

PageContent used as object to comunicate with table page_content

func (*PageContent) Insert

func (obj *PageContent) Insert() error

Insert used for insert single row from table page_content

func (PageContent) IsInitial

func (obj PageContent) IsInitial() bool

IsInitial used for check this object empty or not

func (*PageContent) Remove

func (obj *PageContent) Remove(column string, value interface{}) error

Remove used for remove single row from table page_content

func (*PageContent) Select

func (obj *PageContent) Select(column string, value interface{}) error

Select used for select single row from table page_content

func (*PageContent) SelectBy

func (obj *PageContent) SelectBy(column string, value ...interface{}) (output []PageContent)

SelectBy used for select by column from table page_content

func (*PageContent) Update

func (obj *PageContent) Update() error

Update used for update single row from table page_content

type PageVersion

type PageVersion struct {
	ID         int    `db:"id" json:"id,omitempty"`
	PageID     int    `db:"page_id" json:"page_id,omitempty"`
	Version    int    `db:"-" json:"version,omitepty"`
	DataString string `db:"data" json:"-"`
	Data       Data   `db:"-" json:"data,omitempty"`
	CreatedBy  int    `db:"created_by" json:"created_by,omitempty"`
	CreatedOn  int64  `db:"created_on" json:"created_on,omitempty"`
	Current    int    `db:"current" json:"current,omitempty"`
	Name       string `db:"-" json:"name"`
}

PageVersion used as object to comunicate with table page_version

func (*PageVersion) Insert

func (obj *PageVersion) Insert() error

Insert used for insert single row from table page_version

func (PageVersion) IsInitial

func (obj PageVersion) IsInitial() bool

IsInitial used for check this object empty or not

func (*PageVersion) Remove

func (obj *PageVersion) Remove(column string, value interface{}) error

Remove used for remove single row from table page_version

func (*PageVersion) Select

func (obj *PageVersion) Select(column string, value interface{}) error

Select used for select single row from table page_version

func (*PageVersion) SelectBy

func (obj *PageVersion) SelectBy(column string, value ...interface{}) (output []PageVersion)

SelectBy used for select by column from table page_version

func (*PageVersion) Update

func (obj *PageVersion) Update() error

Update used for change single row from table page_version

type Setting

type Setting struct {
	ID    int                `db:"id" json:"id,omitempty"`
	Name  string             `db:"name" json:"name,omitempty"`
	Value library.NullString `db:"value" json:"value,omitempty"`
	Type  string             `db:"type" json:"type,omitempty"`
}

Setting used as object to comunicate with table setting

func (*Setting) Insert

func (obj *Setting) Insert() error

Insert used for insert single row from table setting

func (Setting) IsInitial

func (obj Setting) IsInitial() bool

IsInitial used for check this object empty or not

func (*Setting) Remove

func (obj *Setting) Remove(column string, value interface{}) error

Remove used for remove single row from table setting

func (*Setting) Select

func (obj *Setting) Select(column string, value interface{}) error

Select used for select single row from table setting

func (*Setting) Update

func (obj *Setting) Update() error

Update used for update single row from table setting

type Settings

type Settings struct {
	SMTPHost            string `json:"smtp_host"`
	SMTPPort            int    `json:"smtp_port"`
	SMTPUser            string `json:"smtp_user"`
	SMTPPassword        string `json:"smtp_password"`
	EmailSender         string `json:"email_sender"`
	ActivationEmail     string `json:"activation_email"`
	ActivatedEmail      string `json:"activated_email"`
	ForgetPasswordEmail string `json:"forget_password_email"`
	PageCollaborator    string `json:"page_collaborator"`
	SharePageEmail      string `json:"share_page_email"`
	Name                string `json:"name"`
	HomePage            int    `json:"home_page"`
	BannedAttemps       int    `json:"banned_attemps"`
	LockTime            int    `json:"lock_time"`
	AccessAttemps       int    `json:"access_attemps"`
	AccessExpired       int    `json:"access_expired"`
	SecretKey           string `json:"secret_key"`
	MaxSizeUpload       int    `json:"max_size_upload"`
	FaviconURL          string `json:"favicon_url"`
	LogoURL             string `json:"logo_url"`
	RemoteCheckURL      string `json:"remote_check_url"`
	SystemUpgradeURL    string `json:"system_upgrade_url"`
	ExtensionCheckURL   string `json:"extension_check_url"`
}

Settings used as object to handling settings variable

func (Settings) IsInitial

func (obj Settings) IsInitial() bool

IsInitial used for check this object empty or not

func (*Settings) Map

func (obj *Settings) Map() map[string]interface{}

Map used for set to empty struct

func (*Settings) Select

func (obj *Settings) Select() error

Select used for select single row from table setting

func (Settings) Update

func (obj Settings) Update() error

Update used for update single row from table setting

type System

type System struct {
	// ID        int `db:"id" json:"id,omitempty"`
	Version   int `db:"version" json:"version"`
	Milestone int `db:"milestone" json:"milestone"`
	Release   int `db:"release" json:"release"`
}

System used as object to comunicate with table system

func (System) IsInitial

func (obj System) IsInitial() bool

IsInitial used for check this object empty or not

func (*System) Select

func (obj *System) Select() error

Select used for select single row from table system

func (System) Update

func (obj System) Update() error

Update used for update single row from table system

type User

type User struct {
	ID            int                `db:"id" json:"id,omitempty"`
	Password      string             `db:"password" json:"password,omitempty"`
	Active        int                `db:"active" json:"active,omitempty"`
	Name          string             `db:"name" json:"name,omitempty"`
	EmailAddress  string             `db:"email_address" json:"email_address,omitempty"  binding:"required"`
	LastLoggedIn  library.NullInt64  `db:"last_logged_in" json:"last_logged_in,omitempty"`
	AccessLevel   int                `db:"access_level" json:"access_level,omitempty"`
	LastAccessed  library.NullInt64  `db:"last_accessed" json:"last_accessed,omitempty"`
	FailedAttemps library.NullInt64  `db:"failed_attempts" json:"failed_attempts,omitempty"`
	LockUntil     library.NullInt64  `db:"lock_until" json:"lock_until,omitempty"`
	IPAddress     library.NullString `db:"ip_address" json:"ip_address,omitempty"`
	ActivateToken library.NullString `db:"activate_token" json:"activate_token,omitempty"`
	ReminderToken library.NullString `db:"reminder_token" json:"reminder_token,omitempty"`
	ReminderTime  library.NullInt64  `db:"reminder_time" json:"reminder_time,omitempty"`
}

User used as object to comunicate with table user

func (*User) Insert

func (obj *User) Insert() error

Insert used for insert single row from table user

func (User) IsInitial

func (obj User) IsInitial() bool

IsInitial used for check this object empty or not

func (*User) Remove

func (obj *User) Remove(column string, value interface{}) error

Remove used for remove single row from table user

func (*User) Select

func (obj *User) Select(column string, value interface{}) error

Select used for select single row from table user

func (*User) SelectAll

func (obj *User) SelectAll() (output []User, err error)

SelectAll used for select all row from table user

func (*User) SelectBy

func (obj *User) SelectBy(column string, value ...interface{}) (output []User)

SelectBy used for select by column from table user

func (*User) Update

func (obj *User) Update() error

Update used for update single row from table user

Jump to

Keyboard shortcuts

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