Documentation
¶
Index ¶
- Variables
- func CekExistData(id int) error
- func Connect() error
- func DeleteAllRoom(w http.ResponseWriter, r *http.Request) (string, error)
- func DeleteRoom(w http.ResponseWriter, r *http.Request) (string, error)
- func InitViper()
- func InsertRooms(data *Rooms) (map[string]interface{}, error)
- func LimitOffset(limit string, offset string) string
- func ShortBy(query string) string
- func UpdateRooms(r http.ResponseWriter, h *http.Request) (map[string]interface{}, error)
- type Borrow
- type ManyRooms
- type Rooms
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DB variable for connection DB postgresql DB *sql.DB )
Functions ¶
func DeleteAllRoom ¶
DeleteAllRoom function for Delete all data in table rooms
func DeleteRoom ¶
DeleteRoom function for delete one data in table rooms
func InsertRooms ¶
InsertRooms function for insert data in table Rooms
func LimitOffset ¶
LimitOffset function for get limit and offset in request API
func UpdateRooms ¶
UpdateRooms function for update data rooms
Types ¶
type Borrow ¶
type Borrow struct { ID int `json:"id,omitempty"` RoomID int `json:"room_id,omitempty"` EventName string `json:"event_name,omitempty"` Borrower string `json:"borrower,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` }
Borrow struct for get Borrow
type ManyRooms ¶
type ManyRooms []Rooms
ManyRooms strtuck for many room array
func GetBorrows ¶
GetBorrows functin for get all borrow
type Rooms ¶
type Rooms struct { RmID int `json:"rm_id,omitemp"` RmName string `json:"rm_name,omitemp"` RmPlace string `json:"rm_place,omitemp"` RmSumpart int `json:"rm_sumpart,omitemp"` RmPrice int `json:"rm_price,omitemp"` RmStatus int `json:"rm_status,omitemp"` }
Rooms struct for table ROoms
type Token ¶
type Token struct { UserID uint `json:"user_id,omitemp"` Email string `json:"email,omitemp"` TimeExp time.Time `json:"time_exp,omitemp"` jwt.StandardClaims }
Token function for response token
type User ¶
type User struct { ID int `json:"id,omitemp"` Email string `json:"email,omitemp"` Username string `json:"username,omitemp"` Password string `json:"password,omitemp"` gorm.Model }
User struct for get users struct
func (*User) CreateAccount ¶
CreateAccount function for create account for login
Click to show internal directories.
Click to hide internal directories.