Documentation ¶
Index ¶
- type AdminLog
- type Camera
- func (e *Camera) Add(env *Env) (int64, error)
- func (e *Camera) Delete(env *Env) (int64, error)
- func (e *Camera) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]Camera, int, error)
- func (e *Camera) Get(env *Env) (*Camera, error)
- func (e *Camera) Migrate(env *Env) (sql.Result, error)
- func (e *Camera) Update(env *Env) (int64, error)
- type Config
- type DB
- func (d *DB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *DB) Init(config Config, cache cachego.Cache, logger *log.Logger) error
- func (d *DB) LimitSQL(perPage int, pageNumber int) string
- func (d *DB) Migrate(env *Env) error
- func (d *DB) OrderSQL(fields []OrderFields, values []interface{}) (string, []interface{})
- func (d *DB) Query(resStruct interface{}, query string, args ...interface{}) error
- func (d *DB) WhereSQL(operator string, fields []WhereFields) (string, []interface{})
- type Email
- type Env
- type Form
- type FormField
- type List
- type ListPagination
- type ListRow
- type ListRowField
- type NumberPlate
- func (e *NumberPlate) Add(env *Env) (int64, error)
- func (e *NumberPlate) Delete(env *Env) (int64, error)
- func (e *NumberPlate) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]NumberPlate, int, error)
- func (e *NumberPlate) Get(env *Env) (*NumberPlate, error)
- func (e *NumberPlate) Migrate(env *Env) (sql.Result, error)
- func (e *NumberPlate) Update(env *Env) (int64, error)
- type OrderFields
- type Page
- type User
- func (s *User) Add(env *Env) (int64, error)
- func (s *User) CheckLogin(env *Env) (*User, bool, error)
- func (s *User) Delete(env *Env) (int64, error)
- func (s *User) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]User, int, error)
- func (s *User) Get(env *Env) (*User, error)
- func (s *User) Migrate(env *Env) (sql.Result, error)
- func (s *User) Update(env *Env) (int64, error)
- type WhereFields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminLog ¶
type AdminLog struct { ID int `json:"id"` Type string `json:"type" validate:"required"` Details string `json:"details" validate:"required"` UserID int `json:"userID" validate:"required" db:"user_id"` Time string `json:"time" validate:"required"` }
AdminLog struct
func (*AdminLog) Find ¶
func (l *AdminLog) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]AdminLog, int, error)
Find admin log entries by fields provided
type Camera ¶
type Camera struct { ID int `json:"id"` Name string `json:"name"` IPAddress string `json:"ipAddress" validate:"required" db:"ip_address"` Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` CreatedAt string `json:"createdAt" db:"created_at"` UpdatedAt string `json:"updatedAt" db:"updated_at"` }
Camera struct
func (*Camera) Find ¶
func (e *Camera) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]Camera, int, error)
Find number plates by fields provided
type Config ¶
type Config struct { HTTPHost string HTTPPort string ExternalURL string SessionKey string // SessionKey must be 16, 24 or 32 bytes long (AES-128, AES-192 or AES-256) SessionCookieName string PerPage string SMTPHost string SMTPPort string SMTPUser string SMTPPass string SMTPAuth string SMTPFrom string DBFile string }
Config struct
type DB ¶
func (*DB) OrderSQL ¶
func (d *DB) OrderSQL(fields []OrderFields, values []interface{}) (string, []interface{})
type Env ¶
type Env struct { Config Config Logger *log.Logger DB *DB Cache *cachego.Cache SessionStore *sessions.CookieStore Validator *validator.Validate ValidatorTranslator ut.Translator Templates *template.Template EmbedFS *embed.FS }
Env struct
type FormField ¶
type FormField struct { Name string Title string Type string Class string Placeholder string Value string Values []string Checked bool Required bool }
FormField struct
type ListPagination ¶
ListPagination struct
type ListRowField ¶
type ListRowField struct { Type string Value string Class string Link string Confirm string Icon string Modal string ModalTitle string FieldClass string }
ListRowField struct
type NumberPlate ¶
type NumberPlate struct { ID int `json:"id"` Plate string `json:"plate" validate:"required"` Name string `json:"name"` CreatedAt string `json:"createdAt" db:"created_at"` UpdatedAt string `json:"updatedAt" db:"updated_at"` }
NumberPlate struct
func (*NumberPlate) Delete ¶
func (e *NumberPlate) Delete(env *Env) (int64, error)
Delete number plate
func (*NumberPlate) Find ¶
func (e *NumberPlate) Find(env *Env, operator string, fields []WhereFields, perPage int, pageNumber int) (*[]NumberPlate, int, error)
Find number plates by fields provided
func (*NumberPlate) Get ¶
func (e *NumberPlate) Get(env *Env) (*NumberPlate, error)
Get number plate by ID provided
type OrderFields ¶
type OrderFields struct { Field string Value any Extra string SubFields []OrderFields }
type User ¶
type User struct { ID int `json:"id"` Email string `json:"email" validate:"omitempty,email"` Password string `json:"-" validate:"omitempty,passwd"` PasswordHash string `json:"-" db:"password_hash"` CreatedAt string `json:"createdAt" db:"created_at"` UpdatedAt string `json:"updatedAt" db:"updated_at"` }
User struct
func (*User) CheckLogin ¶
CheckLogin checks if an email and password combination are valid
type WhereFields ¶
Click to show internal directories.
Click to hide internal directories.