Documentation ¶
Index ¶
- func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus
- type Activity
- type ActivityLevel
- type ActivityType
- type DeleteCollection
- type DeleteMemo
- type DeleteShortcut
- type DeleteUser
- type Driver
- type FindActivity
- type FindCollection
- type FindMemo
- type FindMigrationHistory
- type FindShortcut
- type FindUser
- type FindUserSetting
- type FindWorkspaceSetting
- type MigrationHistory
- type Role
- type RowStatus
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity, error)
- func (s *Store) CreateCollection(ctx context.Context, create *storepb.Collection) (*storepb.Collection, error)
- func (s *Store) CreateMemo(ctx context.Context, create *storepb.Memo) (*storepb.Memo, error)
- func (s *Store) CreateShortcut(ctx context.Context, create *storepb.Shortcut) (*storepb.Shortcut, error)
- func (s *Store) CreateUser(ctx context.Context, create *User) (*User, error)
- func (s *Store) DeleteCollection(ctx context.Context, delete *DeleteCollection) error
- func (s *Store) DeleteMemo(ctx context.Context, delete *DeleteMemo) error
- func (s *Store) DeleteShortcut(ctx context.Context, delete *DeleteShortcut) error
- func (s *Store) DeleteUser(ctx context.Context, delete *DeleteUser) error
- func (s *Store) GetActivity(ctx context.Context, find *FindActivity) (*Activity, error)
- func (s *Store) GetCollection(ctx context.Context, find *FindCollection) (*storepb.Collection, error)
- func (s *Store) GetMemo(ctx context.Context, find *FindMemo) (*storepb.Memo, error)
- func (s *Store) GetShortcut(ctx context.Context, find *FindShortcut) (*storepb.Shortcut, error)
- func (s *Store) GetUser(ctx context.Context, find *FindUser) (*User, error)
- func (s *Store) GetUserAccessTokens(ctx context.Context, userID int32) ([]*storepb.AccessTokensUserSetting_AccessToken, error)
- func (s *Store) GetUserSetting(ctx context.Context, find *FindUserSetting) (*storepb.UserSetting, error)
- func (s *Store) GetWorkspaceSetting(ctx context.Context, find *FindWorkspaceSetting) (*storepb.WorkspaceSetting, error)
- func (s *Store) ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error)
- func (s *Store) ListCollections(ctx context.Context, find *FindCollection) ([]*storepb.Collection, error)
- func (s *Store) ListMemos(ctx context.Context, find *FindMemo) ([]*storepb.Memo, error)
- func (s *Store) ListShortcuts(ctx context.Context, find *FindShortcut) ([]*storepb.Shortcut, 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) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSetting) ([]*storepb.WorkspaceSetting, error)
- func (s *Store) UpdateCollection(ctx context.Context, update *UpdateCollection) (*storepb.Collection, error)
- func (s *Store) UpdateMemo(ctx context.Context, update *UpdateMemo) (*storepb.Memo, error)
- func (s *Store) UpdateShortcut(ctx context.Context, update *UpdateShortcut) (*storepb.Shortcut, error)
- func (s *Store) UpdateUser(ctx context.Context, update *UpdateUser) (*User, error)
- func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)
- func (s *Store) UpsertWorkspaceSetting(ctx context.Context, upsert *storepb.WorkspaceSetting) (*storepb.WorkspaceSetting, error)
- type UpdateCollection
- type UpdateMemo
- type UpdateShortcut
- type UpdateUser
- type UpsertMigrationHistory
- type User
- type Visibility
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Activity ¶
type Activity struct { ID int32 CreatorID int32 CreatedTs int64 Type ActivityType Level ActivityLevel Payload string }
type ActivityLevel ¶
type ActivityLevel string
const ( // ActivityInfo is the activity level of info. ActivityInfo ActivityLevel = "INFO" // ActivityWarn is the activity level of warn. ActivityWarn ActivityLevel = "WARN" // ActivityError is the activity level of error. ActivityError ActivityLevel = "ERROR" )
func (ActivityLevel) String ¶
func (l ActivityLevel) String() string
type ActivityType ¶
type ActivityType string
const ( // ActivityShortcutView is the activity type of shortcut create. ActivityShortcutCreate ActivityType = "shortcut.create" // ActivityShortcutView is the activity type of shortcut view. ActivityShortcutView ActivityType = "shortcut.view" )
func (ActivityType) String ¶
func (t ActivityType) String() string
type DeleteCollection ¶
type DeleteCollection struct {
ID int32
}
type DeleteMemo ¶
type DeleteMemo struct {
ID int32
}
type DeleteShortcut ¶
type DeleteShortcut struct {
ID int32
}
type DeleteUser ¶
type DeleteUser struct {
ID int32
}
type Driver ¶
type Driver interface { GetDB() *sql.DB Close() error Migrate(ctx context.Context) error // MigrationHistory model related methods. UpsertMigrationHistory(ctx context.Context, upsert *UpsertMigrationHistory) (*MigrationHistory, error) ListMigrationHistories(ctx context.Context, find *FindMigrationHistory) ([]*MigrationHistory, error) // Activity model related methods. CreateActivity(ctx context.Context, create *Activity) (*Activity, error) ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error) // Collection model related methods. CreateCollection(ctx context.Context, create *storepb.Collection) (*storepb.Collection, error) UpdateCollection(ctx context.Context, update *UpdateCollection) (*storepb.Collection, error) ListCollections(ctx context.Context, find *FindCollection) ([]*storepb.Collection, error) DeleteCollection(ctx context.Context, delete *DeleteCollection) error // Memo model related methods. CreateMemo(ctx context.Context, create *storepb.Memo) (*storepb.Memo, error) UpdateMemo(ctx context.Context, update *UpdateMemo) (*storepb.Memo, error) ListMemos(ctx context.Context, find *FindMemo) ([]*storepb.Memo, error) DeleteMemo(ctx context.Context, delete *DeleteMemo) error // Shortcut model related methods. CreateShortcut(ctx context.Context, create *storepb.Shortcut) (*storepb.Shortcut, error) UpdateShortcut(ctx context.Context, update *UpdateShortcut) (*storepb.Shortcut, error) ListShortcuts(ctx context.Context, find *FindShortcut) ([]*storepb.Shortcut, error) DeleteShortcut(ctx context.Context, delete *DeleteShortcut) 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 *storepb.UserSetting) (*storepb.UserSetting, error) ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*storepb.UserSetting, error) // WorkspaceSetting model related methods. UpsertWorkspaceSetting(ctx context.Context, upsert *storepb.WorkspaceSetting) (*storepb.WorkspaceSetting, error) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSetting) ([]*storepb.WorkspaceSetting, error) }
Driver is an interface for store driver. It contains all methods that store database driver should implement.
type FindActivity ¶
type FindActivity struct { Type ActivityType Level ActivityLevel PayloadShortcutID *int32 }
type FindCollection ¶
type FindCollection struct { ID *int32 CreatorID *int32 Name *string VisibilityList []Visibility }
type FindMigrationHistory ¶
type FindMigrationHistory struct { }
type FindShortcut ¶
type FindUserSetting ¶
type FindUserSetting struct { UserID *int32 Key storepb.UserSettingKey }
type FindWorkspaceSetting ¶
type FindWorkspaceSetting struct {
Key storepb.WorkspaceSettingKey
}
type MigrationHistory ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides database access to all raw objects.
func (*Store) CreateActivity ¶
func (*Store) CreateCollection ¶
func (s *Store) CreateCollection(ctx context.Context, create *storepb.Collection) (*storepb.Collection, error)
func (*Store) CreateMemo ¶
func (*Store) CreateShortcut ¶
func (*Store) CreateUser ¶
func (*Store) DeleteCollection ¶
func (s *Store) DeleteCollection(ctx context.Context, delete *DeleteCollection) error
func (*Store) DeleteMemo ¶
func (s *Store) DeleteMemo(ctx context.Context, delete *DeleteMemo) error
func (*Store) DeleteShortcut ¶
func (s *Store) DeleteShortcut(ctx context.Context, delete *DeleteShortcut) error
func (*Store) DeleteUser ¶
func (s *Store) DeleteUser(ctx context.Context, delete *DeleteUser) error
func (*Store) GetActivity ¶
func (*Store) GetCollection ¶
func (s *Store) GetCollection(ctx context.Context, find *FindCollection) (*storepb.Collection, error)
func (*Store) GetShortcut ¶
func (*Store) GetUserAccessTokens ¶
func (s *Store) GetUserAccessTokens(ctx context.Context, userID int32) ([]*storepb.AccessTokensUserSetting_AccessToken, error)
GetUserAccessTokens returns the access tokens of the user.
func (*Store) GetUserSetting ¶
func (s *Store) GetUserSetting(ctx context.Context, find *FindUserSetting) (*storepb.UserSetting, error)
func (*Store) GetWorkspaceSetting ¶
func (s *Store) GetWorkspaceSetting(ctx context.Context, find *FindWorkspaceSetting) (*storepb.WorkspaceSetting, error)
func (*Store) ListActivities ¶
func (*Store) ListCollections ¶
func (s *Store) ListCollections(ctx context.Context, find *FindCollection) ([]*storepb.Collection, error)
func (*Store) ListShortcuts ¶
func (*Store) ListUserSettings ¶
func (s *Store) ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*storepb.UserSetting, error)
func (*Store) ListWorkspaceSettings ¶
func (s *Store) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSetting) ([]*storepb.WorkspaceSetting, error)
func (*Store) UpdateCollection ¶
func (s *Store) UpdateCollection(ctx context.Context, update *UpdateCollection) (*storepb.Collection, error)
func (*Store) UpdateMemo ¶
func (*Store) UpdateShortcut ¶
func (*Store) UpdateUser ¶
func (*Store) UpsertUserSetting ¶
func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)
func (*Store) UpsertWorkspaceSetting ¶
func (s *Store) UpsertWorkspaceSetting(ctx context.Context, upsert *storepb.WorkspaceSetting) (*storepb.WorkspaceSetting, error)
type UpdateCollection ¶
type UpdateMemo ¶
type UpdateShortcut ¶
type UpdateShortcut struct { ID int32 RowStatus *RowStatus Name *string Link *string Title *string Description *string Visibility *Visibility Tag *string OpenGraphMetadata *storepb.OpenGraphMetadata }
type UpdateUser ¶
type UpsertMigrationHistory ¶
type UpsertMigrationHistory struct {
Version string
}
type Visibility ¶
type Visibility string
Visibility is the type of a visibility.
const ( // VisibilityPublic is the PUBLIC visibility. VisibilityPublic Visibility = "PUBLIC" // VisibilityWorkspace is the WORKSPACE visibility. VisibilityWorkspace Visibility = "WORKSPACE" // VisibilityPrivate is the PRIVATE visibility. VisibilityPrivate Visibility = "PRIVATE" )
func (Visibility) String ¶
func (e Visibility) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.