32 lines
730 B
Go
32 lines
730 B
Go
|
package builder
|
||
|
|
||
|
import (
|
||
|
"git.dragse.it/anthrove/e621-sdk-go/pkg/e621/endpoints"
|
||
|
"git.dragse.it/anthrove/e621-sdk-go/pkg/e621/model"
|
||
|
)
|
||
|
|
||
|
type DBExportFileBuilder interface {
|
||
|
SetFile(fileName string) DBExportFileBuilder
|
||
|
Execute() ([]byte, error)
|
||
|
}
|
||
|
|
||
|
func NewGetDBExportFileBuilder(requestContext model.RequestContext) DBExportFileBuilder {
|
||
|
return &getDBExportFile{
|
||
|
requestContext: requestContext,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
type getDBExportFile struct {
|
||
|
requestContext model.RequestContext
|
||
|
fileName string
|
||
|
}
|
||
|
|
||
|
func (g *getDBExportFile) SetFile(fileName string) DBExportFileBuilder {
|
||
|
g.fileName = fileName
|
||
|
return g
|
||
|
}
|
||
|
|
||
|
func (g *getDBExportFile) Execute() ([]byte, error) {
|
||
|
return endpoints.GetDBExportFile(g.requestContext, g.fileName)
|
||
|
}
|