Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSV ¶
type CSV struct{}
Data about CSV
func (CSV) ExportAsFile ¶
func (exportCSV CSV) ExportAsFile(datas []model.Article, handler HandlerServer) error
Export articles as CSV file from browser Go in context.go file to understand HandlerServer
type Context ¶
type Context struct { FileType ExportArticles Articles []model.Article Handler HandlerServer }
Context : Get context export Design pattern strategy ExportArticles is an interface in iExport implemented in csv.go and xlsx.go files
func NewContext ¶
func NewContext(e ExportArticles, a []model.Article, h HandlerServer) *Context
NewContext() : Init new context
func (*Context) MakeExport ¶
MakeExport() : Make export according to the context (CSV or XLSX)
type ExportArticles ¶
type ExportArticles interface {
ExportAsFile(datas []model.Article, handler HandlerServer) error
}
ExportArticles : Export all articles from browser
type HandlerServer ¶
type HandlerServer struct { Writer http.ResponseWriter Request *http.Request }
HandlerServer : Current handler params useful to make export from browser
type XLSX ¶
type XLSX struct{}
Data about XLSX
func (XLSX) ExportAsFile ¶
func (exportXLSX XLSX) ExportAsFile(datas []model.Article, handler HandlerServer) error
Export articles XLSX CSV file from browser Go in context.go file to understand HandlerServer
Click to show internal directories.
Click to hide internal directories.