Documentation
¶
Index ¶
- Constants
- type AccessTokensUserSetting
- type Attachment
- type AttachmentPayload
- type AttachmentPayloadS3Object
- type AttachmentStorageType
- type ClientInfo
- type CreateMemoRequest
- type CreateSessionRequest
- type CreateUserRequest
- type CustomProfile
- type DeleteMemoRequest
- type FindAttachmentFilter
- type FindInboxFilter
- type FindMemoFilter
- type FindSessionFilter
- type FindSystemSettingFilter
- type FindUserFilter
- type FindUserSettingFilter
- type GeneralSetting
- type GeneralUserSetting
- type GetMemoRequest
- type GetUserSessionsRequest
- type GetUserSettingRequest
- type GetUserSettingsRequest
- type Inbox
- type ListInboxesRequest
- type ListMemosRequest
- type Memo
- type MemoPayload
- type MemoPayloadLocation
- type MemoPayloadProperty
- type MemoRelatedSetting
- type Reaction
- type RelationType
- type ResStorageType
- type Resource
- type RevokeUserSessionRequest
- type Role
- type RowStatus
- type Session
- type SessionsUserSetting
- type StorageS3Config
- type StorageSetting
- type SystemSetting
- type SystemSettingValue
- type UpdateMemoRequest
- type UpdateUserRequest
- type UpdateUserSettingRequest
- type User
- type UserAccessToken
- type UserSession
- type UserSetting
- type UserSettingKey
- type UserSettingValue
- type UserWebhook
- type Visibility
- type WebhooksUserSetting
Constants ¶
View Source
const ( TableMemo = "memo" TableResource = "resource" TableReaction = "reaction" TableUser = "user" TableUserSetting = "user_setting" TableSession = "session" TableSystemSetting = "system_setting" TableInbox = "inbox" TableAttachment = "attachment" )
View Source
const ( WorkspaceSettingNamePrefix = "workspace/settings/" UserNamePrefix = "users/" MemoNamePrefix = "memos/" AttachmentNamePrefix = "attachments/" ReactionNamePrefix = "reactions/" InboxNamePrefix = "inboxes/" IdentityProviderNamePrefix = "identityProviders/" ActivityNamePrefix = "activities/" WebhookNamePrefix = "webhooks/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokensUserSetting ¶ added in v0.1.1
type AccessTokensUserSetting struct {
AccessTokens []*UserAccessToken
}
type Attachment ¶ added in v0.1.2
type Attachment struct {
db.Model
// UID is the user defined unique identifier for the attachment.
UID string
// Standard fields
CreatorID int32
// The related memo ID.
MemoID int64
// Domain specific fields
Filename string
Blob []byte
Type string
Size int64
StorageType AttachmentStorageType
Reference string
Payload AttachmentPayload
}
func (Attachment) TableName ¶ added in v0.1.2
func (Attachment) TableName() string
type AttachmentPayload ¶ added in v0.1.2
type AttachmentPayload struct {
S3Object *AttachmentPayloadS3Object
}
type AttachmentPayloadS3Object ¶ added in v0.1.2
type AttachmentPayloadS3Object struct {
S3Config *StorageS3Config
Key string
// last_presigned_time is the last time the object was presigned.
// This is used to determine if the presigned URL is still valid.
LastPresignedTime time.Time
}
type AttachmentStorageType ¶ added in v0.1.2
type AttachmentStorageType string
const ( // Attachment is stored locally. AKA, local file system. AttachmentStorageTypeLocal AttachmentStorageType = "local" // Attachment is stored in S3. AttachmentStorageTypeS3 AttachmentStorageType = "s3" // Attachment is stored in an external storage. The reference is a URL. AttachmentStorageTypeExternal AttachmentStorageType = "external" )
type ClientInfo ¶ added in v0.1.1
type CreateMemoRequest ¶
type CreateMemoRequest struct {
UserID int64
ParentID int64
RelationType RelationType
Visibility Visibility
Content string
RowStatus RowStatus
Location *MemoPayloadLocation
}
type CreateSessionRequest ¶
type CreateUserRequest ¶
type CustomProfile ¶
type DeleteMemoRequest ¶ added in v0.1.4
type FindAttachmentFilter ¶ added in v0.1.2
type FindAttachmentFilter struct {
db.BaseFilter
ID db.F[int64]
}
type FindInboxFilter ¶ added in v0.1.2
type FindMemoFilter ¶
type FindSessionFilter ¶
type FindSystemSettingFilter ¶
type FindSystemSettingFilter struct {
db.BaseFilter
Name db.F[string]
}
type FindUserFilter ¶
type FindUserSettingFilter ¶ added in v0.1.1
type FindUserSettingFilter struct {
db.BaseFilter
UserID db.F[int64]
Key db.F[UserSettingKey]
}
type GeneralSetting ¶
type GeneralSetting struct {
// theme is the name of the selected theme.
// This references a CSS file in the web/public/themes/ directory.
Theme string
// disallow_user_registration disallows user registration.
DisallowUserRegistration bool
// disallow_password_auth disallows password authentication.
DisallowPasswordAuth bool
// additional_script is the additional script.
AdditionalScript string
// additional_style is the additional style.
AdditionalStyle string
// custom_profile is the custom profile.
CustomProfile *CustomProfile
// week_start_day_offset is the week start day offset from Sunday.
// 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
// Default is Sunday.
WeekStartDayOffset int
// disallow_change_username disallows changing username.
DisallowChangeUsername bool
// disallow_change_nickname disallows changing nickname.
DisallowChangeNickname bool
}
type GeneralUserSetting ¶ added in v0.1.1
type GetMemoRequest ¶
type GetUserSessionsRequest ¶ added in v0.1.3
type GetUserSessionsRequest struct {
UserID int64
}
type GetUserSettingRequest ¶ added in v0.1.1
type GetUserSettingRequest struct {
UserID int64
Key UserSettingKey
}
type GetUserSettingsRequest ¶ added in v0.1.1
type GetUserSettingsRequest struct {
}
type Inbox ¶ added in v0.1.2
type Inbox struct {
db.Model
SenderID int64
ReceiverID int64
ActivityID int64
Status string
Message string
}
Inbox 收件箱
type ListInboxesRequest ¶ added in v0.1.2
type ListInboxesRequest struct {
}
type ListMemosRequest ¶
type ListMemosRequest struct {
Status RowStatus
VisibilityList []Visibility
ExcludeContent bool
ExcludeComments bool
}
type Memo ¶
type Memo struct {
db.Model
UID string
ParentID int64
CreatorID int64
Content string
Payload *MemoPayload `gorm:"serializer:json"`
Pinned bool
Visibility Visibility
RowStatus RowStatus
}
Memo 笔记
type MemoPayload ¶
type MemoPayload struct {
Property *MemoPayloadProperty `json:"property"`
Location *MemoPayloadLocation `json:"location"`
Tags []string `json:"tags"`
}
type MemoPayloadLocation ¶
type MemoPayloadProperty ¶
type MemoRelatedSetting ¶
type MemoRelatedSetting struct {
// disallow_public_visibility disallows set memo as public visibility.
DisallowPublicVisibility bool
// display_with_update_time orders and displays memo with update time.
DisplayWithUpdateTime bool
// content_length_limit is the limit of content length. Unit is byte.
ContentLengthLimit int
// enable_double_click_edit enables editing on double click.
EnableDoubleClickEdit bool
// enable_link_preview enables links preview.
EnableLinkPreview bool
// reactions is the list of reactions.
Reactions []string
// disable_markdown_shortcuts disallow the registration of markdown shortcuts.
DisableMarkdownShortcuts bool
// enable_blur_nsfw_content enables blurring of content marked as not safe for work (NSFW).
EnableBlurNsfwContent bool
// nsfw_tags is the list of tags that mark content as NSFW for blurring.
NsfwTags []string
}
type RelationType ¶
type RelationType string
const ( RelationReference RelationType = "REFERENCE" RelationComment RelationType = "COMMENT" )
type ResStorageType ¶
type ResStorageType string
const ( ResStorageTypeLocal ResStorageType = "LOCAL" ResourceStorageTypeS3 ResStorageType = "S3" ResourceStorageTypeExternal ResStorageType = "EXTERNAL" )
type Resource ¶
type RevokeUserSessionRequest ¶ added in v0.1.3
type SessionsUserSetting ¶ added in v0.1.1
type SessionsUserSetting struct {
Sessions []*UserSession
}
type StorageS3Config ¶ added in v0.1.2
type StorageSetting ¶
type StorageSetting struct {
}
type SystemSetting ¶
type SystemSetting struct {
Name string
Value SystemSettingValue `gorm:"serializer:json"`
Description string
}
func (SystemSetting) TableName ¶
func (SystemSetting) TableName() string
type SystemSettingValue ¶
type SystemSettingValue struct {
*GeneralSetting
*StorageSetting
*MemoRelatedSetting
}
type UpdateMemoRequest ¶ added in v0.1.4
type UpdateMemoRequest struct {
ID int64
UserID int64
ParentID int64
RelationType RelationType
Visibility Visibility
Content string
RowStatus RowStatus
Location *MemoPayloadLocation
}
type UpdateUserRequest ¶
type UpdateUserSettingRequest ¶ added in v0.1.3
type UpdateUserSettingRequest struct {
UpdateMask []string
UserID int64
Key UserSettingKey
Value UserSettingValue
}
type User ¶
type UserAccessToken ¶ added in v0.1.1
type UserSession ¶ added in v0.1.1
type UserSetting ¶ added in v0.1.1
type UserSetting struct {
UserID int64
Key string
Value UserSettingValue `gorm:"serializer:json"`
}
func (UserSetting) TableName ¶ added in v0.1.1
func (UserSetting) TableName() string
type UserSettingKey ¶ added in v0.1.3
type UserSettingKey string
const ( UserSettingKeyGeneral UserSettingKey = "GENERAL" UserSettingKeySessions UserSettingKey = "SESSIONS" UserSettingKeyAccessTokens UserSettingKey = "ACCESS_TOKENS" UserSettingKeyWebhooks UserSettingKey = "WEBHOOKS" )
type UserSettingValue ¶ added in v0.1.1
type UserSettingValue struct {
*GeneralUserSetting
*SessionsUserSetting
*AccessTokensUserSetting
*WebhooksUserSetting
}
type UserWebhook ¶ added in v0.1.1
type Visibility ¶
type Visibility string
Visibility is the type of a visibility.
const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED visibility. Protected Visibility = "PROTECTED" // Private is the PRIVATE visibility. Private Visibility = "PRIVATE" )
func (Visibility) String ¶
func (v Visibility) String() string
type WebhooksUserSetting ¶ added in v0.1.1
type WebhooksUserSetting struct {
Webhooks []*UserWebhook
}
Click to show internal directories.
Click to hide internal directories.