Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorWrongOTPCode = "Wrong OTP Code" ErrorWrongLoginInfo = "Wrong Email/Phonenumber or Password" ErrorIdentifierAlreadyExist = "Email/Phonenumber Already Registered on Your Company" ErrorNotUpdateRowNotExist = "Cannot Update, Row is Not Existed" )
Variables ¶
This section is empty.
Functions ¶
func ContextWithDuration ¶
func ContextWithDuration() (context.Context, context.CancelFunc)
ContextWithDuration creates context with timeout
func RandomBase64 ¶
func RandomBase64() string
Types ¶
type DBTx ¶
type DBTx interface { Exec(query string, args ...interface{}) (sql.Result, error) Prepare(query string) (*sql.Stmt, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row }
DBTx is used as an interface for sqlx.Tx and sqlx.DB
type Pagination ¶
Pagination is the structure data for pagination
func ParsePaginationForm ¶
func ParsePaginationForm(r *http.Request) (Pagination, error)
ParsePaginationForm is used to Parse Pagination Form from request
type PaginationRepo ¶
PaginationRepo is used as pagination when listing data Why using lastID instead of offset? Because in mysql, using limit X, Y will read X + Y rows, instead of only Y rows. Mysql reads all X + Y rows, then drop rows before X. Read this for more explanation: https://stackoverflow.com/questions/3799193/mysql-data-best-way-to-implement-paging#comment4027585_3799223
Click to show internal directories.
Click to hide internal directories.