store

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 22 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// MigrateFileNameSplit is the split character between the patch version and the description in the migration file name.
	// For example, "1__create_table.sql".
	MigrateFileNameSplit = "__"
	// LatestSchemaFileName is the name of the latest schema file.
	// This file is used to apply the latest schema when no migration history is found.
	LatestSchemaFileName = "LATEST.sql"
)
View Source
const DefaultContentLengthLimit = 8 * 1024

DefaultContentLengthLimit is the default limit of content length in bytes. 8KB.

View Source
const (
	SystemBotID int32 = 0
)

Variables

View Source
var DefaultNsfwTags = []string{"nsfw"}

DefaultNsfwTags is the default tags that mark content as NSFW for blurring.

View Source
var DefaultReactions = []string{"👍", "👎", "❤️", "🎉", "😄", "😕", "😢", "😡"}

DefaultReactions is the default reactions for memo related setting.

View Source
var (
	SystemBot = &User{
		ID:       SystemBotID,
		Username: "system_bot",
		Role:     RoleAdmin,
		Email:    "",
		Nickname: "Bot",
	}
)

Functions

This section is empty.

Types

type Activity added in v0.14.0

type Activity struct {
	ID int32

	// Standard fields
	CreatorID int32
	CreatedTs int64

	// Domain specific fields
	Type    ActivityType
	Level   ActivityLevel
	Payload *storepb.ActivityPayload
}

type ActivityLevel added in v0.17.0

type ActivityLevel string
const (
	ActivityLevelInfo ActivityLevel = "INFO"
)

func (ActivityLevel) String added in v0.17.0

func (l ActivityLevel) String() string

type ActivityType added in v0.17.0

type ActivityType string
const (
	ActivityTypeMemoComment ActivityType = "MEMO_COMMENT"
)

func (ActivityType) String added in v0.17.0

func (t ActivityType) String() string

type Attachment added in v0.25.0

type Attachment struct {
	// ID is the system generated unique identifier for the attachment.
	ID int32
	// UID is the user defined unique identifier for the attachment.
	UID string

	// Standard fields
	CreatorID int32
	CreatedTs int64
	UpdatedTs int64

	// Domain specific fields
	Filename    string
	Blob        []byte
	Type        string
	Size        int64
	StorageType storepb.AttachmentStorageType
	Reference   string
	Payload     *storepb.AttachmentPayload

	// The related memo ID.
	MemoID *int32

	// Composed field
	MemoUID *string
}

type DeleteAttachment added in v0.25.0

type DeleteAttachment struct {
	ID     int32
	MemoID *int32
}

type DeleteIdentityProvider added in v0.13.2

type DeleteIdentityProvider struct {
	ID int32
}

type DeleteInbox added in v0.17.0

type DeleteInbox struct {
	ID int32
}

DeleteInbox specifies which inbox item to delete.

type DeleteInstanceSetting added in v0.25.3

type DeleteInstanceSetting struct {
	Name string
}

type DeleteMemo added in v0.14.0

type DeleteMemo struct {
	ID int32
}

type DeleteMemoRelation added in v0.14.0

type DeleteMemoRelation struct {
	MemoID        *int32
	RelatedMemoID *int32
	Type          *MemoRelationType
}

type DeleteReaction added in v0.20.0

type DeleteReaction struct {
	ID int32
}

type DeleteUser added in v0.14.0

type DeleteUser struct {
	ID int32
}

type Driver added in v0.16.0

