This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
e621-sdk-go/pkg/e621/builder/export_file.go
2023-11-15 13:21:13 +01:00

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)
}