server

package
v0.0.0-...-985fdf5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATH_ARTICLELIST             = "/articlelist"
	PATH_ARTICLEEDIT             = "/articleedit"
	PATH_ARTICLESAVE             = "/articlesave"
	PATH_ARTICLEDELETE           = "/articledelete"
	PATH_ARTICLELOCK             = "/articlelock"
	PATH_ARTICLEHISTORIES        = "/articlehistories"
	PATH_LOGIN                   = "/login"
	PATH_LOGIN_CALLBACK          = "/login-callback"
	PATH_LOGOUT                  = "/logout"
	PATH_CATEGORYLIST            = "/categories"
	PATH_CATEGORYEDIT            = "/categoryedit"
	PATH_CATEGORYSAVE            = "/categorysave"
	PATH_CATEGORYDELETE          = "/categorydelete"
	PATH_SETLEVELTWOPWD          = "/setlevel2pwd"
	PATH_PROFILE                 = "/profile"
	PATH_UPLOAD                  = "/upload"
	PATH_FriendlyLink            = "/friendly-link"
	PATH_FriendlyLinkApply       = "/friendly-link-apply"
	PATH_FriendlyLinkApplyList   = "/friendly-link-apply-list"
	PATH_FriendlyLinkApplyActive = "/friendly_link_apply_active"
	PATH_WEBSOCKET               = "/ws"
)
View Source
const SessionName = "session"

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleEditModel

type ArticleEditModel struct {
	CategoryList         []models.CategoryDto
	Article              models.ArticleDto
	UserId               int
	ShareDeadlineTimeMin time.Time
	ShareDeadlineTimeMax time.Time
}

type ArticleListItemModel

type ArticleListItemModel struct {
	Id         int
	Title      string
	Content    string
	InsertTime string
}

type ArticleLockModel

type ArticleLockModel struct {
	Id    string
	Error string
	Type  string
}

type ArticleModel

type ArticleModel struct {
	Article  *models.ArticleDto
	Html     template.HTML
	Readonly bool
}

type Config

type Config struct {
	FileLocation      string
	Host              string
	Website_domain    string
	SqlDataSourceName string
	WebsiteName       string
	Key               string
	PostKey           string
	ConcurrenceNum    int
	SmtpUsername      string
	SmtpPassword      string
	SmtpAddr          string
	OAuthClientId     string
	OAuthTokenUrl     string
	OAuthAuthUrl      string
	OAuthSecret       string
	Tls_cert_file     string
	Tls_key_file      string
	Log_file          string

	//not read from configuration file
	LastUpdateTime string

	OAUTH2Config           *oauth2.Config
	JWKJsonUrl             string
	OAuthLogoutRedirectUrl string
	OAuthLogoutUrl         string
	IntrospectTokenURL     string
}

func (*Config) ImageDirPath

func (config *Config) ImageDirPath() (string, error)

type ErrorPageModel

type ErrorPageModel struct {
	Status int
	Desc   string
}

type FileCache

type FileCache struct {
	HomeWallpaper string
	// contains filtered or unexported fields
}

func (*FileCache) Save

func (cache *FileCache) Save() error

type GoBlogServer

type GoBlogServer struct {
	FileCache   *FileCache
	MemoryCache *MemoryCache
	// contains filtered or unexported fields
}

func NewGoBlogServer

func NewGoBlogServer(configPath string, skip_tls_verify bool) *GoBlogServer

func (*GoBlogServer) Article

func (s *GoBlogServer) Article() goweb.HandlerFunc

func (*GoBlogServer) ArticleDelete

func (s *GoBlogServer) ArticleDelete() goweb.HandlerFunc

func (*GoBlogServer) ArticleEdit

func (s *GoBlogServer) ArticleEdit() goweb.HandlerFunc

func (*GoBlogServer) ArticleHistories

func (s *GoBlogServer) ArticleHistories() goweb.HandlerFunc

func (*GoBlogServer) ArticleList

func (s *GoBlogServer) ArticleList() goweb.HandlerFunc

func (*GoBlogServer) ArticleLock

func (s *GoBlogServer) ArticleLock() goweb.HandlerFunc

func (*GoBlogServer) ArticleLockPost

func (s *GoBlogServer) ArticleLockPost() goweb.HandlerFunc

func (*GoBlogServer) ArticleSave

func (s *GoBlogServer) ArticleSave() goweb.HandlerFunc

func (*GoBlogServer) AuthMiddleware

func (s *GoBlogServer) AuthMiddleware() goweb.HandlerFunc

func (*GoBlogServer) BindHandlers

func (s *GoBlogServer) BindHandlers()

func (*GoBlogServer) CategoryDelete

func (s *GoBlogServer) CategoryDelete() goweb.HandlerFunc

