Documentation
¶
Index ¶
- Constants
- Variables
- type Attachment
- type DeleteAttachment
- type DeleteIdentityProvider
- type DeleteInbox
- type DeleteInstanceSetting
- type DeleteMemo
- type DeleteMemoRelation
- type DeleteMemoShare
- type DeleteReaction
- type DeleteUser
- type Driver
- type FindAttachment
- type FindIdentityProvider
- type FindInbox
- type FindInstanceSetting
- type FindMemo
- type FindMemoPayload
- type FindMemoRelation
- type FindMemoShare
- type FindReaction
- type FindUser
- type FindUserSetting
- type IdentityProvider
- type Inbox
- type InboxStatus
- type InstanceSetting
- type Memo
- type MemoRelation
- type MemoRelationType
- type MemoShare
- type PATQueryResult
- type Reaction
- type RefreshTokenQueryResult
- type Role
- type RowStatus
- type Store
- func (s *Store) AddUserPersonalAccessToken(ctx context.Context, userID int32, ...) error
- func (s *Store) AddUserRefreshToken(ctx context.Context, userID int32, ...) error
- func (s *Store) AddUserWebhook(ctx context.Context, userID int32, ...) error
- func (s *Store) Close() error
- func (s *Store) CreateAttachment(ctx context.Context, create *Attachment) (*Attachment, error)
- func (s *Store) CreateIdentityProvider(ctx context.Context, create *storepb.IdentityProvider) (*storepb.IdentityProvider, error)
- func (s *Store) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
- func (s *Store) CreateMemo(ctx context.Context, create *Memo) (*Memo, error)
- func (s *Store) CreateMemoShare(ctx context.Context, create *MemoShare) (*MemoShare, error)
- func (s *Store) CreateUser(ctx context.Context, create *User) (*User, error)
- func (s *Store) DeleteAttachment(ctx context.Context, delete *DeleteAttachment) error
- func (s *Store) DeleteAttachmentStorage(ctx context.Context, attachment *Attachment) error
- func (s *Store) DeleteAttachments(ctx context.Context, attachments []*Attachment) error
- func (s *Store) DeleteIdentityProvider(ctx context.Context, delete *DeleteIdentityProvider) error
- func (s *Store) DeleteInbox(ctx context.Context, delete *DeleteInbox) error
- func (s *Store) DeleteMemo(ctx context.Context, delete *DeleteMemo) error
- func (s *Store) DeleteMemoRelation(ctx context.Context, delete *DeleteMemoRelation) error
- func (s *Store) DeleteMemoShare(ctx context.Context, delete *DeleteMemoShare) error
- func (s *Store) DeleteReaction(ctx context.Context, delete *DeleteReaction) error
- func (s *Store) DeleteUser(ctx context.Context, delete *DeleteUser) error
- func (s *Store) GetAttachment(ctx context.Context, find *FindAttachment) (*Attachment, error)
- func (s *Store) GetCurrentSchemaVersion() (string, error)
- func (s *Store) GetDriver() Driver
- func (s *Store) GetIdentityProvider(ctx context.Context, find *FindIdentityProvider) (*storepb.IdentityProvider, error)
- func (s *Store) GetInstanceAISetting(ctx context.Context) (*storepb.InstanceAISetting, error)
- func (s *Store) GetInstanceBasicSetting(ctx context.Context) (*storepb.InstanceBasicSetting, error)
- func (s *Store) GetInstanceGeneralSetting(ctx context.Context) (*storepb.InstanceGeneralSetting, error)
- func (s *Store) GetInstanceMemoRelatedSetting(ctx context.Context) (*storepb.InstanceMemoRelatedSetting, error)
- func (s *Store) GetInstanceNotificationSetting(ctx context.Context) (*storepb.InstanceNotificationSetting, error)
- func (s *Store) GetInstanceSetting(ctx context.Context, find *FindInstanceSetting) (*storepb.InstanceSetting, error)
- func (s *Store) GetInstanceStorageSetting(ctx context.Context) (*storepb.InstanceStorageSetting, error)
- func (s *Store) GetInstanceTagsSetting(ctx context.Context) (*storepb.InstanceTagsSetting, error)
- func (s *Store) GetMemo(ctx context.Context, find *FindMemo) (*Memo, error)
- func (s *Store) GetMemoShare(ctx context.Context, find *FindMemoShare) (*MemoShare, error)
- func (s *Store) GetReaction(ctx context.Context, find *FindReaction) (*Reaction, error)
- func (s *Store) GetUser(ctx context.Context, find *FindUser) (*User, error)
- func (s *Store) GetUserByPATHash(ctx context.Context, tokenHash string) (*PATQueryResult, error)
- func (s *Store) GetUserPersonalAccessTokens(ctx context.Context, userID int32) ([]*storepb.PersonalAccessTokensUserSetting_PersonalAccessToken, error)
- func (s *Store) GetUserRefreshTokenByID(ctx context.Context, userID int32, tokenID string) (*storepb.RefreshTokensUserSetting_RefreshToken, error)
- func (s *Store) GetUserRefreshTokens(ctx context.Context, userID int32) ([]*storepb.RefreshTokensUserSetting_RefreshToken, error)
- func (s *Store) GetUserSetting(ctx context.Context, find *FindUserSetting) (*storepb.UserSetting, error)
- func (s *Store) GetUserWebhooks(ctx context.Context, userID int32) ([]*storepb.WebhooksUserSetting_Webhook, error)
- func (s *Store) ListAttachments(ctx context.Context, find *FindAttachment) ([]*Attachment, error)
- func (s *Store) ListIdentityProviders(ctx context.Context, find *FindIdentityProvider) ([]*storepb.IdentityProvider, error)
- func (s *Store) ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error)
- func (s *Store) ListInstanceSettings(ctx context.Context, find *FindInstanceSetting) ([]*storepb.InstanceSetting, error)
- func (s *Store) ListMemoRelations(ctx context.Context, find *FindMemoRelation) ([]*MemoRelation, error)
- func (s *Store) ListMemoShares(ctx context.Context, find *FindMemoShare) ([]*MemoShare, error)
- func (s *Store) ListMemos(ctx context.Context, find *FindMemo) ([]*Memo, error)
- func (s *Store) ListReactions(ctx context.Context, find *FindReaction) ([]*Reaction, error)
- func (s *Store) ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*storepb.UserSetting, error)
- func (s *Store) ListUsers(ctx context.Context, find *FindUser) ([]*User, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) RemoveUserPersonalAccessToken(ctx context.Context, userID int32, tokenID string) error
- func (s *Store) RemoveUserRefreshToken(ctx context.Context, userID int32, tokenID string) error
- func (s *Store) RemoveUserWebhook(ctx context.Context, userID int32, webhookID string) error
- func (s *Store) UpdateAttachment(ctx context.Context, update *UpdateAttachment) error
- func (s *Store) UpdateIdentityProvider(ctx context.Context, update *UpdateIdentityProviderV1) (*storepb.IdentityProvider, error)
- func (s *Store) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error)
- func (s *Store) UpdateMemo(ctx context.Context, update *UpdateMemo) error
- func (s *Store) UpdatePATLastUsed(ctx context.Context, userID int32, tokenID string, ...) error
- func (s *Store) UpdateUser(ctx context.Context, update *UpdateUser) (*User, error)
- func (s *Store) UpdateUserWebhook(ctx context.Context, userID int32, ...) error
- func (s *Store) UpsertInstanceSetting(ctx context.Context, upsert *storepb.InstanceSetting) (*storepb.InstanceSetting, error)
- func (s *Store) UpsertMemoRelation(ctx context.Context, create *MemoRelation) (*MemoRelation, error)
- func (s *Store) UpsertReaction(ctx context.Context, upsert *Reaction) (*Reaction, error)
- func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)
- type UpdateAttachment
- type UpdateIdentityProvider
- type UpdateIdentityProviderV1
- type UpdateInbox
- type UpdateMemo
- type UpdateUser
- type User
- type UserSetting
- type Visibility
Constants ¶
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 initialize fresh installations with the current schema. LatestSchemaFileName = "LATEST.sql" )
const DefaultContentLengthLimit = 8 * 1024
DefaultContentLengthLimit is the default limit of content length in bytes. 8KB.
Variables ¶
var DefaultReactions = []string{"👍", "👎", "❤️", "🎉", "😄", "😕", "😢", "😡"}
DefaultReactions is the default reactions for memo related setting.
Functions ¶
This section is empty.
Types ¶
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 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 DeleteMemoShare ¶ added in v0.27.0
type DeleteMemoShare struct {
}
DeleteMemoShare identifies a share grant to remove.
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)
// 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
DeleteAttachments(ctx context.Context, deletes []*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)
GetUserByPATHash(ctx context.Context, tokenHash string) (*PATQueryResult, 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
// MemoShare model related methods.
}
Driver is an interface for store driver. It contains all methods that store database driver should implement.
type FindAttachment ¶ added in v0.25.0
type FindIdentityProvider ¶ added in v0.13.2
type FindInbox ¶ added in v0.17.0
type FindInbox struct {
ID *int32
SenderID *int32
ReceiverID *int32
Status *InboxStatus
MessageType *storepb.InboxMessage_Type
// 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 FindMemoRelation ¶ added in v0.14.0
type FindMemoShare ¶ added in v0.27.0
type FindMemoShare struct {
}
FindMemoShare is used to filter memo shares in list/get queries.
type FindReaction ¶ added in v0.20.0
type FindUserSetting ¶ added in v0.13.2
type FindUserSetting struct {
UserID *int32
Key storepb.UserSetting_Key
}
type IdentityProvider ¶ added in v0.13.2
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.
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 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 MemoShare ¶ added in v0.27.0
type MemoShare struct {
}
MemoShare is an access grant that permits read-only access to a memo via a bearer token.
type PATQueryResult ¶ added in v0.26.0
type PATQueryResult struct {
UserID int32
User *User
PAT *storepb.PersonalAccessTokensUserSetting_PersonalAccessToken
}
PATQueryResult contains the result of querying a PAT by hash.
type RefreshTokenQueryResult ¶ added in v0.26.0
type RefreshTokenQueryResult struct {
UserID int32
RefreshToken *storepb.RefreshTokensUserSetting_RefreshToken
}
RefreshTokenQueryResult contains the result of querying a refresh token.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides database access to all raw objects.
func (*Store) AddUserPersonalAccessToken ¶ added in v0.26.0
func (s *Store) AddUserPersonalAccessToken(ctx context.Context, userID int32, token *storepb.PersonalAccessTokensUserSetting_PersonalAccessToken) error
AddUserPersonalAccessToken adds a new PAT for the user.
func (*Store) AddUserRefreshToken ¶ added in v0.26.0
func (s *Store) AddUserRefreshToken(ctx context.Context, userID int32, token *storepb.RefreshTokensUserSetting_RefreshToken) error
AddUserRefreshToken adds a new refresh token 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) 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
CreateInbox creates a new inbox notification.
func (*Store) CreateMemo ¶
func (*Store) CreateMemoShare ¶ added in v0.27.0
CreateMemoShare creates a new share grant.
func (*Store) CreateUser ¶
func (*Store) DeleteAttachment ¶ added in v0.25.0
func (s *Store) DeleteAttachment(ctx context.Context, delete *DeleteAttachment) error
func (*Store) DeleteAttachmentStorage ¶ added in v0.27.0
func (s *Store) DeleteAttachmentStorage(ctx context.Context, attachment *Attachment) error
func (*Store) DeleteAttachments ¶ added in v0.27.0
func (s *Store) DeleteAttachments(ctx context.Context, attachments []*Attachment) 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) DeleteMemoShare ¶ added in v0.27.0
func (s *Store) DeleteMemoShare(ctx context.Context, delete *DeleteMemoShare) error
DeleteMemoShare removes a share grant.
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) 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 (*Store) GetIdentityProvider ¶ added in v0.11.0
func (s *Store) GetIdentityProvider(ctx context.Context, find *FindIdentityProvider) (*storepb.IdentityProvider, error)
func (*Store) GetInstanceAISetting ¶ added in v0.27.0
GetInstanceAISetting gets the AI provider settings for the instance.
func (*Store) GetInstanceBasicSetting ¶ added in v0.25.3
func (*Store) GetInstanceGeneralSetting ¶ added in v0.25.3
func (*Store) GetInstanceMemoRelatedSetting ¶ added in v0.25.3
func (*Store) GetInstanceNotificationSetting ¶ added in v0.27.0
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 (*Store) GetInstanceTagsSetting ¶ added in v0.27.0
func (*Store) GetMemoShare ¶ added in v0.27.0
GetMemoShare returns the first share grant matching the filter, or nil if none found.
func (*Store) GetReaction ¶ added in v0.25.3
func (*Store) GetUserByPATHash ¶ added in v0.26.0
GetUserByPATHash finds a user by PAT hash.
func (*Store) GetUserPersonalAccessTokens ¶ added in v0.26.0
func (s *Store) GetUserPersonalAccessTokens(ctx context.Context, userID int32) ([]*storepb.PersonalAccessTokensUserSetting_PersonalAccessToken, error)
GetUserPersonalAccessTokens returns the PATs of the user.
func (*Store) GetUserRefreshTokenByID ¶ added in v0.26.0
func (s *Store) GetUserRefreshTokenByID(ctx context.Context, userID int32, tokenID string) (*storepb.RefreshTokensUserSetting_RefreshToken, error)
GetUserRefreshTokenByID returns a specific refresh token.
func (*Store) GetUserRefreshTokens ¶ added in v0.26.0
func (s *Store) GetUserRefreshTokens(ctx context.Context, userID int32) ([]*storepb.RefreshTokensUserSetting_RefreshToken, error)
GetUserRefreshTokens returns the refresh tokens 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) 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
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) ListMemoShares ¶ added in v0.27.0
ListMemoShares returns all share grants matching the filter.
func (*Store) ListReactions ¶ added in v0.20.0
func (*Store) ListUserSettings ¶ added in v0.13.2
func (s *Store) ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*storepb.UserSetting, error)
func (*Store) Migrate ¶ added in v0.22.5
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) RemoveUserPersonalAccessToken ¶ added in v0.26.0
func (s *Store) RemoveUserPersonalAccessToken(ctx context.Context, userID int32, tokenID string) error
RemoveUserPersonalAccessToken removes a PAT from the user.
func (*Store) RemoveUserRefreshToken ¶ added in v0.26.0
RemoveUserRefreshToken removes a refresh token from the user.
func (*Store) RemoveUserWebhook ¶ added in v0.25.0
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
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) UpdatePATLastUsed ¶ added in v0.26.0
func (s *Store) UpdatePATLastUsed(ctx context.Context, userID int32, tokenID string, lastUsed *timestamppb.Timestamp) error
UpdatePATLastUsed updates the last_used_at timestamp of a PAT.
func (*Store) UpdateUser ¶ added in v0.14.0
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 (*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 UpdateIdentityProvider ¶ added in v0.13.2
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 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