Documentation ¶
Index ¶
- Constants
- Variables
- type BlobRootStorageRequest
- type BlobStorageRequest
- type BlobStorageResponse
- type ConcurrencyProvider
- type DeleteDocument
- type Document
- type EMConfig
- type EMConfigHolder
- type EMContextKey
- type EMRemarkableConfig
- type EMRootConfig
- type EMURLConfig
- type EMURLProvider
- type MetadataDocument
- type Node
- func (node *Node) EntyExists(id string) bool
- func (node *Node) FindByName(name string) (*Node, error)
- func (node *Node) ID() string
- func (node *Node) IsDirectory() bool
- func (node *Node) IsFile() bool
- func (node *Node) IsRoot() bool
- func (node *Node) LastModified() (time.Time, error)
- func (node *Node) Name() string
- func (node *Node) Version() int
- type SyncCompletedRequest
- type URLProvider
- type URLProviderHolder
- type UploadDocumentRequest
- type UploadDocumentResponse
Constants ¶
View Source
const ( // ******************* GENERAL CONSTANTS ******************* // Constants related to CLI and Config EnvPrefix = "EM_" EMAppName = "evermarkable" EMDefaultCacheDirModeSet = 0700 EMDTCacheFile = "dt.cache" EMDefaultCacheFileModeSet = 0600 EMCacheVersion = 3 // ******************* REMARKABLE SPECIFIC CONSTANTS ******************* // URI's for remarkable cloud endpoints which can be overridden DocHost = "https://document-storage-production-dot-remarkable-production.appspot.com" AuthHost = "https://webapp-prod.cloud.remarkable.engineering" SyncHost = "https://internal.cloud.remarkable.com" // Paths for requesting tokens //nolint:gosec // the following are not hardcoded credentials DeviceTokenPath = "/token/json/2/device/new" UserDevicePath = "/token/json/2/user/new" // Paths for document storage ListDocsPath = "/document-storage/json/2/docs" UpdateStatusPath = "/document-storage/json/2/upload/update-status" UploadRequestPath = "/document-storage/json/2/upload/request" DeleteEntryPath = "/document-storage/json/2/delete" // Paths for sync endpoints UploadBlobPath = "/sync/v2/signed-urls/uploads" DownloadBlobPath = "/sync/v2/signed-urls/downloads" SyncCompletePath = "/sync/v2/sync-complete" // User agent used when making web requests EMUserAgent = "evermarkable" // Constants related to authentication to remarkable API DeviceTokenSecName = "device-token" UserTokenSecName = "user-token" DefaultDeviceDesc = "desktop-linux" // Constants related to remarkable nodes and documents DirectoryType = "CollectionType" DocumentType = "DocumentType" // The root path name for the remarkable cloud RemRootPathName = "root" RemDefaultConcurrency = 99 )
Variables ¶
View Source
var (
ContextConfigSet = EMContextKey{ContextKey: "config"}
)
Functions ¶
This section is empty.
Types ¶
type BlobRootStorageRequest ¶
type BlobStorageRequest ¶
type BlobStorageRequest struct { Method string `json:"http_method"` Initial bool `json:"initial_sync,omitempty"` RelativePath string `json:"relative_path"` ParentPath string `json:"parent_path,omitempty"` }
BlobStorageRequest request
type BlobStorageResponse ¶
type BlobStorageResponse struct { Expires string `json:"expires"` Method string `json:"method"` RelativePath string `json:"relative_path"` URL string `json:"url"` MaxUploadSizeBytes int64 `json:"maxuploadsize_bytes,omitempty"` }
BlobStorageResponse response
type ConcurrencyProvider ¶
type ConcurrencyProvider interface {
GetConcurrency() int
}
type DeleteDocument ¶
type Document ¶
type Document struct { ID string Version int Message string Success bool BlobURLGet string BlobURLGetExpires string ModifiedClient string Type string VissibleName string CurrentPage int Bookmarked bool Parent string }
func (Document) ToDeleteDocument ¶
func (doc Document) ToDeleteDocument() DeleteDocument
func (Document) ToMetaDocument ¶
func (doc Document) ToMetaDocument() MetadataDocument
type EMConfig ¶
type EMConfig struct {
Remarkable EMRemarkableConfig
}
type EMConfigHolder ¶
type EMContextKey ¶
type EMContextKey struct {
ContextKey string
}
type EMRemarkableConfig ¶
type EMRemarkableConfig struct { URLs EMURLConfig `yaml:"urls"` Concurrency int }
func (EMRemarkableConfig) GetConcurrency ¶
func (e EMRemarkableConfig) GetConcurrency() int
func (EMRemarkableConfig) GetURLProvider ¶
func (e EMRemarkableConfig) GetURLProvider() URLProvider
type EMRootConfig ¶
type EMURLConfig ¶
type EMURLConfig struct { DocumentHost string `yaml:"documentHost"` AuthHost string `yaml:"authHost"` SyncHost string `yaml:"syncHost"` }
func (EMURLConfig) AuthWithPath ¶
func (e EMURLConfig) AuthWithPath(path string) string
func (EMURLConfig) DocWithPath ¶
func (e EMURLConfig) DocWithPath(path string) string
func (EMURLConfig) SyncWithPath ¶
func (e EMURLConfig) SyncWithPath(path string) string
type EMURLProvider ¶
type MetadataDocument ¶
type MetadataDocument struct { ID string Parent string VissibleName string Type string Version int ModifiedClient string }
func CreateDirDocument ¶
func CreateDirDocument(parent, name string) MetadataDocument
func CreateUploadDocumentMeta ¶
func CreateUploadDocumentMeta(id string, entryType, parent, name string) MetadataDocument
func (MetadataDocument) ToDocument ¶
func (meta MetadataDocument) ToDocument() Document
type SyncCompletedRequest ¶
type SyncCompletedRequest struct {
Generation int64 `json:"generation"`
}
SyncCompleteRequest payload of the sync completion
type URLProvider ¶
type URLProviderHolder ¶
type URLProviderHolder interface {
GetURLProvider() (URLProvider, error)
}
type UploadDocumentRequest ¶
func CreateUploadDocumentRequest ¶
func CreateUploadDocumentRequest(id string, entryType string) UploadDocumentRequest
Click to show internal directories.
Click to hide internal directories.