type Driver interface {
	GetDB() *sql.DB
	Close() error

	IsInitialized(ctx context.Context) (bool, error)

	// MigrationHistory model related methods.
	// NOTE: These methods are deprecated. The migration_history table is no longer used
	// for tracking schema versions. Schema version is now stored in instance_setting.
	// These methods are kept for backward compatibility to migrate existing installations.
	FindMigrationHistoryList(ctx context.Context, find *FindMigrationHistory) ([]*MigrationHistory, error)
	UpsertMigrationHistory(ctx context.Context, upsert *UpsertMigrationHistory) (*MigrationHistory, error)

	// Activity model related methods.
	CreateActivity(ctx context.Context, create *Activity) (*Activity, error)
	ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error)

	// Attachment model related methods.
	CreateAttachment(ctx context.Context, create *Attachment) (*Attachment, error)
	ListAttachments(ctx context.Context, find *FindAttachment) ([]*Attachment, error)
	UpdateAttachment(ctx context.Context, update *UpdateAttachment) error
	DeleteAttachment(ctx context.Context, delete *DeleteAttachment) error

	// Memo model related methods.
	CreateMemo(ctx context.Context, create *Memo) (*Memo, error)
	ListMemos(ctx context.Context, find *FindMemo) ([]*Memo, error)
	UpdateMemo(ctx context.Context, update *UpdateMemo) error
	DeleteMemo(ctx context.Context, delete *DeleteMemo) error

	// MemoRelation model related methods.
	UpsertMemoRelation(ctx context.Context, create *MemoRelation) (*MemoRelation, error)
	ListMemoRelations(ctx context.Context, find *FindMemoRelation) ([]*MemoRelation, error)
	DeleteMemoRelation(ctx context.Context, delete *DeleteMemoRelation) error

	// InstanceSetting model related methods.
	UpsertInstanceSetting(ctx context.Context, upsert *InstanceSetting) (*InstanceSetting, error)
	ListInstanceSettings(ctx context.Context, find *FindInstanceSetting) ([]*InstanceSetting, error)
	DeleteInstanceSetting(ctx context.Context, delete *DeleteInstanceSetting) error

	// User model related methods.
	CreateUser(ctx context.Context, create *User) (*User, error)
	UpdateUser(ctx context.Context, update *UpdateUser) (*User, error)
	ListUsers(ctx context.Context, find *FindUser) ([]*User, error)
	DeleteUser(ctx context.Context, delete *DeleteUser) error

	// UserSetting model related methods.
	UpsertUserSetting(ctx context.Context, upsert *UserSetting) (*UserSetting, error)
	ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*UserSetting, error)

	// IdentityProvider model related methods.
	CreateIdentityProvider(ctx context.Context, create *IdentityProvider) (*IdentityProvider, error)
	ListIdentityProviders(ctx context.Context, find *FindIdentityProvider) ([]*IdentityProvider, error)
	UpdateIdentityProvider(ctx context.Context, update *UpdateIdentityProvider) (*IdentityProvider, error)
	DeleteIdentityProvider(ctx context.Context, delete *DeleteIdentityProvider) error

	// Inbox model related methods.
	CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
	ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error)
	UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error)
	DeleteInbox(ctx context.Context, delete *DeleteInbox) error

	// Reaction model related methods.
	UpsertReaction(ctx context.Context, create *Reaction) (*Reaction, error)
	ListReactions(ctx context.Context, find *FindReaction) ([]*Reaction, error)
	GetReaction(ctx context.Context, find *FindReaction) (*Reaction, error)
	DeleteReaction(ctx context.Context, delete *DeleteReaction) error
}

Driver is an interface for store driver. It contains all methods that store database driver should implement.

type FindActivity added in v0.16.1

type FindActivity struct {
	ID   *int32
	Type *ActivityType
}

type FindAttachment added in v0.25.0

type FindAttachment struct {
	GetBlob        bool
	ID             *int32
	UID            *string
	CreatorID      *int32
	Filename       *string
	FilenameSearch *string
	MemoID         *int32
	MemoIDList     []int32
	HasRelatedMemo bool
	StorageType    *storepb.AttachmentStorageType
	Limit          *int
	Offset         *int
}

type FindIdentityProvider added in v0.13.2

type FindIdentityProvider struct {
	ID *int32
}

type FindInbox added in v0.17.0

type FindInbox struct {
	ID         *int32
	SenderID   *int32
	ReceiverID *int32
	Status     *InboxStatus

	// Pagination
	Limit  *int
	Offset *int
}

FindInbox specifies filter criteria for querying inbox items.

type FindInstanceSetting added in v0.25.3

type FindInstanceSetting struct {
	Name string
}

type FindMemo added in v0.14.0

type FindMemo struct {
	ID  *int32
	UID *string

	IDList  []int32
	UIDList []string

	// Standard fields
	RowStatus *RowStatus
	CreatorID *int32

	// Domain specific fields
	VisibilityList  []Visibility
	ExcludeContent  bool
	ExcludeComments bool
	Filters         []string

	// Pagination
	Limit  *int
	Offset *int

	// Ordering
	OrderByPinned    bool
	OrderByUpdatedTs bool
	OrderByTimeAsc   bool
}

