Documentation
¶
Index ¶
- Variables
- func IntFormParam(c echo.Context, name string) (int64, bool, error)
- func IntFormParamD(c echo.Context, name string, defval int64) (int64, bool, error)
- func IntQueryParam(c echo.Context, name string) (int64, bool, error)
- func IntQueryParamD(c echo.Context, name string, defval int64) (int64, bool, error)
- func JSONError(c echo.Context, err error) error
- func JSONErrorC(c echo.Context, code int, err error) error
- func JSONErrorf(c echo.Context, errCode string, format string, args ...interface{}) error
- func JSONFormParam(c echo.Context, name string, v interface{}) (bool, error)
- func JSONOk(c echo.Context) error
- func JSONResult(c echo.Context, result interface{}) error
- type Config
- type IPNet
- type Response
- type Server
- type ServicePlugResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Ok = Response{Ok: true}
Ok Response
Functions ¶
func IntFormParam ¶
IntFormParam int form param
func IntFormParamD ¶
IntFormParamD int form param with default
func IntQueryParam ¶
IntQueryParam int query param
func IntQueryParamD ¶
IntQueryParamD int query param with default
func JSONErrorC ¶
JSONErrorC json error with code
func JSONErrorf ¶
JSONErrorf json error format
func JSONFormParam ¶
JSONFormParam json form param
Types ¶
type Config ¶
type Config struct {
Listen string `default:"127.0.0.1:4433"`
CertFile string `default:"apicert.pem"`
KeyFile string `default:"apikey.pem"`
StopTimeout time.Duration `default:"60s" yaml:"stop_timeout"`
PermitPublicServiceQuery bool `default:"true"`
DevNets []IPNet
}
Config api server config
type Response ¶
type Response struct {
Ok bool `json:"ok"`
Result interface{} `json:"result,omitempty"`
Error interface{} `json:"error,omitempty"`
}
Response simple response
type Server ¶
type Server struct {
ProtoSwitch bool
// contains filtered or unexported fields
}
Server api server
type ServicePlugResult ¶
ServicePlugResult service plug result
Click to show internal directories.
Click to hide internal directories.