Documentation ¶
Index ¶
- Constants
- func CorsAllowAll(w http.ResponseWriter)
- func CorsWrap(allowPattern string, h http.Handler) http.Handler
- func Decode(item interface{}, r *http.Request) (err error)
- func DeleteById(id interface{}, url string, client *http.Client) (err error)
- func DownloadFromURL(url string, to string) (name string, err error)
- func FormatRequest(r *http.Request) string
- func FormatRequestFrom(r *http.Request) string
- func GetItems(items interface{}, url string, client *http.Client) (err error)
- func GetQueryOrFormValue(paramName string, r *http.Request) (ret string)
- func LogBody(w http.ResponseWriter, r *http.Request) bool
- func PostById(item interface{}, id interface{}, url string, client *http.Client) (err error)
- func ResponseJson(response interface{}, w http.ResponseWriter) error
- func ResponseJsonCode(response interface{}, code int, w http.ResponseWriter) (err error)
- func ResponseResultErr(err error, msg string, item interface{}, code int, w http.ResponseWriter) error
- func ResponseResultOk(msg string, item interface{}, w http.ResponseWriter) error
- type AccountToken
- type JwtController
- func (o *JwtController) ExtractToken(r *http.Request) (ret string, err error)
- func (o *JwtController) LoginHandler() http.HandlerFunc
- func (o *JwtController) Logout(w http.ResponseWriter)
- func (o *JwtController) LogoutHandler() http.HandlerFunc
- func (o *JwtController) Setup() (err error)
- func (o *JwtController) ValidateToken(w http.ResponseWriter, r *http.Request, next http.Handler)
- func (o *JwtController) ValidateTokenHandler(protected http.Handler) http.HandlerFunc
- type Response
- type Result
- type RsaKeys
- type UserCredentials
Constants ¶
View Source
const Command = "command"
View Source
const QueryType = "qType"
View Source
const QueryTypeCount = "count"
View Source
const QueryTypeExist = "exist"
View Source
const QueryTypeFind = "find"
Variables ¶
This section is empty.
Functions ¶
func CorsAllowAll ¶
func CorsAllowAll(w http.ResponseWriter)
func FormatRequest ¶
formatRequest generates ascii representation of a request
func FormatRequestFrom ¶
func ResponseJson ¶
func ResponseJson(response interface{}, w http.ResponseWriter) error
func ResponseJsonCode ¶
func ResponseJsonCode(response interface{}, code int, w http.ResponseWriter) (err error)
func ResponseResultErr ¶
func ResponseResultOk ¶
func ResponseResultOk(msg string, item interface{}, w http.ResponseWriter) error
Types ¶
type AccountToken ¶
type AccountToken struct { Account interface{} Token string `json:"token"` }
type JwtController ¶
type JwtController struct {
// contains filtered or unexported fields
}
func NewJwtController ¶
func NewJwtController(appName string, rsaKeys *RsaKeys, useHttpCookie bool, authenticator func(UserCredentials) (ret interface{}, err error)) *JwtController
func NewJwtControllerApp ¶
func NewJwtControllerApp(certsFolder string, appName string, authenticator func(UserCredentials) (ret interface{}, err error)) (ret *JwtController, err error)
func (*JwtController) ExtractToken ¶
func (o *JwtController) ExtractToken(r *http.Request) (ret string, err error)
func (*JwtController) LoginHandler ¶
func (o *JwtController) LoginHandler() http.HandlerFunc
func (*JwtController) Logout ¶
func (o *JwtController) Logout(w http.ResponseWriter)
func (*JwtController) LogoutHandler ¶
func (o *JwtController) LogoutHandler() http.HandlerFunc
func (*JwtController) Setup ¶
func (o *JwtController) Setup() (err error)
func (*JwtController) ValidateToken ¶
func (o *JwtController) ValidateToken(w http.ResponseWriter, r *http.Request, next http.Handler)
func (*JwtController) ValidateTokenHandler ¶
func (o *JwtController) ValidateTokenHandler(protected http.Handler) http.HandlerFunc
type RsaKeys ¶
type RsaKeys struct {
// contains filtered or unexported fields
}
func RsaKeysNew ¶
func (*RsaKeys) LoadOrCreate ¶
func (*RsaKeys) Private ¶
func (o *RsaKeys) Private() *rsa.PrivateKey
func (*RsaKeys) RsaPubFile ¶
type UserCredentials ¶
Click to show internal directories.
Click to hide internal directories.