41 lines
857 B
Go
41 lines
857 B
Go
/*
|
|
DESCRIPTION:
|
|
Sample of the use-case that has fully CRUD functionality. Uses object with CRUD
|
|
functions to satisfy CRUD interface so it will be able to be generated into
|
|
CRUD routing.
|
|
|
|
Functions other than CRUD can be writen outside the object.
|
|
*/
|
|
package crud
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type myBase struct{}
|
|
|
|
var O myBase
|
|
|
|
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
|
// MULAI MEETING E
|
|
// JIKA SUATU SAAT MAU OUTPUT XML, HANDLER YG MELAKUKAN
|
|
// BUKAN CASE
|
|
// YES MIRIP HANDLER
|
|
// MEETING E MULAI
|
|
}
|
|
|
|
func (obj myBase) Read(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
|
|
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
|
|
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
|
|
func OtherFunc(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
|
|
func AnotherFunc(w http.ResponseWriter, r *http.Request) {
|
|
}
|