2023-09-26 12:16:58 +03:00
|
|
|
package store
|
|
|
|
|
2023-09-26 14:02:48 +03:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
storepb "github.com/usememos/memos/proto/gen/store"
|
|
|
|
)
|
2023-09-26 12:16:58 +03:00
|
|
|
|
|
|
|
type Driver interface {
|
|
|
|
CreateActivity(ctx context.Context, create *Activity) (*Activity, error)
|
|
|
|
|
2023-09-26 14:04:07 +03:00
|
|
|
CreateResource(ctx context.Context, create *Resource) (*Resource, error)
|
|
|
|
ListResources(ctx context.Context, find *FindResource) ([]*Resource, error)
|
|
|
|
UpdateResource(ctx context.Context, update *UpdateResource) (*Resource, error)
|
|
|
|
DeleteResource(ctx context.Context, delete *DeleteResource) error
|
|
|
|
|
2023-09-26 12:16:58 +03:00
|
|
|
UpsertSystemSetting(ctx context.Context, upsert *SystemSetting) (*SystemSetting, error)
|
|
|
|
ListSystemSettings(ctx context.Context, find *FindSystemSetting) ([]*SystemSetting, error)
|
2023-09-26 13:23:45 +03:00
|
|
|
|
|
|
|
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
|
2023-09-26 14:02:48 +03:00
|
|
|
|
|
|
|
UpsertUserSetting(ctx context.Context, upsert *UserSetting) (*UserSetting, error)
|
|
|
|
ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*UserSetting, error)
|
|
|
|
UpsertUserSettingV1(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)
|
|
|
|
ListUserSettingsV1(ctx context.Context, find *FindUserSettingV1) ([]*storepb.UserSetting, error)
|
2023-09-26 14:17:17 +03:00
|
|
|
|
|
|
|
CreateIdentityProvider(ctx context.Context, create *IdentityProvider) (*IdentityProvider, error)
|
|
|
|
ListIdentityProviders(ctx context.Context, find *FindIdentityProvider) ([]*IdentityProvider, error)
|
|
|
|
GetIdentityProvider(ctx context.Context, find *FindIdentityProvider) (*IdentityProvider, error)
|
|
|
|
UpdateIdentityProvider(ctx context.Context, update *UpdateIdentityProvider) (*IdentityProvider, error)
|
|
|
|
DeleteIdentityProvider(ctx context.Context, delete *DeleteIdentityProvider) error
|
2023-09-26 12:16:58 +03:00
|
|
|
}
|