func (*GoBlogServer) CategoryEdit

func (s *GoBlogServer) CategoryEdit() goweb.HandlerFunc

func (*GoBlogServer) CategoryList

func (s *GoBlogServer) CategoryList() goweb.HandlerFunc

func (*GoBlogServer) CategorySave

func (s *GoBlogServer) CategorySave() goweb.HandlerFunc

func (*GoBlogServer) ErrorPage

func (s *GoBlogServer) ErrorPage() goweb.ErrorPageFunc
func (s *GoBlogServer) FriendlyLink() goweb.HandlerFunc

func (*GoBlogServer) FriendlyLinkApply

func (s *GoBlogServer) FriendlyLinkApply() goweb.HandlerFunc

func (*GoBlogServer) FriendlyLinkApplyActivePUT

func (s *GoBlogServer) FriendlyLinkApplyActivePUT() goweb.HandlerFunc

func (*GoBlogServer) FriendlyLinkApplyList

func (s *GoBlogServer) FriendlyLinkApplyList() goweb.HandlerFunc

func (*GoBlogServer) FriendlyLinkApplyPOST

func (s *GoBlogServer) FriendlyLinkApplyPOST() goweb.HandlerFunc

func (*GoBlogServer) GetLoginUser

func (s *GoBlogServer) GetLoginUser(ctx *goweb.Context) (*models.UserDto, error)

func (*GoBlogServer) GetStorage

func (server *GoBlogServer) GetStorage(ctx *goweb.Context) storage.Storage

func (*GoBlogServer) HasArticleReadAccess

func (s *GoBlogServer) HasArticleReadAccess(user *models.UserDto, article *models.ArticleDto) (bool, error)

func (*GoBlogServer) Login

func (s *GoBlogServer) Login() goweb.HandlerFunc

func (*GoBlogServer) LoginCallback

func (s *GoBlogServer) LoginCallback() goweb.HandlerFunc

func (*GoBlogServer) LogoutPost

func (s *GoBlogServer) LogoutPost() goweb.HandlerFunc

func (*GoBlogServer) MustGetLoginUser

func (s *GoBlogServer) MustGetLoginUser(ctx *goweb.Context) *models.UserDto

func (*GoBlogServer) NewPageModel

func (s *GoBlogServer) NewPageModel(ctx *goweb.Context, title string, data interface{}) *PageModel

func (*GoBlogServer) Profile

func (s *GoBlogServer) Profile() goweb.HandlerFunc

func (*GoBlogServer) Serve

func (s *GoBlogServer) Serve()

func (*GoBlogServer) SetLevelTwoPwd

func (s *GoBlogServer) SetLevelTwoPwd() goweb.HandlerFunc

func (*GoBlogServer) SetLevelTwoPwdPost

func (s *GoBlogServer) SetLevelTwoPwdPost() goweb.HandlerFunc

func (*GoBlogServer) Upload

func (s *GoBlogServer) Upload() goweb.HandlerFunc

func (*GoBlogServer) UserArticle

func (s *GoBlogServer) UserArticle() goweb.HandlerFunc

type HandlerWidget

type HandlerWidget struct {
	// contains filtered or unexported fields
}

func (*HandlerWidget) Post_Process

func (hw *HandlerWidget) Post_Process(ctx *goweb.Context)

func (*HandlerWidget) Pre_Process

func (hw *HandlerWidget) Pre_Process(ctx *goweb.Context)

type MemoryCache

type MemoryCache struct {
	// contains filtered or unexported fields
}
func (cache *MemoryCache) FriendlyLinks(forceRefresh bool) ([]models.FriendlyLink, error)

type PageModel

type PageModel struct {
	User             *models.UserDto
	Path             string
	RequestUri       string
	Request          *http.Request
	WebSiteName      string
	PageTitle        string
	Keywords         string
	Description      string
	Data             interface{}
	Duration         int
	LastUpdateTime   string
	MobileCompatible bool
	Config           Config
	FileCache        *FileCache
}

type ProfileModel

type ProfileModel struct {
	Settings []*SettingsItemModel
}

type SetLevelTwoPwdModel

type SetLevelTwoPwdModel struct {
	Settings       []*SettingsItemModel
	ExistLevel2Pwd bool
}

type SettingsItemModel

type SettingsItemModel struct {
	Path   string
	Name   string
	Active bool
}

func GetSettingsModel

func GetSettingsModel(activePath string) []*SettingsItemModel

type UserArticleModel

type UserArticleModel struct {
	Articles   []models.ArticleDto
	Categories []models.CategoryDto
	UserId     int
	LoggedUser *models.UserDto
}

func (UserArticleModel) GetCategoryUrl

func (m UserArticleModel) GetCategoryUrl(id int) string

Jump to

Keyboard shortcuts

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