type FindMemoPayload added in v0.22.0

type FindMemoPayload struct {
	Raw                *string
	TagSearch          []string
	HasLink            bool
	HasTaskList        bool
	HasCode            bool
	HasIncompleteTasks bool
}

type FindMemoRelation added in v0.14.0

type FindMemoRelation struct {
	MemoID        *int32
	RelatedMemoID *int32
	Type          *MemoRelationType
	MemoFilter    *string
}

type FindMigrationHistory added in v0.17.1

type FindMigrationHistory struct {
}

FindMigrationHistory is used to query migration history records. NOTE: This is deprecated along with the migration_history table.

type FindReaction added in v0.20.0

type FindReaction struct {
	ID            *int32
	CreatorID     *int32
	ContentID     *string
	ContentIDList []string
}

type FindUser added in v0.14.0

type FindUser struct {
	ID        *int32
	RowStatus *RowStatus
	Username  *string
	Role      *Role
	Email     *string
	Nickname  *string

	// Domain specific fields
	Filters []string

	// The maximum number of users to return.
	Limit *int
}

type FindUserSetting added in v0.13.2

type FindUserSetting struct {
	UserID *int32
	Key    storepb.UserSetting_Key
}

type IdentityProvider added in v0.13.2

type IdentityProvider struct {
	ID               int32
	Name             string
	Type             storepb.IdentityProvider_Type
	IdentifierFilter string
	Config           string
}

type Inbox added in v0.17.0

type Inbox struct {
	ID         int32
	CreatedTs  int64
	SenderID   int32                 // The user who triggered the notification
	ReceiverID int32                 // The user who receives the notification
	Status     InboxStatus           // Current status (unread/archived)
	Message    *storepb.InboxMessage // The notification message content
}

Inbox represents a notification in a user's inbox. It connects activities to users who should be notified.

type InboxStatus added in v0.17.0

type InboxStatus string

InboxStatus represents the status of an inbox notification.

const (
	// UNREAD indicates the notification has not been read by the user.
	UNREAD InboxStatus = "UNREAD"
	// ARCHIVED indicates the notification has been archived/dismissed by the user.
	ARCHIVED InboxStatus = "ARCHIVED"
)

func (InboxStatus) String added in v0.17.0

func (s InboxStatus) String() string

type InstanceSetting added in v0.25.3

type InstanceSetting struct {
	Name        string
	Value       string
	Description string
}

type Memo added in v0.14.0

type Memo struct {
	// ID is the system generated unique identifier for the memo.
	ID int32
	// UID is the user defined unique identifier for the memo.
	UID string

	// Standard fields
	RowStatus RowStatus
	CreatorID int32
	CreatedTs int64
	UpdatedTs int64

	// Domain specific fields
	Content    string
	Visibility Visibility
	Pinned     bool
	Payload    *storepb.MemoPayload

	// Composed fields
	ParentUID *string
}

type MemoRelation added in v0.14.0

type MemoRelation struct {
	MemoID        int32
	RelatedMemoID int32
	Type          MemoRelationType
}

type MemoRelationType added in v0.13.0

type MemoRelationType string
const (
	// MemoRelationReference is the type for a reference memo relation.
	MemoRelationReference MemoRelationType = "REFERENCE"
	// MemoRelationComment is the type for a comment memo relation.
	MemoRelationComment MemoRelationType = "COMMENT"
)

type MigrationHistory added in v0.17.1

type MigrationHistory struct {
	Version   string
	CreatedTs int64
}

MigrationHistory represents a record in the migration_history table. NOTE: The migration_history table is deprecated in favor of storing schema version in system_setting (BASIC setting). This is kept for backward compatibility only. Migration from migration_history to system_setting happens automatically during startup.

type Reaction added in v0.21.1

type Reaction struct {
	ID        int32
	CreatedTs int64
	CreatorID int32
	// ContentID is the id of the content that the reaction is for.
	ContentID    string
	ReactionType string
}

type Role added in v0.13.2

type Role string

Role is the type of a role.

const (
	// RoleHost is the HOST role.
	RoleHost Role = "HOST"
	// RoleAdmin is the ADMIN role.
	RoleAdmin Role = "ADMIN"
	// RoleUser is the USER role.
	RoleUser Role = "USER"
)

