Documentation ¶
Index ¶
- type ChocoKacang
- func (gock *ChocoKacang) AuthToken() (token string)
- func (gock *ChocoKacang) Cookie(name string) (string, error)
- func (gock *ChocoKacang) JSON(code int, data any) Response
- func (gock *ChocoKacang) Next()
- func (gock *ChocoKacang) Render(code int, r render.Render) Response
- func (gock *ChocoKacang) SetCookie(cookie *http.Cookie)
- func (gock *ChocoKacang) Text(code int, format string, v ...any) Response
- type CustomHandler
- type DB
- type Data
- type Database
- type Handler
- type Handlers
- type Param
- type Params
- type Pool
- type Response
- type Route
- type RouteGroup
- type Router
- func (r *Router) Any(path string, handlers ...Handler)
- func (r *Router) Delete(path string, handlers ...Handler)
- func (r *Router) Get(path string, handlers ...Handler)
- func (r *Router) Group(path string, handlers ...Handler) *Router
- func (r *Router) Match(methods []string, path string, handlers ...Handler)
- func (r *Router) Patch(path string, handlers ...Handler)
- func (r *Router) Post(path string, handlers ...Handler)
- func (r *Router) Put(path string, handlers ...Handler)
- func (r *Router) Use(handlers ...Handler) Route
- type Server
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChocoKacang ¶
type ChocoKacang struct { UID int64 Config config.Config Logger *log.Logger DB *Database Request *http.Request Writer Writer Params Params // contains filtered or unexported fields }
func (*ChocoKacang) AuthToken ¶
func (gock *ChocoKacang) AuthToken() (token string)
func (*ChocoKacang) Next ¶
func (gock *ChocoKacang) Next()
func (*ChocoKacang) SetCookie ¶
func (gock *ChocoKacang) SetCookie(cookie *http.Cookie)
type CustomHandler ¶
type CustomHandler func(serve *ChocoKacang, data Data) Response
type DB ¶
type DB interface { Exec(query string, args ...any) (sql.Result, error) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) Prepare(query string) (*sql.Stmt, error) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) Query(query string, args ...any) (*sql.Rows, error) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) QueryRow(query string, args ...any) *sql.Row QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row }
type Handler ¶
type Handler func(serve *ChocoKacang) Response
type RouteGroup ¶
RouteGroup defines all router register functin inclide grouping function
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router help framework to register route path, handlers and middlewares
type Server ¶
type Server struct { Router DB *Database Config config.Config Logger *log.Logger ServerErrorHandler CustomHandler PageNotFoundHandler CustomHandler // contains filtered or unexported fields }
Server is a framework instance contains configuration, router and logger instance. Create an instance of framework, by New()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.