Documentation ¶
Index ¶
Constants ¶
View Source
const ( StaticfyStaticsPath = "./staticfy%s" StaticfyConfigYmlPath = "./staticfy/config.yml" )
Variables ¶
View Source
var MySQLSchema = `` /* 449-byte string literal not displayed */
View Source
var PostgresQLSchema = `` /* 420-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type Assets ¶
type Assets struct { ID int64 `json:"id" db:"id"` URL string `json:"url" db:"url"` CreatedAt time.Time `json:"createdAt" db:"created_at"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` UserID string `json:"userId,omitempty" db:"user_id"` FilePath string `json:"-" db:"file_path"` Host string `json:"-"` Directory string `json:"-"` Path string `json:"-"` Ext string `json:"-"` FileHeader *multipart.FileHeader `json:"-"` }
type DataSource ¶
type DataSource interface { Find(asset Assets) (Assets, error) Create(asset Assets) (Assets, error) Delete(asset Assets) error }
DataSource is the interface
func NewMySQLDataSource ¶
func NewMySQLDataSource(sqlX *sqlx.DB) DataSource
NewMySQLDataSource is instance
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem custom file system handler
type Handler ¶
type Handler interface { UploadHandler(static Staticfy) func(w http.ResponseWriter, r *http.Request) DeleteHandler(static Staticfy) func(w http.ResponseWriter, r *http.Request) }
Handler the interface
type Repository ¶
type Repository interface { CreateFile(asset Assets) (Assets, error) DeleteFile(asset Assets) (Assets, error) }
func NewRepository ¶
func NewRepository(fileX filex.FileX, dataSource DataSource, mySQLSource DataSource) Repository
type Route ¶
type Route struct { Path string `yaml:"path"` Method string `yaml:"method"` Support []string `yaml:"support"` Directory string `yaml:"directory"` }
Route is a model
Click to show internal directories.
Click to hide internal directories.