Documentation ¶
Index ¶
- func Routes() http.Handler
- type Database
- type Encryption
- type Fenix
- func (f *Fenix) BuildDSN() string
- func (f *Fenix) CheckForMaintenanceMode(next http.Handler) http.Handler
- func (f *Fenix) CreateDirIfNotExist(path string) error
- func (f *Fenix) CreateFileIfNotExists(path string) error
- func (f *Fenix) CreatePopMigration(up, down []byte, migrationName, migrationType string) error
- func (f *Fenix) DownloadFile(w http.ResponseWriter, r *http.Request, pathToFile, fileName string) error
- func (f *Fenix) ErrorBadRequest(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorForbidden(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorIntServerErr(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorMethodNotAllowed(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorNotFound(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorServiceUnavailable(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) ErrorStatus(w http.ResponseWriter, status int)
- func (f *Fenix) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
- func (f *Fenix) FetchPage(pageURL string) *rod.Page
- func (f *Fenix) Init(p initPaths) error
- func (f *Fenix) ListenAndServe() error
- func (f *Fenix) LoadTime(start time.Time)
- func (f *Fenix) MigrateDownAll(dsn string) error
- func (f *Fenix) MigrateForce(dsn string) error
- func (f *Fenix) MigrateUp(dsn string) error
- func (f *Fenix) New(rootPath string) error
- func (f *Fenix) NoSurf(next http.Handler) http.Handler
- func (f *Fenix) OpenDB(dbType, dsn string) (*sql.DB, error)
- func (f *Fenix) PopConnect() (*pop.Connection, error)
- func (f *Fenix) PopMigrateReset(tx *pop.Connection) error
- func (f *Fenix) PopMigrationDown(tx *pop.Connection, steps ...int) error
- func (f *Fenix) RandomString(n int) (string, error)
- func (f *Fenix) ReadJSON(w http.ResponseWriter, r *http.Request, data interface{}) error
- func (f *Fenix) RunPopMigrations(tx *pop.Connection) error
- func (f *Fenix) SelectElementByID(page *rod.Page, id string) *rod.Element
- func (f *Fenix) SessionLoad(next http.Handler) http.Handler
- func (f *Fenix) Steps(n int, dsn string) error
- func (f *Fenix) TakeScreenShot(pageURL, testName string, w, h float64)
- func (f *Fenix) UploadFile(r *http.Request, destination, field string, fs filesystems.FS) error
- func (f *Fenix) Validator(data url.Values) *Validation
- func (f *Fenix) WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- func (f *Fenix) WriteXML(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- type RPCServer
- type Server
- type Validation
- func (v *Validation) AddError(key, msg string)
- func (v *Validation) Check(ok bool, key, msg string)
- func (v *Validation) Has(field string, r *http.Request) bool
- func (v *Validation) IsDateISO(field, val string)
- func (v *Validation) IsDateMMDDYYYY(field, val string)
- func (v *Validation) IsEmail(field, val string)
- func (v *Validation) IsFloat(field, val string)
- func (v *Validation) IsInt(field, val string)
- func (v *Validation) NoSpaces(field, val string)
- func (v *Validation) Required(r *http.Request, fields ...string)
- func (v *Validation) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encryption ¶
type Encryption struct {
Key []byte
}
type Fenix ¶
type Fenix struct { AppName string Debug bool Version string ErrorLog *log.Logger InfoLog *log.Logger RootPath string Routes *chi.Mux Render *render.Render Session *scs.SessionManager DB Database JetViews *jet.Set EncryptionKey string Cache cache.Cache Scheduler *cron.Cron Mail mailer.Mail Server Server FileSystems map[string]interface{} S3 s3filesystem.S3 SFTP sftpfilesystem.SFTP WebDAV webdavfilesystem.WebDAV Minio miniofilesystem.Minio // contains filtered or unexported fields }
func (*Fenix) BuildDSN ¶
BuildDSN builds the datasource name of the database, then returns as a string
func (*Fenix) CheckForMaintenanceMode ¶
func (*Fenix) CreateDirIfNotExist ¶
func (*Fenix) CreateFileIfNotExists ¶
func (*Fenix) CreatePopMigration ¶
CreatePopMigration is a wrapper for pop that writes contents for the given migration
func (*Fenix) DownloadFile ¶
func (f *Fenix) DownloadFile(w http.ResponseWriter, r *http.Request, pathToFile, fileName string) error
Download file
func (*Fenix) ErrorBadRequest ¶
func (f *Fenix) ErrorBadRequest(w http.ResponseWriter, r *http.Request)
Status 400 - Bad Request: The server cannot process the request due to a client error, such as invalid syntax or missing parameters.
func (*Fenix) ErrorForbidden ¶
func (f *Fenix) ErrorForbidden(w http.ResponseWriter, r *http.Request)
Status 403 - Forbidden: The server understands the request, but the client is not allowed to access the requested resource.
func (*Fenix) ErrorIntServerErr ¶
func (f *Fenix) ErrorIntServerErr(w http.ResponseWriter, r *http.Request)
Status 500 - Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request.
func (*Fenix) ErrorMethodNotAllowed ¶
func (f *Fenix) ErrorMethodNotAllowed(w http.ResponseWriter, r *http.Request)
Status 405 - Method Not Allowed: The request method is not supported for the requested resource.
func (*Fenix) ErrorNotFound ¶
func (f *Fenix) ErrorNotFound(w http.ResponseWriter, r *http.Request)
Status 404 - Not Found: The server could not find the requested resource.
func (*Fenix) ErrorServiceUnavailable ¶
func (f *Fenix) ErrorServiceUnavailable(w http.ResponseWriter, r *http.Request)
Status 503 - Service Unavailable: The server is currently unavailable, often due to maintenance or overload.
func (*Fenix) ErrorStatus ¶
func (f *Fenix) ErrorStatus(w http.ResponseWriter, status int)
Error status helper function
func (*Fenix) ErrorUnauthorized ¶
func (f *Fenix) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
Status 401 - Unauthorized: The request requires authentication, and the client does not provide valid credentials.
func (*Fenix) ListenAndServe ¶
func (*Fenix) MigrateDownAll ¶
func (*Fenix) MigrateForce ¶
func (*Fenix) PopConnect ¶
func (f *Fenix) PopConnect() (*pop.Connection, error)
popConnect connects to the buffalo/pop library to leverage multiple db migrations
func (*Fenix) PopMigrateReset ¶
func (f *Fenix) PopMigrateReset(tx *pop.Connection) error
is a wrapper that resets the migration, runs down the migration in reverse order and migrations up
func (*Fenix) PopMigrationDown ¶
func (f *Fenix) PopMigrationDown(tx *pop.Connection, steps ...int) error
PopMigrationDown is a wrapper that migrates down to roll back to previous db
func (*Fenix) RunPopMigrations ¶
func (f *Fenix) RunPopMigrations(tx *pop.Connection) error
RunPopMigrations is wrapper for pop to migrate up one or more migrations
func (*Fenix) SelectElementByID ¶
func (*Fenix) TakeScreenShot ¶
func (*Fenix) UploadFile ¶
type Validation ¶
func (*Validation) AddError ¶
func (v *Validation) AddError(key, msg string)
func (*Validation) Check ¶
func (v *Validation) Check(ok bool, key, msg string)
func (*Validation) IsDateISO ¶
func (v *Validation) IsDateISO(field, val string)
func (*Validation) IsDateMMDDYYYY ¶
func (v *Validation) IsDateMMDDYYYY(field, val string)
func (*Validation) IsEmail ¶
func (v *Validation) IsEmail(field, val string)
func (*Validation) IsFloat ¶
func (v *Validation) IsFloat(field, val string)
func (*Validation) IsInt ¶
func (v *Validation) IsInt(field, val string)
func (*Validation) NoSpaces ¶
func (v *Validation) NoSpaces(field, val string)
func (*Validation) Valid ¶
func (v *Validation) Valid() bool