Documentation ¶
Index ¶
- Variables
- func FixRedisEntries(ctx context.Context, rdb *redis.Client, log *logrus.Logger)
- func GetPDFTitleFromFile(inFile string) (string, error)
- func GetPDFTitleFromReadSeeker(rs io.ReadSeeker) (string, error)
- func IsPDF(filePath string) bool
- type CloudFile
- type CloudFileSyncer
- type CloudFileSyncerImpl
- type CloudUploader
- type DropboxHandler
- type DropboxSynchronizer
- type DropboxWebhookHandler
- type DummyCloudFileSyncer
- type NotionHandler
- type NotionPage
- type NotionSyncer
- type NotionSyncerImpl
- type ResponseWriterWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTitleNotFound = errors.New("title not found")
View Source
var TagNeedsEdit = "needs edit"
Functions ¶
func FixRedisEntries ¶
func GetPDFTitleFromFile ¶
func GetPDFTitleFromReadSeeker ¶
func GetPDFTitleFromReadSeeker(rs io.ReadSeeker) (string, error)
Types ¶
type CloudFileSyncer ¶
type CloudFileSyncer interface {
Sync(ctx context.Context, c *CloudFile) (*NotionPage, error)
}
CloudFileSyncer synchronizes the given CloudFile within Notion.
type CloudFileSyncerImpl ¶
type CloudFileSyncerImpl struct {
// contains filtered or unexported fields
}
func NewCloudFileSyncerImpl ¶
func NewCloudFileSyncerImpl(nh *NotionHandler, rdb *redis.Client, log *logrus.Logger) *CloudFileSyncerImpl
func (*CloudFileSyncerImpl) Sync ¶
func (cs *CloudFileSyncerImpl) Sync(ctx context.Context, c *CloudFile) (*NotionPage, error)
type CloudUploader ¶
type DropboxHandler ¶
type DropboxHandler struct {
// contains filtered or unexported fields
}
DropboxHandler handles Dropbox API.
func NewDropboxHandler ¶
func NewDropboxHandler(token string, log *logrus.Logger) *DropboxHandler
func (*DropboxHandler) ListFolder ¶
func (dh *DropboxHandler) ListFolder(path string, cursor string) ([]files.IsMetadata, string, error)
type DropboxSynchronizer ¶
type DropboxSynchronizer struct {
// contains filtered or unexported fields
}
DropboxSynchronizer ensures that all files inside a Dropbox folder are synchronized with Notion.
func NewDropboxSynchronizer ¶
func NewDropboxSynchronizer(dh *DropboxHandler, ch CloudFileSyncer, rdb *redis.Client, log *logrus.Logger) *DropboxSynchronizer
func (*DropboxSynchronizer) SyncFolder ¶
func (ds *DropboxSynchronizer) SyncFolder(ctx context.Context, path string) ([]*NotionPage, error)
type DropboxWebhookHandler ¶
type DropboxWebhookHandler struct {
// contains filtered or unexported fields
}
func NewDropboxWebhookHandler ¶
func NewDropboxWebhookHandler(path string, ds *DropboxSynchronizer, log *logrus.Logger) *DropboxWebhookHandler
func (*DropboxWebhookHandler) HandleFuncs ¶
func (dwh *DropboxWebhookHandler) HandleFuncs(router *mux.Router)
type DummyCloudFileSyncer ¶
type DummyCloudFileSyncer struct{}
func (DummyCloudFileSyncer) Sync ¶
func (ds DummyCloudFileSyncer) Sync(ctx context.Context, c *CloudFile) (*NotionPage, error)
type NotionHandler ¶
type NotionHandler struct {
// contains filtered or unexported fields
}
func NewNotionHandler ¶
func NewNotionHandler(token string, databaseID string) *NotionHandler
func (*NotionHandler) CreatePage ¶
func (nh *NotionHandler) CreatePage(ctx context.Context, c *CloudFile) (*NotionPage, error)
func (*NotionHandler) ListPages ¶
func (nh *NotionHandler) ListPages(ctx context.Context) ([]*NotionPage, error)
func (*NotionHandler) UpdatePage ¶
func (nh *NotionHandler) UpdatePage(ctx context.Context, c *CloudFile, pageID string) (*NotionPage, error)
type NotionPage ¶
func NewNotionPage ¶
func NewNotionPage(page *notionapi.Page) *NotionPage
type NotionSyncer ¶
type NotionSyncerImpl ¶
type NotionSyncerImpl struct {
// contains filtered or unexported fields
}
func NewNotionSyncerImpl ¶
func NewNotionSyncerImpl(path string, nh *NotionHandler, cu CloudUploader, rdb *redis.Client, log *logrus.Logger) *NotionSyncerImpl
func (*NotionSyncerImpl) SyncDatabase ¶
func (ns *NotionSyncerImpl) SyncDatabase(ctx context.Context) ([]*CloudFile, error)
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct { http.ResponseWriter // contains filtered or unexported fields }
func NewResponseWriterWrapper ¶
func NewResponseWriterWrapper(rww http.ResponseWriter) *ResponseWriterWrapper
func (*ResponseWriterWrapper) Status ¶
func (rww *ResponseWriterWrapper) Status() int
func (*ResponseWriterWrapper) WriteHeader ¶
func (rww *ResponseWriterWrapper) WriteHeader(statusCode int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.