Documentation ¶
Index ¶
- type Celeritas
- func (c *Celeritas) BuildDSN() string
- func (c *Celeritas) CreateDirIfNotExist(path string) error
- func (c *Celeritas) CreateFileIfNotExist(path string) error
- func (c *Celeritas) DownloadFile(w http.ResponseWriter, r *http.Request, pathToFile, fileName string) error
- func (c *Celeritas) Error404(w http.ResponseWriter, r *http.Request)
- func (c *Celeritas) Error500(w http.ResponseWriter, r *http.Request)
- func (c *Celeritas) ErrorForbidden(w http.ResponseWriter, r *http.Request)
- func (c *Celeritas) ErrorStatus(w http.ResponseWriter, status int)
- func (c *Celeritas) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
- func (c *Celeritas) Init(p initPaths) error
- func (c *Celeritas) ListenAndServe()
- func (c *Celeritas) MigrateDownAll(dsn string) error
- func (c *Celeritas) MigrateForce(dsn string) error
- func (c *Celeritas) MigrateSteps(n int, dsn string) error
- func (c *Celeritas) MigrateUp(dsn string) error
- func (c *Celeritas) New(rootPath string) error
- func (c *Celeritas) NoSurf(next http.Handler) http.Handler
- func (c *Celeritas) OpenDB(dbType, dsn string) (*sql.DB, error)
- func (c *Celeritas) RandomString(n int) string
- func (c *Celeritas) ReadJSON(w http.ResponseWriter, r *http.Request, data interface{}) error
- func (c *Celeritas) SessionLoad(next http.Handler) http.Handler
- func (c *Celeritas) Validator(data url.Values) *Validation
- func (c *Celeritas) WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- func (c *Celeritas) WriteXML(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- type Database
- type Encryption
- type Server
- type Validation
- func (v *Validation) AddError(key, message string)
- func (v *Validation) Check(ok bool, key, message string)
- func (v *Validation) Has(field string, r *http.Request) bool
- func (v *Validation) IsDateISO(field, value string)
- func (v *Validation) IsEMail(field, value string)
- func (v *Validation) IsFloat(field, value string)
- func (v *Validation) IsInt(field, value string)
- func (v *Validation) NoSpaces(field, value 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 ¶
This section is empty.
Types ¶
type Celeritas ¶
type Celeritas 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 // contains filtered or unexported fields }
func (*Celeritas) CreateDirIfNotExist ¶
func (*Celeritas) CreateFileIfNotExist ¶
func (*Celeritas) DownloadFile ¶
func (*Celeritas) ErrorForbidden ¶
func (c *Celeritas) ErrorForbidden(w http.ResponseWriter, r *http.Request)
func (*Celeritas) ErrorStatus ¶
func (c *Celeritas) ErrorStatus(w http.ResponseWriter, status int)
func (*Celeritas) ErrorUnauthorized ¶
func (c *Celeritas) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
func (*Celeritas) ListenAndServe ¶
func (c *Celeritas) ListenAndServe()
Starts the Standard Webserver
func (*Celeritas) MigrateDownAll ¶
func (*Celeritas) MigrateForce ¶
func (*Celeritas) RandomString ¶
Generate a Random String
type Encryption ¶
type Encryption struct {
Key []byte
}
type Validation ¶
func (*Validation) AddError ¶
func (v *Validation) AddError(key, message string)
func (*Validation) Check ¶
func (v *Validation) Check(ok bool, key, message string)
func (*Validation) IsDateISO ¶
func (v *Validation) IsDateISO(field, value string)
func (*Validation) IsEMail ¶
func (v *Validation) IsEMail(field, value string)
func (*Validation) IsFloat ¶
func (v *Validation) IsFloat(field, value string)
func (*Validation) IsInt ¶
func (v *Validation) IsInt(field, value string)
func (*Validation) NoSpaces ¶
func (v *Validation) NoSpaces(field, value string)
func (*Validation) Valid ¶
func (v *Validation) Valid() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.