func (Role) String added in v0.13.2

func (e Role) String() string

type RowStatus added in v0.13.1

type RowStatus string

RowStatus is the status for a row.

const (
	// Normal is the status for a normal row.
	Normal RowStatus = "NORMAL"
	// Archived is the status for an archived row.
	Archived RowStatus = "ARCHIVED"
)

func (RowStatus) String added in v0.13.1

func (r RowStatus) String() string

type Store

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

Store provides database access to all raw objects.

func New

func New(driver Driver, profile *profile.Profile) *Store

New creates a new instance of Store.

func (*Store) AddUserSession added in v0.25.0

func (s *Store) AddUserSession(ctx context.Context, userID int32, session *storepb.SessionsUserSetting_Session) error

AddUserSession adds a new session for the user.

func (*Store) AddUserWebhook added in v0.25.0

func (s *Store) AddUserWebhook(ctx context.Context, userID int32, webhook *storepb.WebhooksUserSetting_Webhook) error

AddUserWebhook adds a new webhook for the user.

func (*Store) Close added in v0.16.0

func (s *Store) Close() error

func (*Store) CreateActivity added in v0.10.0

func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity, error)

func (*Store) CreateAttachment added in v0.25.0

func (s *Store) CreateAttachment(ctx context.Context, create *Attachment) (*Attachment, error)

func (*Store) CreateIdentityProvider added in v0.11.0

func (s *Store) CreateIdentityProvider(ctx context.Context, create *storepb.IdentityProvider) (*storepb.IdentityProvider, error)

func (*Store) CreateInbox added in v0.17.0

func (s *Store) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)

CreateInbox creates a new inbox notification.

func (*Store) CreateMemo

func (s *Store) CreateMemo(ctx context.Context, create *Memo) (*Memo, error)

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, create *User) (*User, error)

func (*Store) DeleteAttachment added in v0.25.0

func (s *Store) DeleteAttachment(ctx context.Context, delete *DeleteAttachment) error

func (*Store) DeleteIdentityProvider added in v0.11.0

func (s *Store) DeleteIdentityProvider(ctx context.Context, delete *DeleteIdentityProvider) error

func (*Store) DeleteInbox added in v0.17.0

func (s *Store) DeleteInbox(ctx context.Context, delete *DeleteInbox) error

DeleteInbox permanently removes an inbox item.

func (*Store) DeleteMemo

func (s *Store) DeleteMemo(ctx context.Context, delete *DeleteMemo) error

func (*Store) DeleteMemoRelation added in v0.13.0

func (s *Store) DeleteMemoRelation(ctx context.Context, delete *DeleteMemoRelation) error

func (*Store) DeleteReaction added in v0.20.0

func (s *Store) DeleteReaction(ctx context.Context, delete *DeleteReaction) error

func (*Store) DeleteUser added in v0.3.0

func (s *Store) DeleteUser(ctx context.Context, delete *DeleteUser) error

func (*Store) GetActivity added in v0.17.0

func (s *Store) GetActivity(ctx context.Context, find *FindActivity) (*Activity, error)

func (*Store) GetAttachment added in v0.25.0

func (s *Store) GetAttachment(ctx context.Context, find *FindAttachment) (*Attachment, error)

func (*Store) GetCurrentSchemaVersion added in v0.22.5

func (s *Store) GetCurrentSchemaVersion() (string, error)

func (*Store) GetDriver added in v0.24.0

func (s *Store) GetDriver() Driver

func (*Store) GetIdentityProvider added in v0.11.0

func (s *Store) GetIdentityProvider(ctx context.Context, find *FindIdentityProvider) (*storepb.IdentityProvider, error)

func (*Store) GetInstanceBasicSetting added in v0.25.3

func (s *Store) GetInstanceBasicSetting(ctx context.Context) (*storepb.InstanceBasicSetting, error)

func (*Store) GetInstanceGeneralSetting added in v0.25.3

func (s *Store) GetInstanceGeneralSetting(ctx context.Context) (*storepb.InstanceGeneralSetting, error)

func (*Store) GetInstanceMemoRelatedSetting added in v0.25.3

