Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FormatCSV is the csv format FormatCSV = "csv" // FormatXLSX is the xlsx format FormatXLSX = "xlsx" )
View Source
const ( // ExportCollectionField is the field name for the export collection PocketExportCollectionName = "pocketexport_exports" // ExportCollectionNameField is the field name for the export collection ExportCollectionNameField = "exportCollectionName" // OwnerIdField is the field name for the owner id OwnerIdField = "ownerId" // OwnerCollectionNameField is the field name for the owner collection name OwnerCollectionNameField = "ownerCollectionName" // FilterField is the field name for the export filter FilterField = "filter" // SortField is the field name for the export sort SortField = "sort" // HeadersField is the field name for the export headers HeadersField = "headers" // FormatField is the field name for the export format FormatField = "format" // OutputField is the field name for the export output OutputField = "output" )
Variables ¶
View Source
var (
ErrIsNotExport = validation.NewError("validation_is_not_export", "is not export")
)
Functions ¶
Types ¶
type Export ¶
Export represents an export
func (*Export) AuthRecord ¶
AuthRecord return the auth record, can be null
func (*Export) ExportCollection ¶
func (e *Export) ExportCollection() *models.Collection
ExportCollection return the export collection
type HeaderItem ¶
type IPocketExport ¶
type IPocketExport interface { // ValidateAndFill validates the record and fills the export // this function should be called after using form validation because // it does not fully validate the record ValidateAndFill(*models.Record) (*Export, error) // GenerateExportOutput generates the output for the export GenerateExportOutput(io.Writer, *Export) error }
type PocketExport ¶
type PocketExport struct {
// contains filtered or unexported fields
}
func (*PocketExport) GenerateExportOutput ¶
func (p *PocketExport) GenerateExportOutput(dst io.Writer, r *Export) error
GenerateExportOutput implement PocketExport interface
func (*PocketExport) Register ¶
func (p *PocketExport) Register(opts ...RegisterOption) error
Register implement PocketExport interface
func (*PocketExport) ValidateAndFill ¶
func (p *PocketExport) ValidateAndFill(r *models.Record) (*Export, error)
ValidateRecord implement PocketExport interface
type RegisterOption ¶
type RegisterOption func(*registerConfig)
func AutoDelete ¶
func AutoDelete(d bool) RegisterOption
AutoDelete sets the autoDelete option if d is true, the export will be deleted automatically after create new export
func AutoDeleteDuration ¶
func AutoDeleteDuration(d time.Duration) RegisterOption
AutoDeleteDuration sets the autoDeleteDuration option
func GenerateInBackground ¶
func GenerateInBackground(g bool) RegisterOption
GenerateInBackground sets the generateOutputInBackground option if g is true, the export output will be generated in background
Click to show internal directories.
Click to hide internal directories.