Documentation
¶
Overview ¶
Package upload contains the upload request type, directory scanner, batcher, and batch runner used by the upload and bulk subcommands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentUploadRequest ¶
type DocumentUploadRequest struct {
LocalPath string // resolved absolute path
DisplayName string // filename sent to the server
SizeBytes int64 // from os.Stat
MTime time.Time // from os.Stat
Title *string // nil → server default
Labels []string
OCREnabled *bool
Language *string
}
DocumentUploadRequest is the intent to upload one local file. Field names match data-model.md §DocumentUploadRequest.
func NewFromPath ¶
func NewFromPath(path string) (*DocumentUploadRequest, error)
NewFromPath builds a request from a filesystem path, statting the file to populate size and mtime. Returns a CLIError with CodeNoInput if the path does not exist or is not a regular file.
func (*DocumentUploadRequest) SetLanguage ¶
func (r *DocumentUploadRequest) SetLanguage(s string)
SetLanguage stores the language via pointer; empty string → nil.
func (*DocumentUploadRequest) SetOCR ¶
func (r *DocumentUploadRequest) SetOCR(b *bool)
SetOCR stores the OCR flag via pointer; callers pass nil to omit.
func (*DocumentUploadRequest) SetTitle ¶
func (r *DocumentUploadRequest) SetTitle(s string)
SetTitle is a convenience setter that stores s via a pointer, treating the empty string as "no title" (nil).
func (*DocumentUploadRequest) Validate ¶
func (r *DocumentUploadRequest) Validate() error
Validate checks optional-field shapes. LocalPath/SizeBytes/MTime are guaranteed to be populated by NewFromPath; Validate covers the user-supplied fields.