func (s *Store) GetInstanceMemoRelatedSetting(ctx context.Context) (*storepb.InstanceMemoRelatedSetting, error)

func (*Store) GetInstanceSetting added in v0.25.3

func (s *Store) GetInstanceSetting(ctx context.Context, find *FindInstanceSetting) (*storepb.InstanceSetting, error)

func (*Store) GetInstanceStorageSetting added in v0.25.3

func (s *Store) GetInstanceStorageSetting(ctx context.Context) (*storepb.InstanceStorageSetting, error)

func (*Store) GetMemo added in v0.13.1

func (s *Store) GetMemo(ctx context.Context, find *FindMemo) (*Memo, error)

func (*Store) GetReaction added in v0.25.3

func (s *Store) GetReaction(ctx context.Context, find *FindReaction) (*Reaction, error)

func (*Store) GetUser added in v0.13.2

func (s *Store) GetUser(ctx context.Context, find *FindUser) (*User, error)

func (*Store) GetUserAccessTokens added in v0.15.0

func (s *Store) GetUserAccessTokens(ctx context.Context, userID int32) ([]*storepb.AccessTokensUserSetting_AccessToken, error)

GetUserAccessTokens returns the access tokens of the user.

func (*Store) GetUserSessions added in v0.25.0

func (s *Store) GetUserSessions(ctx context.Context, userID int32) ([]*storepb.SessionsUserSetting_Session, error)

GetUserSessions returns the sessions of the user.

func (*Store) GetUserSetting added in v0.13.2

func (s *Store) GetUserSetting(ctx context.Context, find *FindUserSetting) (*storepb.UserSetting, error)

func (*Store) GetUserWebhooks added in v0.25.0

func (s *Store) GetUserWebhooks(ctx context.Context, userID int32) ([]*storepb.WebhooksUserSetting_Webhook, error)

GetUserWebhooks returns the webhooks of the user.

func (*Store) ListActivities added in v0.17.0

func (s *Store) ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error)

func (*Store) ListAttachments added in v0.25.0

func (s *Store) ListAttachments(ctx context.Context, find *FindAttachment) ([]*Attachment, error)

func (*Store) ListIdentityProviders added in v0.11.0

func (s *Store) ListIdentityProviders(ctx context.Context, find *FindIdentityProvider) ([]*storepb.IdentityProvider, error)

func (*Store) ListInboxes added in v0.17.0

func (s *Store) ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error)

ListInboxes retrieves inbox items matching the filter criteria.

func (*Store) ListInstanceSettings added in v0.25.3

func (s *Store) ListInstanceSettings(ctx context.Context, find *FindInstanceSetting) ([]*storepb.InstanceSetting, error)

func (*Store) ListMemoRelations added in v0.13.0

func (s *Store) ListMemoRelations(ctx context.Context, find *FindMemoRelation) ([]*MemoRelation, error)

func (*Store) ListMemos added in v0.13.1

func (s *Store) ListMemos(ctx context.Context, find *FindMemo) ([]*Memo, error)

func (*Store) ListReactions added in v0.20.0

func (s *Store) ListReactions(ctx context.Context, find *FindReaction) ([]*Reaction, error)

func (*Store) ListUserSettings added in v0.13.2

func (s *Store) ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*storepb.UserSetting, error)

func (*Store) ListUsers added in v0.13.2

func (s *Store) ListUsers(ctx context.Context, find *FindUser) ([]*User, error)

func (*Store) Migrate added in v0.22.5

func (s *Store) Migrate(ctx context.Context) error

Migrate migrates the database schema to the latest version. It checks the current schema version and applies any necessary migrations. It also seeds the database with initial data if in demo mode.

func (*Store) RemoveUserAccessToken added in v0.18.0

func (s *Store) RemoveUserAccessToken(ctx context.Context, userID int32, token string) error

RemoveUserAccessToken remove the access token of the user.

func (*Store) RemoveUserSession added in v0.25.0

func (s *Store) RemoveUserSession(ctx context.Context, userID int32, sessionID string) error

RemoveUserSession removes the session of the user.

func (*Store) RemoveUserWebhook added in v0.25.0

func (s *Store) RemoveUserWebhook(ctx context.Context, userID int32, webhookID string) error

RemoveUserWebhook removes the webhook of the user.

func (*Store) UpdateAttachment added in v0.25.0

