consts

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AccessTokenExpiredSeconds = 24 * 3600
	RefreshTokenExpiredDays   = 30
	TokenAccessCachePrefix    = "admin_access_token_"
	TokenRefreshCachePrefix   = "admin_refresh_token_"
	AdminTokenHeaderName      = "Admin-Authorization"
	AuthorizedUser            = "authorized_user"
	CodePrefix                = "code_"
	CodeValidDuration         = time.Second
	OneTimeTokenQueryName     = "ott"
	SessionID                 = "session_id"
	AccessPermissionKeyPrefix = "access_permission_"
)
View Source
const (
	SonicVersion              = "1.0.0"
	SonicBackupPrefix         = "sonic-backup-"
	SonicDataExportPrefix     = "sonic-data-export-"
	SonicBackupMarkdownPrefix = "sonic-backup-markdown-"
	SonicDefaultTagColor      = "#cfd3d7"
	SonicUploadDir            = "upload"
	SonicDefaultThemeDirName  = "default-theme-anatole"
)
View Source
const (
	DefaultThemeId         = "caicai_anatole"
	ThemeScreenshotsName   = "screenshot"
	ThemeCustomSheetPrefix = "sheet_"
	ThemeCustomPostPrefix  = "post_"
)
View Source
const (
	DBTypeMySQL  = "MySQL"
	DBTypeSQLite = "SQLite"
)
View Source
const (
	EditorTypeMarkdown = iota
	EditorTypeRichText
)
View Source
const (
	OptionTypeInternal = iota
	OptionTypeCustom
)
View Source
const (
	SheetPermaLinkTypeSecondary = "SECONDARY"
	SheetPermaLinkTypeRoot      = "ROOT"
)
View Source
const (
	MetaTypePost  = iota
	MetaTypeSheet = iota
)
View Source
const (
	ThemeUpdateStrategyBranch = iota
	ThemeUpdateStrategyRelease
)
View Source
const (
	// ThemeConfigInputTypeTEXT Text input type
	ThemeConfigInputTypeTEXT = iota

	// ThemeConfigInputTypeNUMBER Number input type
	ThemeConfigInputTypeNUMBER

	// ThemeConfigInputTypeRADIO Radio box input type
	ThemeConfigInputTypeRADIO

	// ThemeConfigInputTypeSELECT Select input type
	ThemeConfigInputTypeSELECT

	// ThemeConfigInputTypeTEXTAREA Textarea input type
	ThemeConfigInputTypeTEXTAREA

	// ThemeConfigInputTypeCOLOR Color picker input type
	ThemeConfigInputTypeCOLOR

	// ThemeConfigInputTypeATTACHMENT Attachment picker input type
	ThemeConfigInputTypeATTACHMENT

	// ThemeConfigInputTypeSWITCH Switch input type, only true or false
	ThemeConfigInputTypeSWITCH
)

Variables

View Source
var (
	ThemePropertyFilenames = [2]string{"theme.yaml", "theme.yml"}
	ThemeSettingFilenames  = [2]string{"settings.yaml", "settings.yml"}
)
View Source
var DatabaseVersion string
View Source
var StartTime time.Time

StartTime 系统启动时间

Functions

This section is empty.

Types

type AttachmentType

type AttachmentType int32
const (
	AttachmentTypeLocal AttachmentType = iota
	// AttachmentTypeUpOSS 又拍云
	AttachmentTypeUpOSS
	// AttachmentTypeQiNiuOSS 七牛云
	AttachmentTypeQiNiuOSS
	// AttachmentTypeSMMS sm.ms
	AttachmentTypeSMMS
	// AttachmentTypeAliOSS 阿里云OSS
	AttachmentTypeAliOSS
	// AttachmentTypeBaiDuOSS 百度云OSS
	AttachmentTypeBaiDuOSS
	// AttachmentTypeTencentCOS 腾讯COS
	AttachmentTypeTencentCOS
	// AttachmentTypeHuaweiOBS 华为OBS
	AttachmentTypeHuaweiOBS
	// AttachmentTypeMinIO AttachmentTypeMinIO
	AttachmentTypeMinIO
)

func (AttachmentType) MarshalJSON

func (a AttachmentType) MarshalJSON() ([]byte, error)

