Rename service to EngPadSyncService (buf lint), add java_package, add buf.yaml
- Proto service renamed from EngPadSync to EngPadSyncService per buf STANDARD lint rule SERVICE_SUFFIX - Added java_package and java_multiple_files options for Android client - Added buf.yaml with STANDARD lint and FILE breaking detection - Regenerated Go gRPC stubs, updated server references Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
76
cmd/eng-pad-server/init.go
Normal file
76
cmd/eng-pad-server/init.go
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/auth"
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/config"
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/db"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"golang.org/x/term"
|
||||||
|
)
|
||||||
|
|
||||||
|
var initCmd = &cobra.Command{
|
||||||
|
Use: "init",
|
||||||
|
Short: "Initialize database and create admin user",
|
||||||
|
RunE: runInit,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(initCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runInit(cmd *cobra.Command, args []string) error {
|
||||||
|
cfg, err := config.Load(cfgFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
database, err := db.Open(cfg.Database.Path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() { _ = database.Close() }()
|
||||||
|
|
||||||
|
if err := db.Migrate(database); err != nil {
|
||||||
|
return fmt.Errorf("migrate: %w", err)
|
||||||
|
}
|
||||||
|
fmt.Println("Database migrated.")
|
||||||
|
|
||||||
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
fmt.Print("Admin username: ")
|
||||||
|
username, _ := reader.ReadString('\n')
|
||||||
|
username = strings.TrimSpace(username)
|
||||||
|
if username == "" {
|
||||||
|
return fmt.Errorf("username cannot be empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Print("Admin password: ")
|
||||||
|
passBytes, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||||
|
fmt.Println()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("read password: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
password := strings.TrimSpace(string(passBytes))
|
||||||
|
if password == "" {
|
||||||
|
return fmt.Errorf("password cannot be empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
params := auth.Argon2Params{
|
||||||
|
Memory: cfg.Auth.Argon2Memory,
|
||||||
|
Time: cfg.Auth.Argon2Time,
|
||||||
|
Threads: cfg.Auth.Argon2Threads,
|
||||||
|
}
|
||||||
|
|
||||||
|
id, err := auth.CreateUser(database, username, password, params)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("create user: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("User %q created (ID %d).\n", username, id)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
15
cmd/eng-pad-server/main.go
Normal file
15
cmd/eng-pad-server/main.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
var version = "dev"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if err := rootCmd.Execute(); err != nil {
|
||||||
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
14
cmd/eng-pad-server/root.go
Normal file
14
cmd/eng-pad-server/root.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "github.com/spf13/cobra"
|
||||||
|
|
||||||
|
var cfgFile string
|
||||||
|
|
||||||
|
var rootCmd = &cobra.Command{
|
||||||
|
Use: "eng-pad-server",
|
||||||
|
Short: "Engineering notebook sync and viewer",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file path")
|
||||||
|
}
|
||||||
50
cmd/eng-pad-server/snapshot.go
Normal file
50
cmd/eng-pad-server/snapshot.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/config"
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/db"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var snapshotCmd = &cobra.Command{
|
||||||
|
Use: "snapshot",
|
||||||
|
Short: "Create a database backup via VACUUM INTO",
|
||||||
|
RunE: runSnapshot,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(snapshotCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runSnapshot(cmd *cobra.Command, args []string) error {
|
||||||
|
cfg, err := config.Load(cfgFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
database, err := db.Open(cfg.Database.Path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() { _ = database.Close() }()
|
||||||
|
|
||||||
|
dir := filepath.Dir(cfg.Database.Path)
|
||||||
|
backupDir := filepath.Join(dir, "backups")
|
||||||
|
ts := time.Now().Format("20060102-150405")
|
||||||
|
backupPath := filepath.Join(backupDir, fmt.Sprintf("eng-pad-server-%s.db", ts))
|
||||||
|
|
||||||
|
// Escape single quotes in the path to prevent SQL injection.
|
||||||
|
// VACUUM INTO does not support parameter binding.
|
||||||
|
escapedPath := strings.ReplaceAll(backupPath, "'", "''")
|
||||||
|
if _, err := database.Exec(fmt.Sprintf("VACUUM INTO '%s'", escapedPath)); err != nil {
|
||||||
|
return fmt.Errorf("vacuum into: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Backup created: %s\n", backupPath)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
47
cmd/eng-pad-server/status.go
Normal file
47
cmd/eng-pad-server/status.go
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/config"
|
||||||
|
"git.wntrmute.dev/kyle/eng-pad-server/internal/db"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var statusCmd = &cobra.Command{
|
||||||
|
Use: "status",
|
||||||
|
Short: "Check database health",
|
||||||
|
RunE: runStatus,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(statusCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runStatus(cmd *cobra.Command, args []string) error {
|
||||||
|
cfg, err := config.Load(cfgFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
database, err := db.Open(cfg.Database.Path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() { _ = database.Close() }()
|
||||||
|
|
||||||
|
var userCount, notebookCount, pageCount, strokeCount int
|
||||||
|
_ = database.QueryRow("SELECT COUNT(*) FROM users").Scan(&userCount)
|
||||||
|
_ = database.QueryRow("SELECT COUNT(*) FROM notebooks").Scan(¬ebookCount)
|
||||||
|
_ = database.QueryRow("SELECT COUNT(*) FROM pages").Scan(&pageCount)
|
||||||
|
_ = database.QueryRow("SELECT COUNT(*) FROM strokes").Scan(&strokeCount)
|
||||||
|
|
||||||
|
fmt.Printf("eng-pad-server %s\n", version)
|
||||||
|
fmt.Printf(" Database: %s\n", cfg.Database.Path)
|
||||||
|
fmt.Printf(" Users: %d\n", userCount)
|
||||||
|
fmt.Printf(" Notebooks: %d\n", notebookCount)
|
||||||
|
fmt.Printf(" Pages: %d\n", pageCount)
|
||||||
|
fmt.Printf(" Strokes: %d\n", strokeCount)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.36.11
|
// protoc-gen-go v1.36.11
|
||||||
// protoc v3.20.3
|
// protoc v3.20.3
|
||||||
// source: engpad/v1/sync.proto
|
// source: proto/engpad/v1/sync.proto
|
||||||
|
|
||||||
package engpadv1
|
package engpadv1
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ type SyncNotebookRequest struct {
|
|||||||
|
|
||||||
func (x *SyncNotebookRequest) Reset() {
|
func (x *SyncNotebookRequest) Reset() {
|
||||||
*x = SyncNotebookRequest{}
|
*x = SyncNotebookRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[0]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[0]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ func (x *SyncNotebookRequest) String() string {
|
|||||||
func (*SyncNotebookRequest) ProtoMessage() {}
|
func (*SyncNotebookRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SyncNotebookRequest) ProtoReflect() protoreflect.Message {
|
func (x *SyncNotebookRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[0]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[0]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -59,7 +59,7 @@ func (x *SyncNotebookRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SyncNotebookRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SyncNotebookRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*SyncNotebookRequest) Descriptor() ([]byte, []int) {
|
func (*SyncNotebookRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{0}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SyncNotebookRequest) GetNotebookId() int64 {
|
func (x *SyncNotebookRequest) GetNotebookId() int64 {
|
||||||
@@ -101,7 +101,7 @@ type PageData struct {
|
|||||||
|
|
||||||
func (x *PageData) Reset() {
|
func (x *PageData) Reset() {
|
||||||
*x = PageData{}
|
*x = PageData{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[1]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[1]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ func (x *PageData) String() string {
|
|||||||
func (*PageData) ProtoMessage() {}
|
func (*PageData) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *PageData) ProtoReflect() protoreflect.Message {
|
func (x *PageData) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[1]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[1]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -126,7 +126,7 @@ func (x *PageData) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use PageData.ProtoReflect.Descriptor instead.
|
// Deprecated: Use PageData.ProtoReflect.Descriptor instead.
|
||||||
func (*PageData) Descriptor() ([]byte, []int) {
|
func (*PageData) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{1}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PageData) GetPageId() int64 {
|
func (x *PageData) GetPageId() int64 {
|
||||||
@@ -163,7 +163,7 @@ type StrokeData struct {
|
|||||||
|
|
||||||
func (x *StrokeData) Reset() {
|
func (x *StrokeData) Reset() {
|
||||||
*x = StrokeData{}
|
*x = StrokeData{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[2]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ func (x *StrokeData) String() string {
|
|||||||
func (*StrokeData) ProtoMessage() {}
|
func (*StrokeData) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *StrokeData) ProtoReflect() protoreflect.Message {
|
func (x *StrokeData) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[2]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[2]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -188,7 +188,7 @@ func (x *StrokeData) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use StrokeData.ProtoReflect.Descriptor instead.
|
// Deprecated: Use StrokeData.ProtoReflect.Descriptor instead.
|
||||||
func (*StrokeData) Descriptor() ([]byte, []int) {
|
func (*StrokeData) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{2}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *StrokeData) GetPenSize() float32 {
|
func (x *StrokeData) GetPenSize() float32 {
|
||||||
@@ -236,7 +236,7 @@ type SyncNotebookResponse struct {
|
|||||||
|
|
||||||
func (x *SyncNotebookResponse) Reset() {
|
func (x *SyncNotebookResponse) Reset() {
|
||||||
*x = SyncNotebookResponse{}
|
*x = SyncNotebookResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[3]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -248,7 +248,7 @@ func (x *SyncNotebookResponse) String() string {
|
|||||||
func (*SyncNotebookResponse) ProtoMessage() {}
|
func (*SyncNotebookResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SyncNotebookResponse) ProtoReflect() protoreflect.Message {
|
func (x *SyncNotebookResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[3]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[3]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -261,7 +261,7 @@ func (x *SyncNotebookResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SyncNotebookResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SyncNotebookResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*SyncNotebookResponse) Descriptor() ([]byte, []int) {
|
func (*SyncNotebookResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{3}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SyncNotebookResponse) GetServerNotebookId() int64 {
|
func (x *SyncNotebookResponse) GetServerNotebookId() int64 {
|
||||||
@@ -287,7 +287,7 @@ type DeleteNotebookRequest struct {
|
|||||||
|
|
||||||
func (x *DeleteNotebookRequest) Reset() {
|
func (x *DeleteNotebookRequest) Reset() {
|
||||||
*x = DeleteNotebookRequest{}
|
*x = DeleteNotebookRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[4]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ func (x *DeleteNotebookRequest) String() string {
|
|||||||
func (*DeleteNotebookRequest) ProtoMessage() {}
|
func (*DeleteNotebookRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteNotebookRequest) ProtoReflect() protoreflect.Message {
|
func (x *DeleteNotebookRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[4]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[4]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -312,7 +312,7 @@ func (x *DeleteNotebookRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteNotebookRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteNotebookRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteNotebookRequest) Descriptor() ([]byte, []int) {
|
func (*DeleteNotebookRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{4}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteNotebookRequest) GetNotebookId() int64 {
|
func (x *DeleteNotebookRequest) GetNotebookId() int64 {
|
||||||
@@ -330,7 +330,7 @@ type DeleteNotebookResponse struct {
|
|||||||
|
|
||||||
func (x *DeleteNotebookResponse) Reset() {
|
func (x *DeleteNotebookResponse) Reset() {
|
||||||
*x = DeleteNotebookResponse{}
|
*x = DeleteNotebookResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[5]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,7 @@ func (x *DeleteNotebookResponse) String() string {
|
|||||||
func (*DeleteNotebookResponse) ProtoMessage() {}
|
func (*DeleteNotebookResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteNotebookResponse) ProtoReflect() protoreflect.Message {
|
func (x *DeleteNotebookResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[5]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[5]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -355,7 +355,7 @@ func (x *DeleteNotebookResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteNotebookResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteNotebookResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteNotebookResponse) Descriptor() ([]byte, []int) {
|
func (*DeleteNotebookResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{5}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListNotebooksRequest struct {
|
type ListNotebooksRequest struct {
|
||||||
@@ -366,7 +366,7 @@ type ListNotebooksRequest struct {
|
|||||||
|
|
||||||
func (x *ListNotebooksRequest) Reset() {
|
func (x *ListNotebooksRequest) Reset() {
|
||||||
*x = ListNotebooksRequest{}
|
*x = ListNotebooksRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[6]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -378,7 +378,7 @@ func (x *ListNotebooksRequest) String() string {
|
|||||||
func (*ListNotebooksRequest) ProtoMessage() {}
|
func (*ListNotebooksRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListNotebooksRequest) ProtoReflect() protoreflect.Message {
|
func (x *ListNotebooksRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[6]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[6]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -391,7 +391,7 @@ func (x *ListNotebooksRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListNotebooksRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListNotebooksRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ListNotebooksRequest) Descriptor() ([]byte, []int) {
|
func (*ListNotebooksRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{6}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListNotebooksResponse struct {
|
type ListNotebooksResponse struct {
|
||||||
@@ -403,7 +403,7 @@ type ListNotebooksResponse struct {
|
|||||||
|
|
||||||
func (x *ListNotebooksResponse) Reset() {
|
func (x *ListNotebooksResponse) Reset() {
|
||||||
*x = ListNotebooksResponse{}
|
*x = ListNotebooksResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[7]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ func (x *ListNotebooksResponse) String() string {
|
|||||||
func (*ListNotebooksResponse) ProtoMessage() {}
|
func (*ListNotebooksResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListNotebooksResponse) ProtoReflect() protoreflect.Message {
|
func (x *ListNotebooksResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[7]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[7]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -428,7 +428,7 @@ func (x *ListNotebooksResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListNotebooksResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListNotebooksResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ListNotebooksResponse) Descriptor() ([]byte, []int) {
|
func (*ListNotebooksResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{7}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListNotebooksResponse) GetNotebooks() []*NotebookSummary {
|
func (x *ListNotebooksResponse) GetNotebooks() []*NotebookSummary {
|
||||||
@@ -452,7 +452,7 @@ type NotebookSummary struct {
|
|||||||
|
|
||||||
func (x *NotebookSummary) Reset() {
|
func (x *NotebookSummary) Reset() {
|
||||||
*x = NotebookSummary{}
|
*x = NotebookSummary{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[8]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[8]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -464,7 +464,7 @@ func (x *NotebookSummary) String() string {
|
|||||||
func (*NotebookSummary) ProtoMessage() {}
|
func (*NotebookSummary) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *NotebookSummary) ProtoReflect() protoreflect.Message {
|
func (x *NotebookSummary) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[8]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[8]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -477,7 +477,7 @@ func (x *NotebookSummary) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use NotebookSummary.ProtoReflect.Descriptor instead.
|
// Deprecated: Use NotebookSummary.ProtoReflect.Descriptor instead.
|
||||||
func (*NotebookSummary) Descriptor() ([]byte, []int) {
|
func (*NotebookSummary) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{8}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *NotebookSummary) GetServerId() int64 {
|
func (x *NotebookSummary) GetServerId() int64 {
|
||||||
@@ -532,7 +532,7 @@ type CreateShareLinkRequest struct {
|
|||||||
|
|
||||||
func (x *CreateShareLinkRequest) Reset() {
|
func (x *CreateShareLinkRequest) Reset() {
|
||||||
*x = CreateShareLinkRequest{}
|
*x = CreateShareLinkRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[9]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[9]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -544,7 +544,7 @@ func (x *CreateShareLinkRequest) String() string {
|
|||||||
func (*CreateShareLinkRequest) ProtoMessage() {}
|
func (*CreateShareLinkRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *CreateShareLinkRequest) ProtoReflect() protoreflect.Message {
|
func (x *CreateShareLinkRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[9]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[9]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -557,7 +557,7 @@ func (x *CreateShareLinkRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use CreateShareLinkRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use CreateShareLinkRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*CreateShareLinkRequest) Descriptor() ([]byte, []int) {
|
func (*CreateShareLinkRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{9}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{9}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateShareLinkRequest) GetNotebookId() int64 {
|
func (x *CreateShareLinkRequest) GetNotebookId() int64 {
|
||||||
@@ -585,7 +585,7 @@ type CreateShareLinkResponse struct {
|
|||||||
|
|
||||||
func (x *CreateShareLinkResponse) Reset() {
|
func (x *CreateShareLinkResponse) Reset() {
|
||||||
*x = CreateShareLinkResponse{}
|
*x = CreateShareLinkResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[10]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[10]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ func (x *CreateShareLinkResponse) String() string {
|
|||||||
func (*CreateShareLinkResponse) ProtoMessage() {}
|
func (*CreateShareLinkResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *CreateShareLinkResponse) ProtoReflect() protoreflect.Message {
|
func (x *CreateShareLinkResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[10]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[10]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -610,7 +610,7 @@ func (x *CreateShareLinkResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use CreateShareLinkResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use CreateShareLinkResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*CreateShareLinkResponse) Descriptor() ([]byte, []int) {
|
func (*CreateShareLinkResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{10}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreateShareLinkResponse) GetToken() string {
|
func (x *CreateShareLinkResponse) GetToken() string {
|
||||||
@@ -643,7 +643,7 @@ type RevokeShareLinkRequest struct {
|
|||||||
|
|
||||||
func (x *RevokeShareLinkRequest) Reset() {
|
func (x *RevokeShareLinkRequest) Reset() {
|
||||||
*x = RevokeShareLinkRequest{}
|
*x = RevokeShareLinkRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[11]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[11]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -655,7 +655,7 @@ func (x *RevokeShareLinkRequest) String() string {
|
|||||||
func (*RevokeShareLinkRequest) ProtoMessage() {}
|
func (*RevokeShareLinkRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RevokeShareLinkRequest) ProtoReflect() protoreflect.Message {
|
func (x *RevokeShareLinkRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[11]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[11]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -668,7 +668,7 @@ func (x *RevokeShareLinkRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RevokeShareLinkRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RevokeShareLinkRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*RevokeShareLinkRequest) Descriptor() ([]byte, []int) {
|
func (*RevokeShareLinkRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{11}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{11}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RevokeShareLinkRequest) GetToken() string {
|
func (x *RevokeShareLinkRequest) GetToken() string {
|
||||||
@@ -686,7 +686,7 @@ type RevokeShareLinkResponse struct {
|
|||||||
|
|
||||||
func (x *RevokeShareLinkResponse) Reset() {
|
func (x *RevokeShareLinkResponse) Reset() {
|
||||||
*x = RevokeShareLinkResponse{}
|
*x = RevokeShareLinkResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[12]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[12]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -698,7 +698,7 @@ func (x *RevokeShareLinkResponse) String() string {
|
|||||||
func (*RevokeShareLinkResponse) ProtoMessage() {}
|
func (*RevokeShareLinkResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RevokeShareLinkResponse) ProtoReflect() protoreflect.Message {
|
func (x *RevokeShareLinkResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[12]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[12]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -711,7 +711,7 @@ func (x *RevokeShareLinkResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RevokeShareLinkResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RevokeShareLinkResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*RevokeShareLinkResponse) Descriptor() ([]byte, []int) {
|
func (*RevokeShareLinkResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{12}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{12}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListShareLinksRequest struct {
|
type ListShareLinksRequest struct {
|
||||||
@@ -723,7 +723,7 @@ type ListShareLinksRequest struct {
|
|||||||
|
|
||||||
func (x *ListShareLinksRequest) Reset() {
|
func (x *ListShareLinksRequest) Reset() {
|
||||||
*x = ListShareLinksRequest{}
|
*x = ListShareLinksRequest{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[13]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[13]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -735,7 +735,7 @@ func (x *ListShareLinksRequest) String() string {
|
|||||||
func (*ListShareLinksRequest) ProtoMessage() {}
|
func (*ListShareLinksRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListShareLinksRequest) ProtoReflect() protoreflect.Message {
|
func (x *ListShareLinksRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[13]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[13]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -748,7 +748,7 @@ func (x *ListShareLinksRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListShareLinksRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListShareLinksRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ListShareLinksRequest) Descriptor() ([]byte, []int) {
|
func (*ListShareLinksRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{13}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{13}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListShareLinksRequest) GetNotebookId() int64 {
|
func (x *ListShareLinksRequest) GetNotebookId() int64 {
|
||||||
@@ -767,7 +767,7 @@ type ListShareLinksResponse struct {
|
|||||||
|
|
||||||
func (x *ListShareLinksResponse) Reset() {
|
func (x *ListShareLinksResponse) Reset() {
|
||||||
*x = ListShareLinksResponse{}
|
*x = ListShareLinksResponse{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[14]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[14]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -779,7 +779,7 @@ func (x *ListShareLinksResponse) String() string {
|
|||||||
func (*ListShareLinksResponse) ProtoMessage() {}
|
func (*ListShareLinksResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ListShareLinksResponse) ProtoReflect() protoreflect.Message {
|
func (x *ListShareLinksResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[14]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[14]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -792,7 +792,7 @@ func (x *ListShareLinksResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ListShareLinksResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ListShareLinksResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ListShareLinksResponse) Descriptor() ([]byte, []int) {
|
func (*ListShareLinksResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{14}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{14}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListShareLinksResponse) GetLinks() []*ShareLinkInfo {
|
func (x *ListShareLinksResponse) GetLinks() []*ShareLinkInfo {
|
||||||
@@ -814,7 +814,7 @@ type ShareLinkInfo struct {
|
|||||||
|
|
||||||
func (x *ShareLinkInfo) Reset() {
|
func (x *ShareLinkInfo) Reset() {
|
||||||
*x = ShareLinkInfo{}
|
*x = ShareLinkInfo{}
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[15]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[15]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -826,7 +826,7 @@ func (x *ShareLinkInfo) String() string {
|
|||||||
func (*ShareLinkInfo) ProtoMessage() {}
|
func (*ShareLinkInfo) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ShareLinkInfo) ProtoReflect() protoreflect.Message {
|
func (x *ShareLinkInfo) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_engpad_v1_sync_proto_msgTypes[15]
|
mi := &file_proto_engpad_v1_sync_proto_msgTypes[15]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -839,7 +839,7 @@ func (x *ShareLinkInfo) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ShareLinkInfo.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ShareLinkInfo.ProtoReflect.Descriptor instead.
|
||||||
func (*ShareLinkInfo) Descriptor() ([]byte, []int) {
|
func (*ShareLinkInfo) Descriptor() ([]byte, []int) {
|
||||||
return file_engpad_v1_sync_proto_rawDescGZIP(), []int{15}
|
return file_proto_engpad_v1_sync_proto_rawDescGZIP(), []int{15}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShareLinkInfo) GetToken() string {
|
func (x *ShareLinkInfo) GetToken() string {
|
||||||
@@ -870,11 +870,11 @@ func (x *ShareLinkInfo) GetExpiresAt() *timestamppb.Timestamp {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var File_engpad_v1_sync_proto protoreflect.FileDescriptor
|
var File_proto_engpad_v1_sync_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
const file_engpad_v1_sync_proto_rawDesc = "" +
|
const file_proto_engpad_v1_sync_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\x14engpad/v1/sync.proto\x12\tengpad.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x94\x01\n" +
|
"\x1aproto/engpad/v1/sync.proto\x12\tengpad.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x94\x01\n" +
|
||||||
"\x13SyncNotebookRequest\x12\x1f\n" +
|
"\x13SyncNotebookRequest\x12\x1f\n" +
|
||||||
"\vnotebook_id\x18\x01 \x01(\x03R\n" +
|
"\vnotebook_id\x18\x01 \x01(\x03R\n" +
|
||||||
"notebookId\x12\x14\n" +
|
"notebookId\x12\x14\n" +
|
||||||
@@ -935,30 +935,30 @@ const file_engpad_v1_sync_proto_rawDesc = "" +
|
|||||||
"\n" +
|
"\n" +
|
||||||
"created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
"created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"expires_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt2\x93\x04\n" +
|
"expires_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt2\x9a\x04\n" +
|
||||||
"\n" +
|
"\x11EngPadSyncService\x12O\n" +
|
||||||
"EngPadSync\x12O\n" +
|
|
||||||
"\fSyncNotebook\x12\x1e.engpad.v1.SyncNotebookRequest\x1a\x1f.engpad.v1.SyncNotebookResponse\x12U\n" +
|
"\fSyncNotebook\x12\x1e.engpad.v1.SyncNotebookRequest\x1a\x1f.engpad.v1.SyncNotebookResponse\x12U\n" +
|
||||||
"\x0eDeleteNotebook\x12 .engpad.v1.DeleteNotebookRequest\x1a!.engpad.v1.DeleteNotebookResponse\x12R\n" +
|
"\x0eDeleteNotebook\x12 .engpad.v1.DeleteNotebookRequest\x1a!.engpad.v1.DeleteNotebookResponse\x12R\n" +
|
||||||
"\rListNotebooks\x12\x1f.engpad.v1.ListNotebooksRequest\x1a .engpad.v1.ListNotebooksResponse\x12X\n" +
|
"\rListNotebooks\x12\x1f.engpad.v1.ListNotebooksRequest\x1a .engpad.v1.ListNotebooksResponse\x12X\n" +
|
||||||
"\x0fCreateShareLink\x12!.engpad.v1.CreateShareLinkRequest\x1a\".engpad.v1.CreateShareLinkResponse\x12X\n" +
|
"\x0fCreateShareLink\x12!.engpad.v1.CreateShareLinkRequest\x1a\".engpad.v1.CreateShareLinkResponse\x12X\n" +
|
||||||
"\x0fRevokeShareLink\x12!.engpad.v1.RevokeShareLinkRequest\x1a\".engpad.v1.RevokeShareLinkResponse\x12U\n" +
|
"\x0fRevokeShareLink\x12!.engpad.v1.RevokeShareLinkRequest\x1a\".engpad.v1.RevokeShareLinkResponse\x12U\n" +
|
||||||
"\x0eListShareLinks\x12 .engpad.v1.ListShareLinksRequest\x1a!.engpad.v1.ListShareLinksResponseB=Z;git.wntrmute.dev/kyle/eng-pad-server/gen/engpad/v1;engpadv1b\x06proto3"
|
"\x0eListShareLinks\x12 .engpad.v1.ListShareLinksRequest\x1a!.engpad.v1.ListShareLinksResponseBa\n" +
|
||||||
|
" net.metacircular.engpad.proto.v1P\x01Z;git.wntrmute.dev/kyle/eng-pad-server/gen/engpad/v1;engpadv1b\x06proto3"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
file_engpad_v1_sync_proto_rawDescOnce sync.Once
|
file_proto_engpad_v1_sync_proto_rawDescOnce sync.Once
|
||||||
file_engpad_v1_sync_proto_rawDescData []byte
|
file_proto_engpad_v1_sync_proto_rawDescData []byte
|
||||||
)
|
)
|
||||||
|
|
||||||
func file_engpad_v1_sync_proto_rawDescGZIP() []byte {
|
func file_proto_engpad_v1_sync_proto_rawDescGZIP() []byte {
|
||||||
file_engpad_v1_sync_proto_rawDescOnce.Do(func() {
|
file_proto_engpad_v1_sync_proto_rawDescOnce.Do(func() {
|
||||||
file_engpad_v1_sync_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_engpad_v1_sync_proto_rawDesc), len(file_engpad_v1_sync_proto_rawDesc)))
|
file_proto_engpad_v1_sync_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_engpad_v1_sync_proto_rawDesc), len(file_proto_engpad_v1_sync_proto_rawDesc)))
|
||||||
})
|
})
|
||||||
return file_engpad_v1_sync_proto_rawDescData
|
return file_proto_engpad_v1_sync_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_engpad_v1_sync_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
var file_proto_engpad_v1_sync_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||||
var file_engpad_v1_sync_proto_goTypes = []any{
|
var file_proto_engpad_v1_sync_proto_goTypes = []any{
|
||||||
(*SyncNotebookRequest)(nil), // 0: engpad.v1.SyncNotebookRequest
|
(*SyncNotebookRequest)(nil), // 0: engpad.v1.SyncNotebookRequest
|
||||||
(*PageData)(nil), // 1: engpad.v1.PageData
|
(*PageData)(nil), // 1: engpad.v1.PageData
|
||||||
(*StrokeData)(nil), // 2: engpad.v1.StrokeData
|
(*StrokeData)(nil), // 2: engpad.v1.StrokeData
|
||||||
@@ -977,7 +977,7 @@ var file_engpad_v1_sync_proto_goTypes = []any{
|
|||||||
(*ShareLinkInfo)(nil), // 15: engpad.v1.ShareLinkInfo
|
(*ShareLinkInfo)(nil), // 15: engpad.v1.ShareLinkInfo
|
||||||
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
|
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
|
||||||
}
|
}
|
||||||
var file_engpad_v1_sync_proto_depIdxs = []int32{
|
var file_proto_engpad_v1_sync_proto_depIdxs = []int32{
|
||||||
1, // 0: engpad.v1.SyncNotebookRequest.pages:type_name -> engpad.v1.PageData
|
1, // 0: engpad.v1.SyncNotebookRequest.pages:type_name -> engpad.v1.PageData
|
||||||
2, // 1: engpad.v1.PageData.strokes:type_name -> engpad.v1.StrokeData
|
2, // 1: engpad.v1.PageData.strokes:type_name -> engpad.v1.StrokeData
|
||||||
16, // 2: engpad.v1.SyncNotebookResponse.synced_at:type_name -> google.protobuf.Timestamp
|
16, // 2: engpad.v1.SyncNotebookResponse.synced_at:type_name -> google.protobuf.Timestamp
|
||||||
@@ -987,18 +987,18 @@ var file_engpad_v1_sync_proto_depIdxs = []int32{
|
|||||||
15, // 6: engpad.v1.ListShareLinksResponse.links:type_name -> engpad.v1.ShareLinkInfo
|
15, // 6: engpad.v1.ListShareLinksResponse.links:type_name -> engpad.v1.ShareLinkInfo
|
||||||
16, // 7: engpad.v1.ShareLinkInfo.created_at:type_name -> google.protobuf.Timestamp
|
16, // 7: engpad.v1.ShareLinkInfo.created_at:type_name -> google.protobuf.Timestamp
|
||||||
16, // 8: engpad.v1.ShareLinkInfo.expires_at:type_name -> google.protobuf.Timestamp
|
16, // 8: engpad.v1.ShareLinkInfo.expires_at:type_name -> google.protobuf.Timestamp
|
||||||
0, // 9: engpad.v1.EngPadSync.SyncNotebook:input_type -> engpad.v1.SyncNotebookRequest
|
0, // 9: engpad.v1.EngPadSyncService.SyncNotebook:input_type -> engpad.v1.SyncNotebookRequest
|
||||||
4, // 10: engpad.v1.EngPadSync.DeleteNotebook:input_type -> engpad.v1.DeleteNotebookRequest
|
4, // 10: engpad.v1.EngPadSyncService.DeleteNotebook:input_type -> engpad.v1.DeleteNotebookRequest
|
||||||
6, // 11: engpad.v1.EngPadSync.ListNotebooks:input_type -> engpad.v1.ListNotebooksRequest
|
6, // 11: engpad.v1.EngPadSyncService.ListNotebooks:input_type -> engpad.v1.ListNotebooksRequest
|
||||||
9, // 12: engpad.v1.EngPadSync.CreateShareLink:input_type -> engpad.v1.CreateShareLinkRequest
|
9, // 12: engpad.v1.EngPadSyncService.CreateShareLink:input_type -> engpad.v1.CreateShareLinkRequest
|
||||||
11, // 13: engpad.v1.EngPadSync.RevokeShareLink:input_type -> engpad.v1.RevokeShareLinkRequest
|
11, // 13: engpad.v1.EngPadSyncService.RevokeShareLink:input_type -> engpad.v1.RevokeShareLinkRequest
|
||||||
13, // 14: engpad.v1.EngPadSync.ListShareLinks:input_type -> engpad.v1.ListShareLinksRequest
|
13, // 14: engpad.v1.EngPadSyncService.ListShareLinks:input_type -> engpad.v1.ListShareLinksRequest
|
||||||
3, // 15: engpad.v1.EngPadSync.SyncNotebook:output_type -> engpad.v1.SyncNotebookResponse
|
3, // 15: engpad.v1.EngPadSyncService.SyncNotebook:output_type -> engpad.v1.SyncNotebookResponse
|
||||||
5, // 16: engpad.v1.EngPadSync.DeleteNotebook:output_type -> engpad.v1.DeleteNotebookResponse
|
5, // 16: engpad.v1.EngPadSyncService.DeleteNotebook:output_type -> engpad.v1.DeleteNotebookResponse
|
||||||
7, // 17: engpad.v1.EngPadSync.ListNotebooks:output_type -> engpad.v1.ListNotebooksResponse
|
7, // 17: engpad.v1.EngPadSyncService.ListNotebooks:output_type -> engpad.v1.ListNotebooksResponse
|
||||||
10, // 18: engpad.v1.EngPadSync.CreateShareLink:output_type -> engpad.v1.CreateShareLinkResponse
|
10, // 18: engpad.v1.EngPadSyncService.CreateShareLink:output_type -> engpad.v1.CreateShareLinkResponse
|
||||||
12, // 19: engpad.v1.EngPadSync.RevokeShareLink:output_type -> engpad.v1.RevokeShareLinkResponse
|
12, // 19: engpad.v1.EngPadSyncService.RevokeShareLink:output_type -> engpad.v1.RevokeShareLinkResponse
|
||||||
14, // 20: engpad.v1.EngPadSync.ListShareLinks:output_type -> engpad.v1.ListShareLinksResponse
|
14, // 20: engpad.v1.EngPadSyncService.ListShareLinks:output_type -> engpad.v1.ListShareLinksResponse
|
||||||
15, // [15:21] is the sub-list for method output_type
|
15, // [15:21] is the sub-list for method output_type
|
||||||
9, // [9:15] is the sub-list for method input_type
|
9, // [9:15] is the sub-list for method input_type
|
||||||
9, // [9:9] is the sub-list for extension type_name
|
9, // [9:9] is the sub-list for extension type_name
|
||||||
@@ -1006,26 +1006,26 @@ var file_engpad_v1_sync_proto_depIdxs = []int32{
|
|||||||
0, // [0:9] is the sub-list for field type_name
|
0, // [0:9] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_engpad_v1_sync_proto_init() }
|
func init() { file_proto_engpad_v1_sync_proto_init() }
|
||||||
func file_engpad_v1_sync_proto_init() {
|
func file_proto_engpad_v1_sync_proto_init() {
|
||||||
if File_engpad_v1_sync_proto != nil {
|
if File_proto_engpad_v1_sync_proto != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_engpad_v1_sync_proto_rawDesc), len(file_engpad_v1_sync_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_engpad_v1_sync_proto_rawDesc), len(file_proto_engpad_v1_sync_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 16,
|
NumMessages: 16,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
GoTypes: file_engpad_v1_sync_proto_goTypes,
|
GoTypes: file_proto_engpad_v1_sync_proto_goTypes,
|
||||||
DependencyIndexes: file_engpad_v1_sync_proto_depIdxs,
|
DependencyIndexes: file_proto_engpad_v1_sync_proto_depIdxs,
|
||||||
MessageInfos: file_engpad_v1_sync_proto_msgTypes,
|
MessageInfos: file_proto_engpad_v1_sync_proto_msgTypes,
|
||||||
}.Build()
|
}.Build()
|
||||||
File_engpad_v1_sync_proto = out.File
|
File_proto_engpad_v1_sync_proto = out.File
|
||||||
file_engpad_v1_sync_proto_goTypes = nil
|
file_proto_engpad_v1_sync_proto_goTypes = nil
|
||||||
file_engpad_v1_sync_proto_depIdxs = nil
|
file_proto_engpad_v1_sync_proto_depIdxs = nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.6.1
|
// - protoc-gen-go-grpc v1.6.1
|
||||||
// - protoc v3.20.3
|
// - protoc v3.20.3
|
||||||
// source: engpad/v1/sync.proto
|
// source: proto/engpad/v1/sync.proto
|
||||||
|
|
||||||
package engpadv1
|
package engpadv1
|
||||||
|
|
||||||
@@ -19,18 +19,18 @@ import (
|
|||||||
const _ = grpc.SupportPackageIsVersion9
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EngPadSync_SyncNotebook_FullMethodName = "/engpad.v1.EngPadSync/SyncNotebook"
|
EngPadSyncService_SyncNotebook_FullMethodName = "/engpad.v1.EngPadSyncService/SyncNotebook"
|
||||||
EngPadSync_DeleteNotebook_FullMethodName = "/engpad.v1.EngPadSync/DeleteNotebook"
|
EngPadSyncService_DeleteNotebook_FullMethodName = "/engpad.v1.EngPadSyncService/DeleteNotebook"
|
||||||
EngPadSync_ListNotebooks_FullMethodName = "/engpad.v1.EngPadSync/ListNotebooks"
|
EngPadSyncService_ListNotebooks_FullMethodName = "/engpad.v1.EngPadSyncService/ListNotebooks"
|
||||||
EngPadSync_CreateShareLink_FullMethodName = "/engpad.v1.EngPadSync/CreateShareLink"
|
EngPadSyncService_CreateShareLink_FullMethodName = "/engpad.v1.EngPadSyncService/CreateShareLink"
|
||||||
EngPadSync_RevokeShareLink_FullMethodName = "/engpad.v1.EngPadSync/RevokeShareLink"
|
EngPadSyncService_RevokeShareLink_FullMethodName = "/engpad.v1.EngPadSyncService/RevokeShareLink"
|
||||||
EngPadSync_ListShareLinks_FullMethodName = "/engpad.v1.EngPadSync/ListShareLinks"
|
EngPadSyncService_ListShareLinks_FullMethodName = "/engpad.v1.EngPadSyncService/ListShareLinks"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EngPadSyncClient is the client API for EngPadSync service.
|
// EngPadSyncServiceClient is the client API for EngPadSyncService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type EngPadSyncClient interface {
|
type EngPadSyncServiceClient interface {
|
||||||
SyncNotebook(ctx context.Context, in *SyncNotebookRequest, opts ...grpc.CallOption) (*SyncNotebookResponse, error)
|
SyncNotebook(ctx context.Context, in *SyncNotebookRequest, opts ...grpc.CallOption) (*SyncNotebookResponse, error)
|
||||||
DeleteNotebook(ctx context.Context, in *DeleteNotebookRequest, opts ...grpc.CallOption) (*DeleteNotebookResponse, error)
|
DeleteNotebook(ctx context.Context, in *DeleteNotebookRequest, opts ...grpc.CallOption) (*DeleteNotebookResponse, error)
|
||||||
ListNotebooks(ctx context.Context, in *ListNotebooksRequest, opts ...grpc.CallOption) (*ListNotebooksResponse, error)
|
ListNotebooks(ctx context.Context, in *ListNotebooksRequest, opts ...grpc.CallOption) (*ListNotebooksResponse, error)
|
||||||
@@ -39,273 +39,273 @@ type EngPadSyncClient interface {
|
|||||||
ListShareLinks(ctx context.Context, in *ListShareLinksRequest, opts ...grpc.CallOption) (*ListShareLinksResponse, error)
|
ListShareLinks(ctx context.Context, in *ListShareLinksRequest, opts ...grpc.CallOption) (*ListShareLinksResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type engPadSyncClient struct {
|
type engPadSyncServiceClient struct {
|
||||||
cc grpc.ClientConnInterface
|
cc grpc.ClientConnInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewEngPadSyncClient(cc grpc.ClientConnInterface) EngPadSyncClient {
|
func NewEngPadSyncServiceClient(cc grpc.ClientConnInterface) EngPadSyncServiceClient {
|
||||||
return &engPadSyncClient{cc}
|
return &engPadSyncServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) SyncNotebook(ctx context.Context, in *SyncNotebookRequest, opts ...grpc.CallOption) (*SyncNotebookResponse, error) {
|
func (c *engPadSyncServiceClient) SyncNotebook(ctx context.Context, in *SyncNotebookRequest, opts ...grpc.CallOption) (*SyncNotebookResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(SyncNotebookResponse)
|
out := new(SyncNotebookResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_SyncNotebook_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_SyncNotebook_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) DeleteNotebook(ctx context.Context, in *DeleteNotebookRequest, opts ...grpc.CallOption) (*DeleteNotebookResponse, error) {
|
func (c *engPadSyncServiceClient) DeleteNotebook(ctx context.Context, in *DeleteNotebookRequest, opts ...grpc.CallOption) (*DeleteNotebookResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(DeleteNotebookResponse)
|
out := new(DeleteNotebookResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_DeleteNotebook_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_DeleteNotebook_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) ListNotebooks(ctx context.Context, in *ListNotebooksRequest, opts ...grpc.CallOption) (*ListNotebooksResponse, error) {
|
func (c *engPadSyncServiceClient) ListNotebooks(ctx context.Context, in *ListNotebooksRequest, opts ...grpc.CallOption) (*ListNotebooksResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(ListNotebooksResponse)
|
out := new(ListNotebooksResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_ListNotebooks_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_ListNotebooks_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) CreateShareLink(ctx context.Context, in *CreateShareLinkRequest, opts ...grpc.CallOption) (*CreateShareLinkResponse, error) {
|
func (c *engPadSyncServiceClient) CreateShareLink(ctx context.Context, in *CreateShareLinkRequest, opts ...grpc.CallOption) (*CreateShareLinkResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(CreateShareLinkResponse)
|
out := new(CreateShareLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_CreateShareLink_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_CreateShareLink_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) RevokeShareLink(ctx context.Context, in *RevokeShareLinkRequest, opts ...grpc.CallOption) (*RevokeShareLinkResponse, error) {
|
func (c *engPadSyncServiceClient) RevokeShareLink(ctx context.Context, in *RevokeShareLinkRequest, opts ...grpc.CallOption) (*RevokeShareLinkResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RevokeShareLinkResponse)
|
out := new(RevokeShareLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_RevokeShareLink_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_RevokeShareLink_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *engPadSyncClient) ListShareLinks(ctx context.Context, in *ListShareLinksRequest, opts ...grpc.CallOption) (*ListShareLinksResponse, error) {
|
func (c *engPadSyncServiceClient) ListShareLinks(ctx context.Context, in *ListShareLinksRequest, opts ...grpc.CallOption) (*ListShareLinksResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(ListShareLinksResponse)
|
out := new(ListShareLinksResponse)
|
||||||
err := c.cc.Invoke(ctx, EngPadSync_ListShareLinks_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, EngPadSyncService_ListShareLinks_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EngPadSyncServer is the server API for EngPadSync service.
|
// EngPadSyncServiceServer is the server API for EngPadSyncService service.
|
||||||
// All implementations must embed UnimplementedEngPadSyncServer
|
// All implementations must embed UnimplementedEngPadSyncServiceServer
|
||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
type EngPadSyncServer interface {
|
type EngPadSyncServiceServer interface {
|
||||||
SyncNotebook(context.Context, *SyncNotebookRequest) (*SyncNotebookResponse, error)
|
SyncNotebook(context.Context, *SyncNotebookRequest) (*SyncNotebookResponse, error)
|
||||||
DeleteNotebook(context.Context, *DeleteNotebookRequest) (*DeleteNotebookResponse, error)
|
DeleteNotebook(context.Context, *DeleteNotebookRequest) (*DeleteNotebookResponse, error)
|
||||||
ListNotebooks(context.Context, *ListNotebooksRequest) (*ListNotebooksResponse, error)
|
ListNotebooks(context.Context, *ListNotebooksRequest) (*ListNotebooksResponse, error)
|
||||||
CreateShareLink(context.Context, *CreateShareLinkRequest) (*CreateShareLinkResponse, error)
|
CreateShareLink(context.Context, *CreateShareLinkRequest) (*CreateShareLinkResponse, error)
|
||||||
RevokeShareLink(context.Context, *RevokeShareLinkRequest) (*RevokeShareLinkResponse, error)
|
RevokeShareLink(context.Context, *RevokeShareLinkRequest) (*RevokeShareLinkResponse, error)
|
||||||
ListShareLinks(context.Context, *ListShareLinksRequest) (*ListShareLinksResponse, error)
|
ListShareLinks(context.Context, *ListShareLinksRequest) (*ListShareLinksResponse, error)
|
||||||
mustEmbedUnimplementedEngPadSyncServer()
|
mustEmbedUnimplementedEngPadSyncServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedEngPadSyncServer must be embedded to have
|
// UnimplementedEngPadSyncServiceServer must be embedded to have
|
||||||
// forward compatible implementations.
|
// forward compatible implementations.
|
||||||
//
|
//
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
// pointer dereference when methods are called.
|
// pointer dereference when methods are called.
|
||||||
type UnimplementedEngPadSyncServer struct{}
|
type UnimplementedEngPadSyncServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedEngPadSyncServer) SyncNotebook(context.Context, *SyncNotebookRequest) (*SyncNotebookResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) SyncNotebook(context.Context, *SyncNotebookRequest) (*SyncNotebookResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method SyncNotebook not implemented")
|
return nil, status.Error(codes.Unimplemented, "method SyncNotebook not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) DeleteNotebook(context.Context, *DeleteNotebookRequest) (*DeleteNotebookResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) DeleteNotebook(context.Context, *DeleteNotebookRequest) (*DeleteNotebookResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method DeleteNotebook not implemented")
|
return nil, status.Error(codes.Unimplemented, "method DeleteNotebook not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) ListNotebooks(context.Context, *ListNotebooksRequest) (*ListNotebooksResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) ListNotebooks(context.Context, *ListNotebooksRequest) (*ListNotebooksResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method ListNotebooks not implemented")
|
return nil, status.Error(codes.Unimplemented, "method ListNotebooks not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) CreateShareLink(context.Context, *CreateShareLinkRequest) (*CreateShareLinkResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) CreateShareLink(context.Context, *CreateShareLinkRequest) (*CreateShareLinkResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method CreateShareLink not implemented")
|
return nil, status.Error(codes.Unimplemented, "method CreateShareLink not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) RevokeShareLink(context.Context, *RevokeShareLinkRequest) (*RevokeShareLinkResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) RevokeShareLink(context.Context, *RevokeShareLinkRequest) (*RevokeShareLinkResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method RevokeShareLink not implemented")
|
return nil, status.Error(codes.Unimplemented, "method RevokeShareLink not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) ListShareLinks(context.Context, *ListShareLinksRequest) (*ListShareLinksResponse, error) {
|
func (UnimplementedEngPadSyncServiceServer) ListShareLinks(context.Context, *ListShareLinksRequest) (*ListShareLinksResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method ListShareLinks not implemented")
|
return nil, status.Error(codes.Unimplemented, "method ListShareLinks not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedEngPadSyncServer) mustEmbedUnimplementedEngPadSyncServer() {}
|
func (UnimplementedEngPadSyncServiceServer) mustEmbedUnimplementedEngPadSyncServiceServer() {}
|
||||||
func (UnimplementedEngPadSyncServer) testEmbeddedByValue() {}
|
func (UnimplementedEngPadSyncServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeEngPadSyncServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeEngPadSyncServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to EngPadSyncServer will
|
// Use of this interface is not recommended, as added methods to EngPadSyncServiceServer will
|
||||||
// result in compilation errors.
|
// result in compilation errors.
|
||||||
type UnsafeEngPadSyncServer interface {
|
type UnsafeEngPadSyncServiceServer interface {
|
||||||
mustEmbedUnimplementedEngPadSyncServer()
|
mustEmbedUnimplementedEngPadSyncServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterEngPadSyncServer(s grpc.ServiceRegistrar, srv EngPadSyncServer) {
|
func RegisterEngPadSyncServiceServer(s grpc.ServiceRegistrar, srv EngPadSyncServiceServer) {
|
||||||
// If the following call panics, it indicates UnimplementedEngPadSyncServer was
|
// If the following call panics, it indicates UnimplementedEngPadSyncServiceServer was
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
t.testEmbeddedByValue()
|
t.testEmbeddedByValue()
|
||||||
}
|
}
|
||||||
s.RegisterService(&EngPadSync_ServiceDesc, srv)
|
s.RegisterService(&EngPadSyncService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_SyncNotebook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_SyncNotebook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(SyncNotebookRequest)
|
in := new(SyncNotebookRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).SyncNotebook(ctx, in)
|
return srv.(EngPadSyncServiceServer).SyncNotebook(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_SyncNotebook_FullMethodName,
|
FullMethod: EngPadSyncService_SyncNotebook_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).SyncNotebook(ctx, req.(*SyncNotebookRequest))
|
return srv.(EngPadSyncServiceServer).SyncNotebook(ctx, req.(*SyncNotebookRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_DeleteNotebook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_DeleteNotebook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(DeleteNotebookRequest)
|
in := new(DeleteNotebookRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).DeleteNotebook(ctx, in)
|
return srv.(EngPadSyncServiceServer).DeleteNotebook(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_DeleteNotebook_FullMethodName,
|
FullMethod: EngPadSyncService_DeleteNotebook_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).DeleteNotebook(ctx, req.(*DeleteNotebookRequest))
|
return srv.(EngPadSyncServiceServer).DeleteNotebook(ctx, req.(*DeleteNotebookRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_ListNotebooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_ListNotebooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(ListNotebooksRequest)
|
in := new(ListNotebooksRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).ListNotebooks(ctx, in)
|
return srv.(EngPadSyncServiceServer).ListNotebooks(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_ListNotebooks_FullMethodName,
|
FullMethod: EngPadSyncService_ListNotebooks_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).ListNotebooks(ctx, req.(*ListNotebooksRequest))
|
return srv.(EngPadSyncServiceServer).ListNotebooks(ctx, req.(*ListNotebooksRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_CreateShareLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_CreateShareLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateShareLinkRequest)
|
in := new(CreateShareLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).CreateShareLink(ctx, in)
|
return srv.(EngPadSyncServiceServer).CreateShareLink(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_CreateShareLink_FullMethodName,
|
FullMethod: EngPadSyncService_CreateShareLink_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).CreateShareLink(ctx, req.(*CreateShareLinkRequest))
|
return srv.(EngPadSyncServiceServer).CreateShareLink(ctx, req.(*CreateShareLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_RevokeShareLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_RevokeShareLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(RevokeShareLinkRequest)
|
in := new(RevokeShareLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).RevokeShareLink(ctx, in)
|
return srv.(EngPadSyncServiceServer).RevokeShareLink(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_RevokeShareLink_FullMethodName,
|
FullMethod: EngPadSyncService_RevokeShareLink_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).RevokeShareLink(ctx, req.(*RevokeShareLinkRequest))
|
return srv.(EngPadSyncServiceServer).RevokeShareLink(ctx, req.(*RevokeShareLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _EngPadSync_ListShareLinks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _EngPadSyncService_ListShareLinks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(ListShareLinksRequest)
|
in := new(ListShareLinksRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(EngPadSyncServer).ListShareLinks(ctx, in)
|
return srv.(EngPadSyncServiceServer).ListShareLinks(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: EngPadSync_ListShareLinks_FullMethodName,
|
FullMethod: EngPadSyncService_ListShareLinks_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(EngPadSyncServer).ListShareLinks(ctx, req.(*ListShareLinksRequest))
|
return srv.(EngPadSyncServiceServer).ListShareLinks(ctx, req.(*ListShareLinksRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EngPadSync_ServiceDesc is the grpc.ServiceDesc for EngPadSync service.
|
// EngPadSyncService_ServiceDesc is the grpc.ServiceDesc for EngPadSyncService service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
var EngPadSync_ServiceDesc = grpc.ServiceDesc{
|
var EngPadSyncService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "engpad.v1.EngPadSync",
|
ServiceName: "engpad.v1.EngPadSyncService",
|
||||||
HandlerType: (*EngPadSyncServer)(nil),
|
HandlerType: (*EngPadSyncServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "SyncNotebook",
|
MethodName: "SyncNotebook",
|
||||||
Handler: _EngPadSync_SyncNotebook_Handler,
|
Handler: _EngPadSyncService_SyncNotebook_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "DeleteNotebook",
|
MethodName: "DeleteNotebook",
|
||||||
Handler: _EngPadSync_DeleteNotebook_Handler,
|
Handler: _EngPadSyncService_DeleteNotebook_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "ListNotebooks",
|
MethodName: "ListNotebooks",
|
||||||
Handler: _EngPadSync_ListNotebooks_Handler,
|
Handler: _EngPadSyncService_ListNotebooks_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateShareLink",
|
MethodName: "CreateShareLink",
|
||||||
Handler: _EngPadSync_CreateShareLink_Handler,
|
Handler: _EngPadSyncService_CreateShareLink_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "RevokeShareLink",
|
MethodName: "RevokeShareLink",
|
||||||
Handler: _EngPadSync_RevokeShareLink_Handler,
|
Handler: _EngPadSyncService_RevokeShareLink_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "ListShareLinks",
|
MethodName: "ListShareLinks",
|
||||||
Handler: _EngPadSync_ListShareLinks_Handler,
|
Handler: _EngPadSyncService_ListShareLinks_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "engpad/v1/sync.proto",
|
Metadata: "proto/engpad/v1/sync.proto",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func Start(cfg Config) (*grpc.Server, error) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
syncSvc := &SyncService{DB: cfg.DB, BaseURL: cfg.BaseURL}
|
syncSvc := &SyncService{DB: cfg.DB, BaseURL: cfg.BaseURL}
|
||||||
pb.RegisterEngPadSyncServer(srv, syncSvc)
|
pb.RegisterEngPadSyncServiceServer(srv, syncSvc)
|
||||||
|
|
||||||
slog.Info("gRPC server started", "addr", cfg.Addr)
|
slog.Info("gRPC server started", "addr", cfg.Addr)
|
||||||
go func() { _ = srv.Serve(lis) }()
|
go func() { _ = srv.Serve(lis) }()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SyncService struct {
|
type SyncService struct {
|
||||||
pb.UnimplementedEngPadSyncServer
|
pb.UnimplementedEngPadSyncServiceServer
|
||||||
DB *sql.DB
|
DB *sql.DB
|
||||||
BaseURL string
|
BaseURL string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ syntax = "proto3";
|
|||||||
package engpad.v1;
|
package engpad.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/eng-pad-server/gen/engpad/v1;engpadv1";
|
option go_package = "git.wntrmute.dev/kyle/eng-pad-server/gen/engpad/v1;engpadv1";
|
||||||
|
option java_package = "net.metacircular.engpad.proto.v1";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
|
||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
service EngPadSync {
|
service EngPadSyncService {
|
||||||
rpc SyncNotebook(SyncNotebookRequest) returns (SyncNotebookResponse);
|
rpc SyncNotebook(SyncNotebookRequest) returns (SyncNotebookResponse);
|
||||||
rpc DeleteNotebook(DeleteNotebookRequest) returns (DeleteNotebookResponse);
|
rpc DeleteNotebook(DeleteNotebookRequest) returns (DeleteNotebookResponse);
|
||||||
rpc ListNotebooks(ListNotebooksRequest) returns (ListNotebooksResponse);
|
rpc ListNotebooks(ListNotebooksRequest) returns (ListNotebooksResponse);
|
||||||
|
|||||||
135
web/templates/keys.html
Normal file
135
web/templates/keys.html
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
{{define "title"}}Security Keys — Engineering Pad{{end}}
|
||||||
|
|
||||||
|
{{define "nav-right"}}<a href="/logout">Logout</a>{{end}}
|
||||||
|
|
||||||
|
{{define "content"}}
|
||||||
|
<h1>Security Keys</h1>
|
||||||
|
|
||||||
|
<p><a href="/notebooks" class="btn">Back to Notebooks</a></p>
|
||||||
|
|
||||||
|
{{if .Keys}}
|
||||||
|
<table style="width:100%; max-width:600px; border-collapse:collapse; margin:1rem 0;">
|
||||||
|
<thead>
|
||||||
|
<tr style="border-bottom:2px solid #111; text-align:left;">
|
||||||
|
<th style="padding:0.5rem;">Name</th>
|
||||||
|
<th style="padding:0.5rem;">Registered</th>
|
||||||
|
<th style="padding:0.5rem;"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{range .Keys}}
|
||||||
|
<tr style="border-bottom:1px solid #ccc;">
|
||||||
|
<td style="padding:0.5rem;">{{.Name}}</td>
|
||||||
|
<td style="padding:0.5rem;">{{.CreatedAt.Format "2006-01-02 15:04"}}</td>
|
||||||
|
<td style="padding:0.5rem;">
|
||||||
|
<form method="POST" action="/keys/delete" style="display:inline;"
|
||||||
|
onsubmit="return confirm('Delete this key?');">
|
||||||
|
<input type="hidden" name="id" value="{{.ID}}">
|
||||||
|
<button type="submit" class="btn" style="color:red; border-color:red;">Delete</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{else}}
|
||||||
|
<p style="margin:1rem 0;">No security keys registered.</p>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if .WebAuthnEnabled}}
|
||||||
|
<div style="margin-top:1.5rem;">
|
||||||
|
<h2 style="font-size:1.2rem;">Register New Key</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="key-name">Key Name</label>
|
||||||
|
<input type="text" id="key-name" placeholder="e.g. YubiKey 5" value="">
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn" id="register-btn">Register Security Key</button>
|
||||||
|
<p id="register-status" style="margin-top:0.5rem;"></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
if (!window.PublicKeyCredential) {
|
||||||
|
document.getElementById("register-btn").style.display = "none";
|
||||||
|
document.getElementById("register-status").textContent = "WebAuthn is not supported in this browser.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var btn = document.getElementById("register-btn");
|
||||||
|
var statusEl = document.getElementById("register-status");
|
||||||
|
|
||||||
|
btn.addEventListener("click", async function() {
|
||||||
|
statusEl.textContent = "";
|
||||||
|
statusEl.style.color = "";
|
||||||
|
btn.disabled = true;
|
||||||
|
btn.textContent = "Waiting for security key...";
|
||||||
|
|
||||||
|
try {
|
||||||
|
var beginResp = await fetch("/webauthn/register/begin", {method: "POST"});
|
||||||
|
if (!beginResp.ok) {
|
||||||
|
var err = await beginResp.json();
|
||||||
|
throw new Error(err.error || "Registration failed");
|
||||||
|
}
|
||||||
|
var options = await beginResp.json();
|
||||||
|
|
||||||
|
// Decode base64url fields.
|
||||||
|
options.publicKey.challenge = base64urlToBuffer(options.publicKey.challenge);
|
||||||
|
options.publicKey.user.id = base64urlToBuffer(options.publicKey.user.id);
|
||||||
|
if (options.publicKey.excludeCredentials) {
|
||||||
|
options.publicKey.excludeCredentials.forEach(function(c) {
|
||||||
|
c.id = base64urlToBuffer(c.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var credential = await navigator.credentials.create({publicKey: options.publicKey});
|
||||||
|
|
||||||
|
var body = JSON.stringify({
|
||||||
|
id: credential.id,
|
||||||
|
rawId: bufferToBase64url(credential.rawId),
|
||||||
|
type: credential.type,
|
||||||
|
response: {
|
||||||
|
attestationObject: bufferToBase64url(credential.response.attestationObject),
|
||||||
|
clientDataJSON: bufferToBase64url(credential.response.clientDataJSON)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var keyName = document.getElementById("key-name").value || "Security Key";
|
||||||
|
var finishResp = await fetch("/webauthn/register/finish?name=" + encodeURIComponent(keyName), {
|
||||||
|
method: "POST",
|
||||||
|
headers: {"Content-Type": "application/json"},
|
||||||
|
body: body
|
||||||
|
});
|
||||||
|
if (!finishResp.ok) {
|
||||||
|
var err2 = await finishResp.json();
|
||||||
|
throw new Error(err2.error || "Registration failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
|
} catch(e) {
|
||||||
|
statusEl.style.color = "red";
|
||||||
|
statusEl.textContent = e.message || "Registration failed";
|
||||||
|
} finally {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.textContent = "Register Security Key";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function base64urlToBuffer(b64url) {
|
||||||
|
var b64 = b64url.replace(/-/g, "+").replace(/_/g, "/");
|
||||||
|
while (b64.length % 4) b64 += "=";
|
||||||
|
var binary = atob(b64);
|
||||||
|
var bytes = new Uint8Array(binary.length);
|
||||||
|
for (var i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
||||||
|
return bytes.buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function bufferToBase64url(buf) {
|
||||||
|
var bytes = new Uint8Array(buf);
|
||||||
|
var binary = "";
|
||||||
|
for (var i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
|
||||||
|
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
Reference in New Issue
Block a user