Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Type Type `toml:"type"`
Debug bool `toml:"debug"`
ExpireAfter timex.Duration `toml:"expire_after"`
CleanupInterval timex.Duration `toml:"cleanup_interval"`
// SQLite
Path string `toml:"path"`
// PostgreSQL
Host string `toml:"host"`
Port int `toml:"port"`
Username string `toml:"username"`
Password string `toml:"password"`
Database string `toml:"database"`
SSLMode string `toml:"ssl_mode"`
}
func (Config) PostgresDataSourceName ¶
type DB ¶
type DB interface {
gomigrate.Queryer
GetDocument(ctx context.Context, documentID string) ([]File, error)
GetDocumentVersion(ctx context.Context, documentID string, documentVersion int64) ([]File, error)
GetVersionCount(ctx context.Context, documentID string) (int, error)
GetDocumentVersions(ctx context.Context, documentID string) ([]int64, error)
GetDocumentVersionsWithFiles(ctx context.Context, documentID string, withContent bool) (map[int64][]File, error)
CreateDocument(ctx context.Context, files []File) (*string, *int64, error)
UpdateDocument(ctx context.Context, documentID string, files []File) (*int64, error)
DeleteDocument(ctx context.Context, documentID string) (*Document, error)
DeleteDocumentVersion(ctx context.Context, documentID string, documentVersion int64) (*Document, error)
DeleteDocumentVersions(ctx context.Context, documentID string) error
DeleteExpiredDocuments(ctx context.Context, expireAfter time.Duration) ([]Document, error)
GetDocumentFile(ctx context.Context, documentID string, fileName string) (*File, error)
GetDocumentFileVersion(ctx context.Context, documentID string, documentVersion int64, fileName string) (*File, error)
DeleteDocumentFile(ctx context.Context, documentID string, fileName string) error
DeleteDocumentVersionFile(ctx context.Context, documentID string, documentVersion int64, fileName string) error
GetWebhook(ctx context.Context, documentID string, webhookID string, secret string) (*Webhook, error)
GetWebhooksByDocumentID(ctx context.Context, documentID string) ([]Webhook, error)
GetAndDeleteWebhooksByDocumentID(ctx context.Context, documentID string) ([]Webhook, error)
CreateWebhook(ctx context.Context, documentID string, url string, secret string, events []string) (*Webhook, error)
UpdateWebhook(ctx context.Context, documentID string, webhookID string, secret string, newURL string, newSecret string, newEvents []string) (*Webhook, error)
DeleteWebhook(ctx context.Context, documentID string, webhookID string, secret string) error
Close() error
}
Click to show internal directories.
Click to hide internal directories.