Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapToDocumentIDs ¶
func MapToDocumentMap ¶
Types ¶
type BulkDownloadContent ¶
type BulkDownloadContent string
const ( BulkDownloadBoth BulkDownloadContent = "both" BulkDownloadArchives BulkDownloadContent = "archive" BulkDownloadOriginal BulkDownloadContent = "originals" )
func (BulkDownloadContent) String ¶
func (c BulkDownloadContent) String() string
String implements fmt.Stringer.
type BulkDownloadParams ¶
type BulkDownloadParams struct { DocumentIDs []int FollowFormatting bool Content BulkDownloadContent }
type Client ¶
func NewClient ¶
NewClient creates a new PaperlessClient using the given URL and credentials. If using token auth, `username` parameter can be left empty.
func (*Client) BulkDownload ¶
func (clt *Client) BulkDownload(ctx context.Context, targetFile *os.File, params BulkDownloadParams) error
BulkDownload downloads the documents identified by BulkDownloadParams.DocumentIDs and saves to the given targetPath. If targetPath is empty, it will use the suggested file name from Paperless in the current working dir.
func (*Client) QueryDocuments ¶
type Document ¶
type Document struct { // ID of the document, read-only. ID int `json:"id"` // OriginalFileName of the original document, read-only. OriginalFileName string `json:"original_file_name,omitempty"` // ArchivedFileName of the archived document, read-only. // May be empty if no archived document is available. ArchivedFileName string `json:"archived_file_name,omitempty"` }
type QueryParams ¶
type QueryResult ¶
type QueryResult struct { Results []Document `json:"results,omitempty"` Next string `json:"next,omitempty"` }
func (QueryResult) NextPage ¶
func (r QueryResult) NextPage() int64
NextPage returns the next page number for pagination. It returns 1 if QueryResult.Next is empty (first page), or 0 if there's an error parsing QueryResult.Next.
Click to show internal directories.
Click to hide internal directories.