Documentation ¶
Index ¶
- type Database
- type Encryption
- type Rasant
- func (ras *Rasant) BuildDSN() string
- func (ras *Rasant) CreateDirIfNotExist(path string) error
- func (ras *Rasant) CreateFileIfNotExist(path string) error
- func (ras *Rasant) DownloadFile(w http.ResponseWriter, r *http.Request, pathToFile, fileName string) error
- func (ras *Rasant) Error404(w http.ResponseWriter, r *http.Request)
- func (ras *Rasant) Error500(w http.ResponseWriter, r *http.Request)
- func (ras *Rasant) ErrorForbidden(w http.ResponseWriter, r *http.Request)
- func (ras *Rasant) ErrorStatus(w http.ResponseWriter, status int)
- func (ras *Rasant) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
- func (ras *Rasant) Init(p initPaths) error
- func (ras *Rasant) ListenAndServe()
- func (ras *Rasant) LoadTime(start time.Time)
- func (ras *Rasant) MigrateDownAll(dsn string) error
- func (ras *Rasant) MigrateForce(dsn string) error
- func (ras *Rasant) MigrateUp(dsn string) error
- func (ras *Rasant) New(rootPath string) error
- func (ras *Rasant) NoSurf(next http.Handler) http.Handler
- func (res *Rasant) OpenDB(dbType, dsn string) (*sql.DB, error)
- func (ras *Rasant) RandomString(n int) string
- func (ras *Rasant) ReadJSON(w http.ResponseWriter, r *http.Request, data interface{}) error
- func (ras *Rasant) SessionLoad(next http.Handler) http.Handler
- func (ras *Rasant) Steps(n int, dsn string) error
- func (ras *Rasant) Validator(data url.Values) *Validation
- func (ras *Rasant) WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- func (ras *Rasant) WriteXML(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
- 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 Encryption ¶ added in v0.0.15
type Encryption struct {
Key []byte
}
type Rasant ¶
type Rasant 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{} // contains filtered or unexported fields }
Rasant is the overall type for the Rasant package. Members that are exported in this type are available to any application that uses it.
func (*Rasant) CreateDirIfNotExist ¶
func (*Rasant) CreateFileIfNotExist ¶
func (*Rasant) DownloadFile ¶ added in v0.0.15
func (*Rasant) Error404 ¶ added in v0.0.15
func (ras *Rasant) Error404(w http.ResponseWriter, r *http.Request)
func (*Rasant) Error500 ¶ added in v0.0.15
func (ras *Rasant) Error500(w http.ResponseWriter, r *http.Request)
func (*Rasant) ErrorForbidden ¶ added in v0.0.15
func (ras *Rasant) ErrorForbidden(w http.ResponseWriter, r *http.Request)
func (*Rasant) ErrorStatus ¶ added in v0.0.15
func (ras *Rasant) ErrorStatus(w http.ResponseWriter, status int)
func (*Rasant) ErrorUnauthorized ¶ added in v0.0.15
func (ras *Rasant) ErrorUnauthorized(w http.ResponseWriter, r *http.Request)
func (*Rasant) ListenAndServe ¶
func (ras *Rasant) ListenAndServe()
ListenAndServe starts the web server
func (*Rasant) MigrateDownAll ¶ added in v0.0.13
func (*Rasant) MigrateForce ¶ added in v0.0.13
func (*Rasant) New ¶
New reads the .env file, creates our application config, populates the Rasant type with settings based on .env values, and creates necessary folders and files if they don't exist
func (*Rasant) RandomString ¶ added in v0.0.11
RandomString generates a random string length n from values in the const randomString
func (*Rasant) SessionLoad ¶ added in v0.0.7
func (*Rasant) Validator ¶ added in v0.0.15
func (ras *Rasant) Validator(data url.Values) *Validation
type Validation ¶ added in v0.0.15
func (*Validation) AddError ¶ added in v0.0.15
func (v *Validation) AddError(key, message string)
func (*Validation) Check ¶ added in v0.0.15
func (v *Validation) Check(ok bool, key, message string)
func (*Validation) Has ¶ added in v0.0.15
func (v *Validation) Has(field string, r *http.Request) bool
func (*Validation) IsDateISO ¶ added in v0.0.15
func (v *Validation) IsDateISO(field, value string)
func (*Validation) IsEmail ¶ added in v0.0.15
func (v *Validation) IsEmail(field, value string)
func (*Validation) IsFloat ¶ added in v0.0.15
func (v *Validation) IsFloat(field, value string)
func (*Validation) IsInt ¶ added in v0.0.15
func (v *Validation) IsInt(field, value string)
func (*Validation) NoSpaces ¶ added in v0.0.15
func (v *Validation) NoSpaces(field, value string)
func (*Validation) Required ¶ added in v0.0.15
func (v *Validation) Required(r *http.Request, fields ...string)
func (*Validation) Valid ¶ added in v0.0.15
func (v *Validation) Valid() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.