func (*AttachmentType) Scan

func (a *AttachmentType) Scan(src interface{}) error

func (AttachmentType) String

func (a AttachmentType) String() string

func (*AttachmentType) UnmarshalJSON

func (a *AttachmentType) UnmarshalJSON(data []byte) error

func (AttachmentType) Value

func (a AttachmentType) Value() (driver.Value, error)

type CategoryType

type CategoryType int32
const (
	CategoryTypeNormal CategoryType = iota
	CategoryTypeIntimate
)

func (CategoryType) MarshalJSON

func (c CategoryType) MarshalJSON() ([]byte, error)

func (CategoryType) Ptr

func (c CategoryType) Ptr() *CategoryType

func (*CategoryType) Scan

func (c *CategoryType) Scan(src interface{}) error

func (*CategoryType) UnmarshalJSON

func (c *CategoryType) UnmarshalJSON(data []byte) error

func (CategoryType) Value

func (c CategoryType) Value() (driver.Value, error)

type CommentStatus

type CommentStatus int32
const (
	CommentStatusPublished CommentStatus = iota
	CommentStatusAuditing
	CommentStatusRecycle
)

func CommentStatusFromString

func CommentStatusFromString(str string) (CommentStatus, error)

func (CommentStatus) MarshalJSON

func (c CommentStatus) MarshalJSON() ([]byte, error)

func (CommentStatus) Ptr

func (c CommentStatus) Ptr() *CommentStatus

func (*CommentStatus) Scan

func (c *CommentStatus) Scan(src interface{}) error

func (*CommentStatus) UnmarshalJSON

func (c *CommentStatus) UnmarshalJSON(data []byte) error

func (CommentStatus) Value

func (c CommentStatus) Value() (driver.Value, error)

type CommentType

type CommentType int32
const (
	CommentTypePost CommentType = iota
	CommentTypeSheet
	CommentTypeJournal
)

func (*CommentType) Scan

func (ct *CommentType) Scan(src interface{}) error

func (CommentType) Value

func (ct CommentType) Value() (driver.Value, error)

type DBType

type DBType string

type EditorType

type EditorType int32

func (EditorType) MarshalJSON

func (e EditorType) MarshalJSON() ([]byte, error)

func (*EditorType) Scan

func (e *EditorType) Scan(src interface{}) error

func (*EditorType) UnmarshalJSON

func (e *EditorType) UnmarshalJSON(data []byte) error

func (EditorType) Value

func (e EditorType) Value() (driver.Value, error)

type EncryptType

type EncryptType int32
const (
	EncryptTypePost EncryptType = iota
	EncryptTypeCategory
)

func (EncryptType) Name

func (e EncryptType) Name() string

type JournalType

type JournalType int32
const (
	JournalTypePublic JournalType = iota
	JournalTypeIntimate
)

func (JournalType) MarshalJSON

func (j JournalType) MarshalJSON() ([]byte, error)

func (JournalType) Ptr

func (j JournalType) Ptr() *JournalType

func (*JournalType) Scan

func (j *JournalType) Scan(src interface{}) error

func (*JournalType) UnmarshalJSON

func (j *JournalType) UnmarshalJSON(data []byte) error

func (JournalType) Value

func (j JournalType) Value() (driver.Value, error)

type LogType

type LogType int32
const (
	LogTypeBlogInitialized LogType = iota
	LogTypePostPublished
	LogTypePostEdited
	LogTypePostDeleted
	LogTypeLoggedIn
	LogTypeLoggedOut
	LogTypeLoginFailed
	LogTypePasswordUpdated
	LogTypeProfileUpdated
	LogTypeSheetPublished
	LogTypeSheetEdited
	LogTypeSheetDeleted
	LogTypeMfaUpdated
	LogTypeLoggedPreCheck
)

func (LogType) MarshalJSON

func (l LogType) MarshalJSON() ([]byte, error)

func (*LogType) Scan

func (l *LogType) Scan(src interface{}) error

func (LogType) Value

func (l LogType) Value() (driver.Value, error)

type MFAType

type MFAType int32
const (
	MFANone MFAType = iota
	// MFATFATotp Time-based One-time Password (rfc6238).
	// see: https://tools.ietf.org/html/rfc6238
	MFATFATotp
)