func (s *Store) UpdateAttachment(ctx context.Context, update *UpdateAttachment) error

func (*Store) UpdateIdentityProvider added in v0.11.0

func (s *Store) UpdateIdentityProvider(ctx context.Context, update *UpdateIdentityProviderV1) (*storepb.IdentityProvider, error)

func (*Store) UpdateInbox added in v0.17.0

func (s *Store) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error)

UpdateInbox updates an existing inbox item.

func (*Store) UpdateMemo added in v0.13.1

func (s *Store) UpdateMemo(ctx context.Context, update *UpdateMemo) error

func (*Store) UpdateUser added in v0.14.0

func (s *Store) UpdateUser(ctx context.Context, update *UpdateUser) (*User, error)

func (*Store) UpdateUserSessionLastAccessed added in v0.25.0

func (s *Store) UpdateUserSessionLastAccessed(ctx context.Context, userID int32, sessionID string, lastAccessedTime *timestamppb.Timestamp) error

UpdateUserSessionLastAccessed updates the last accessed time of a session.

func (*Store) UpdateUserWebhook added in v0.25.0

func (s *Store) UpdateUserWebhook(ctx context.Context, userID int32, webhook *storepb.WebhooksUserSetting_Webhook) error

UpdateUserWebhook updates an existing webhook for the user.

func (*Store) UpsertInstanceSetting added in v0.25.3

func (s *Store) UpsertInstanceSetting(ctx context.Context, upsert *storepb.InstanceSetting) (*storepb.InstanceSetting, error)

func (*Store) UpsertMemoRelation added in v0.13.0

func (s *Store) UpsertMemoRelation(ctx context.Context, create *MemoRelation) (*MemoRelation, error)

func (*Store) UpsertReaction added in v0.20.0

func (s *Store) UpsertReaction(ctx context.Context, upsert *Reaction) (*Reaction, error)

func (*Store) UpsertUserSetting added in v0.4.0

func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)

type UpdateAttachment added in v0.25.0

type UpdateAttachment struct {
	ID        int32
	UID       *string
	UpdatedTs *int64
	Filename  *string
	MemoID    *int32
	Reference *string
	Payload   *storepb.AttachmentPayload
}

type UpdateIdentityProvider added in v0.13.2

type UpdateIdentityProvider struct {
	ID               int32
	Name             *string
	IdentifierFilter *string
	Config           *string
}

type UpdateIdentityProviderV1 added in v0.21.1

type UpdateIdentityProviderV1 struct {
	ID               int32
	Type             storepb.IdentityProvider_Type
	Name             *string
	IdentifierFilter *string
	Config           *storepb.IdentityProviderConfig
}

type UpdateInbox added in v0.17.0

type UpdateInbox struct {
	ID     int32
	Status InboxStatus
}

UpdateInbox contains fields that can be updated for an inbox item.

type UpdateMemo added in v0.14.0

type UpdateMemo struct {
	ID         int32
	UID        *string
	CreatedTs  *int64
	UpdatedTs  *int64
	RowStatus  *RowStatus
	Content    *string
	Visibility *Visibility
	Pinned     *bool
	Payload    *storepb.MemoPayload
}

type UpdateUser added in v0.14.0

type UpdateUser struct {
	ID int32

	UpdatedTs    *int64
	RowStatus    *RowStatus
	Username     *string
	Role         *Role
	Email        *string
	Nickname     *string
	Password     *string
	AvatarURL    *string
	PasswordHash *string
	Description  *string
}

type UpsertMigrationHistory added in v0.17.1

type UpsertMigrationHistory struct {
	Version string
}

UpsertMigrationHistory is used to insert or update a migration history record. NOTE: This is deprecated along with the migration_history table.

type User added in v0.14.0

type User struct {
	ID int32

	// Standard fields
	RowStatus RowStatus
	CreatedTs int64
	UpdatedTs int64

	// Domain specific fields
	Username     string
	Role         Role
	Email        string
	Nickname     string
	PasswordHash string
	AvatarURL    string
	Description  string
}

type UserSetting added in v0.13.2

type UserSetting struct {
	UserID int32
	Key    storepb.UserSetting_Key
	Value  string
}

type Visibility added in v0.13.1

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 added in v0.13.1

func (v Visibility) String() string

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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