Documentation
¶
Index ¶
- func ContainsValueInSlice(slice []string, value string) bool
- func DefaultUrlParamWrapper(name string) string
- func DishUrlAndMethod(dish kitchen.IDish, urlParamWrapper func(string) string) (url string, urlParams [][2]string, method string, webUrlParamMap []int)
- func ParseRequestToInput(input any, bundle kitchen.IWebBundle, webUrlParamMap []int, isWebInput bool) (processedInput any, raw []byte, err error)
- func Ternary[T any](condition bool, trueVal, falseVal T) T
- func WebReturn(a kitchen.IDish, w http.ResponseWriter, outputAny any, err error)
- type DefaultWebBundle
- func (d DefaultWebBundle) Body() ([]byte, error)
- func (d DefaultWebBundle) Ctx() context.Context
- func (d DefaultWebBundle) Headers() http.Header
- func (d DefaultWebBundle) Method() string
- func (d DefaultWebBundle) Raw() any
- func (d DefaultWebBundle) Response() http.ResponseWriter
- func (d DefaultWebBundle) Url() *url.URL
- func (d DefaultWebBundle) UrlParams() map[string]string
- type IWebCookware
- type IWebParsableInput
- type IWebWrapper
- type WebErr
- type WebWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsValueInSlice ¶
func DefaultUrlParamWrapper ¶
func DishUrlAndMethod ¶
func ParseRequestToInput ¶
Types ¶
type DefaultWebBundle ¶
type DefaultWebBundle struct {
// contains filtered or unexported fields
}
func NewDefaultWebBundle ¶
func NewDefaultWebBundle(request *http.Request, response http.ResponseWriter) DefaultWebBundle
func (DefaultWebBundle) Body ¶
func (d DefaultWebBundle) Body() ([]byte, error)
func (DefaultWebBundle) Ctx ¶
func (d DefaultWebBundle) Ctx() context.Context
func (DefaultWebBundle) Headers ¶
func (d DefaultWebBundle) Headers() http.Header
func (DefaultWebBundle) Method ¶
func (d DefaultWebBundle) Method() string
func (DefaultWebBundle) Raw ¶
func (d DefaultWebBundle) Raw() any
func (DefaultWebBundle) Response ¶
func (d DefaultWebBundle) Response() http.ResponseWriter
func (DefaultWebBundle) Url ¶
func (d DefaultWebBundle) Url() *url.URL
func (DefaultWebBundle) UrlParams ¶
func (d DefaultWebBundle) UrlParams() map[string]string
type IWebCookware ¶
type IWebCookware interface {
kitchen.ICookware
RequestParser(action kitchen.IDish, bundle kitchen.IWebBundle) (IWebCookware, error) //parse user, permission
}
IWebCookware is an interface for cookware that can be parsed from web request
type IWebParsableInput ¶
type IWebParsableInput interface {
ParseRequestToInput(kitchen.IWebBundle) (raw []byte, err error)
}
IWebParsableInput is an interface for cooker input enable parsing web request to input
type IWebWrapper ¶
type IWebWrapper interface {
FormatUrlParam(name string) string
AddMenuToRouter(instance kitchen.IInstance, prefix ...string)
}
IWebWrapper is an interface for web router wrapper
Click to show internal directories.
Click to hide internal directories.