func (MFAType) MarshalJSON

func (m MFAType) MarshalJSON() ([]byte, error)

func (*MFAType) Scan

func (m *MFAType) Scan(src interface{}) error

func (*MFAType) UnmarshalJSON

func (m *MFAType) UnmarshalJSON(data []byte) error

func (MFAType) Value

func (m MFAType) Value() (driver.Value, error)

type MetaType

type MetaType int32

func (*MetaType) Scan

func (m *MetaType) Scan(src interface{}) error

func (MetaType) Value

func (m MetaType) Value() (driver.Value, error)

type OptionType

type OptionType int32

func (OptionType) MarshalJSON

func (o OptionType) MarshalJSON() ([]byte, error)

func (*OptionType) Scan

func (o *OptionType) Scan(src interface{}) error

func (*OptionType) UnmarshalJSON

func (o *OptionType) UnmarshalJSON(data []byte) error

func (OptionType) Value

func (o OptionType) Value() (driver.Value, error)

type PostPermalinkType

type PostPermalinkType string
const (
	PostPermalinkTypeDefault PostPermalinkType = "DEFAULT"
	PostPermalinkTypeDate    PostPermalinkType = "DATE"
	PostPermalinkTypeDay     PostPermalinkType = "DAY"
	PostPermalinkTypeID      PostPermalinkType = "ID"
	PostPermalinkTypeYear    PostPermalinkType = "YEAR"
	PostPermalinkTypeIDSlug  PostPermalinkType = "ID_SLUG"
)

type PostStatus

type PostStatus int32
const (
	PostStatusPublished PostStatus = iota
	PostStatusDraft
	PostStatusRecycle
	PostStatusIntimate
)

func PostStatusFromString added in v1.0.2

func PostStatusFromString(str string) (PostStatus, error)

func (PostStatus) MarshalJSON

func (c PostStatus) MarshalJSON() ([]byte, error)

func (PostStatus) Ptr

func (c PostStatus) Ptr() *PostStatus

func (*PostStatus) Scan

func (c *PostStatus) Scan(src interface{}) error

func (*PostStatus) UnmarshalJSON

func (c *PostStatus) UnmarshalJSON(data []byte) error

func (PostStatus) Value

func (c PostStatus) Value() (driver.Value, error)

type PostType

type PostType int32
const (
	PostTypePost PostType = iota
	PostTypeSheet
)

func (*PostType) Scan

func (p *PostType) Scan(src interface{}) error

func (PostType) Value

func (p PostType) Value() (driver.Value, error)

type SheetPermaLinkType

type SheetPermaLinkType string

type ThemeConfigDataType

type ThemeConfigDataType int32
const (
	ThemeConfigDataTypeString ThemeConfigDataType = iota
	ThemeConfigDataTypeLong
	ThemeConfigDataTypeDouble
	ThemeConfigDataTypeBool
)

func (ThemeConfigDataType) Convert

func (t ThemeConfigDataType) Convert(value string) (interface{}, error)

func (ThemeConfigDataType) FormatToStr

func (t ThemeConfigDataType) FormatToStr(value interface{}) (string, error)

func (ThemeConfigDataType) MarshalJSON

func (t ThemeConfigDataType) MarshalJSON() ([]byte, error)

func (*ThemeConfigDataType) UnmarshalJSON

func (t *ThemeConfigDataType) UnmarshalJSON(data []byte) error

func (*ThemeConfigDataType) UnmarshalYAML

func (t *ThemeConfigDataType) UnmarshalYAML(unmarshal func(interface{}) error) error

type ThemeConfigInputType

type ThemeConfigInputType int32

func (ThemeConfigInputType) MarshalJSON

func (t ThemeConfigInputType) MarshalJSON() ([]byte, error)

func (*ThemeConfigInputType) UnmarshalJSON

func (t *ThemeConfigInputType) UnmarshalJSON(data []byte) error

func (*ThemeConfigInputType) UnmarshalYAML

func (t *ThemeConfigInputType) UnmarshalYAML(unmarshal func(interface{}) error) error

type ThemeUpdateStrategy

type ThemeUpdateStrategy int32

Jump to

Keyboard shortcuts

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