Documentation
¶
Index ¶
- Variables
- func Delete(bean interface{}) (e error)
- func DeleteLink(id int64) (e error)
- func DeletePage(id int64) error
- func Get(key string) ([]byte, error)
- func GetBookPage()
- func GetMime(fName string) string
- func GetTagItems(tagName string, bean interface{}) ([]int64, error)
- func IncVersion() error
- func KatalogSave(k *Katalog) error
- func LinkSave(l *Link) (e error)
- func MenuSetPosition(positions []int64) error
- func Migrate() error
- func NewEngine()
- func NewKVContext()
- func NewTagsContext()
- func NewUserService() error
- func RemoveAllTags(bean interface{}) error
- func RemoveTag(tagName string, bean interface{}) error
- func RestorePage(id int64) error
- func RouterSave(objectID int64, objectType ObjectType, slug string) error
- func Save(bean interface{}) (e error)
- func SavePage(p *Page) (e error)
- func SaveTags(bean interface{}) error
- func SaveUser(u *User) error
- func Set(key string, value []byte) error
- func TrainingDirectionYears(tdId int64) ([]int, error)
- func ViewPage(id int64, sessionId string) (e error)
- func VkrDownload(id int64) (string, error)
- func WriteBookPage(w io.Writer, id int64, num int) (e error)
- type Album
- type Banner
- type Book
- type Bucket
- type Category
- type Departament
- type Engine
- type Faculties
- type Faculty
- type File
- type FileCreateOptions
- type Katalog
- type Link
- type LinkTarget
- type Links
- type Menu
- type MenuItem
- type MenuItems
- type Menus
- type ObjectType
- type Page
- func GetAllPages() ([]*Page, error)
- func GetNews(pages ...int) ([]Page, error)
- func GetPage(id int64) (p *Page, e error)
- func GetPageByOldId(id string) (p *Page, e error)
- func GetPageBySlug(slug string) (*Page, error)
- func GetPagesByIds(ids []int64, pages ...int) ([]*Page, error)
- func GetPagesByTag(tagName string, pages ...int) ([]*Page, error)
- type Photo
- type Router
- type Staff
- type Status
- type TrainingDirection
- type User
- type Version
- type Vkr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Trains []string NewCategoryId int64 )
View Source
var (
ErrNotFound = fmt.Errorf("not found")
)
View Source
var SmolGUFaculties = Faculties{
{1, "Физико-математический факультет", "ФМФ"},
{2, "Филологический факультет", "ФМФ"},
{3, "Факультет истории и права", "ФИиП"},
{4, "Естественно-географический факультет", "ЕГФ"},
{5, "Социальный факультет", "СФ"},
{6, "Психолого-педагогический факультет", "ППФ"},
{7, "Художественно-графический факультет", "ППФ"},
{8, "Факультет экономики и управления", "ФЭУ"},
{9, "Другое", "Др"},
}
View Source
var Statuses = map[Status]string{ Student: "Студент", Guru: "Преподаватель", Stuff: "Сотрудник", Librarian: "Библиотекарь", ElectronicResources: "Сотрудник ОЭР", ChiefElectronicResources: "Начальник ОЭР", ViceDirector: "Заместитель директора", Director: "Директор", }
View Source
var (
UserService *users.Service
)
Functions ¶
func DeleteLink ¶
func DeletePage ¶
func GetBookPage ¶
func GetBookPage()
func GetTagItems ¶
func IncVersion ¶
func IncVersion() error
func KatalogSave ¶
func MenuSetPosition ¶
func NewKVContext ¶
func NewKVContext()
func NewTagsContext ¶
func NewTagsContext()
func NewUserService ¶
func NewUserService() error
func RemoveAllTags ¶
func RemoveAllTags(bean interface{}) error
func RestorePage ¶
func RouterSave ¶
func RouterSave(objectID int64, objectType ObjectType, slug string) error
func TrainingDirectionYears ¶
func VkrDownload ¶
Types ¶
type Album ¶
type Banner ¶
type Banner struct {
Id int64
ImgPath string
Url string
Title string
Color string
Enabled bool
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
Deleted time.Time `xorm:"deleted"`
}
func GetEnabledBanners ¶
type Book ¶
func CreateBook ¶
type Bucket ¶
type Bucket struct {
Id int64
Title string
Files []*File `xorm:"-"`
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
func BucketCreate ¶
type Departament ¶
type Engine ¶
type Engine interface {
Delete(interface{}) (int64, error)
Exec(string, ...interface{}) (sql.Result, error)
Find(interface{}, ...interface{}) error
Get(interface{}) (bool, error)
Insert(...interface{}) (int64, error)
InsertOne(interface{}) (int64, error)
Id(interface{}) *xorm.Session
Sql(string, ...interface{}) *xorm.Session
Where(string, ...interface{}) *xorm.Session
}
Engine represents a xorm engine or session.
type File ¶
type FileCreateOptions ¶
type Katalog ¶
type Katalog struct {
Id int64
SourceId string `xorm:"index unique"`
Title string
Author string
BookId int64
Updated time.Time
Created time.Time
Deleted time.Time
}
func KatalogGet ¶
func KatalogGetByOldId ¶
func NewKatalogFromRuslanBook ¶
func NewKatalogFromRuslanBook(b ruslanparser.Book) (*Katalog, error)
type Link ¶
type LinkTarget ¶
type LinkTarget string
const ( LBlank LinkTarget = "_blank" LNone LinkTarget = "_none" LTop LinkTarget = "_top" )
type Menu ¶
type Menu struct {
Id int64
Title string
Slug string
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
Items MenuItems `xorm:"-"`
}
func MenuGetAll ¶
type MenuItem ¶
type MenuItem struct {
Id int64
Title string
Link string
MenuId int64
ParentId int64
Position int
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
func MenuItemCreate ¶
func MenuItemGet ¶
type ObjectType ¶
type ObjectType int
const (
ObjectPage ObjectType = iota + 1
)
func RouterResolve ¶
func RouterResolve(slug string) (objectID int64, typ ObjectType, err error)
type Page ¶
type Page struct {
Id int64
OldId string `xorm:"unique"`
Title string
Body string `xorm:"TEXT"`
Category int64
BucketID int64 `xorm:"bucket_id"`
Slug string
Image string
Images []string
Published bool
Date time.Time
CreatedBy int64
Views int64
Tags []string
Deleted time.Time `xorm:"deleted"`
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
func GetAllPages ¶
func GetPageByOldId ¶
func GetPageBySlug ¶
func (Page) SanitazedBody ¶
SanitazedBody return body text without html tags. Useful for external posting.
type Photo ¶
type Router ¶
type Router struct {
Slug string `xorm:"unique index"`
Type ObjectType
ObjectID int64
}
type TrainingDirection ¶
type TrainingDirection struct {
Id int64
Title string
SubTitle string
FacultyId int64
Code string
CreatedBy int64
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
Deleted time.Time `xorm:"deleted"`
}
func TrainingDirectionAllList ¶
func TrainingDirectionAllList() ([]*TrainingDirection, error)
func TrainingDirectionById ¶
func TrainingDirectionById(id int64) (*TrainingDirection, error)
func TrainingDirectionFacultyList ¶
func TrainingDirectionFacultyList(facId int64) ([]*TrainingDirection, error)
type Version ¶
func GetVersion ¶
type Vkr ¶
Click to show internal directories.
Click to hide internal directories.