Documentation ¶
Index ¶
- Constants
- Variables
- type AttachmentType
- type CategoryType
- type CommentStatus
- type CommentType
- type DBType
- type EditorType
- type EncryptType
- type JournalType
- type LogType
- type MFAType
- type MetaType
- type OptionType
- type PostPermalinkType
- type PostStatus
- type PostType
- type SheetPermaLinkType
- type ThemeConfigDataType
- func (t ThemeConfigDataType) Convert(value string) (interface{}, error)
- func (t ThemeConfigDataType) FormatToStr(value interface{}) (string, error)
- func (t ThemeConfigDataType) MarshalJSON() ([]byte, error)
- func (t *ThemeConfigDataType) UnmarshalJSON(data []byte) error
- func (t *ThemeConfigDataType) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ThemeConfigInputType
- type ThemeUpdateStrategy
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 ( 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 ( 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"} )
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
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
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
type CommentType ¶
type CommentType int32
const ( CommentTypePost CommentType = iota CommentTypeSheet CommentTypeJournal )
func (*CommentType) Scan ¶
func (ct *CommentType) Scan(src interface{}) error
type EditorType ¶
type EditorType int32
const ( EditorTypeMarkdown EditorType = iota EditorTypeRichText )
func (EditorType) MarshalJSON ¶
func (e EditorType) MarshalJSON() ([]byte, error)
func (EditorType) Ptr ¶ added in v1.0.5
func (e EditorType) Ptr() *EditorType
func (*EditorType) Scan ¶
func (e *EditorType) Scan(src interface{}) error
func (*EditorType) UnmarshalJSON ¶
func (e *EditorType) UnmarshalJSON(data []byte) 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
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 ¶
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 (*MFAType) UnmarshalJSON ¶
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
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
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
Click to show internal directories.
Click to hide internal directories.