Documentation ¶
Index ¶
- Variables
- func ConcatenateJSON(first, second []byte) ([]byte, error)
- func Contains(list []string, needle string) bool
- func DecryptAES(data string, key string) (string, error)
- func DecryptBytesAES(cipherText []byte, key string) ([]byte, error)
- func EncryptAES(data string, key string) (string, error)
- func EncryptBytesAES(plainText []byte, key string) ([]byte, error)
- func FormRequest(endpoint string, request interface{}, encoder Encoder, authFn interface{}) (*http.Request, error)
- func GetHashAlgorithm(sigAlgorithm jose.SignatureAlgorithm) (hash.Hash, error)
- func HashString(hash hash.Hash, s string, firstHalf bool) string
- func HttpRequest(client *http.Client, req *http.Request, response interface{}) error
- func MarshalJSON(w http.ResponseWriter, i interface{})
- func OpenBrowser(url string)
- func Sign(object interface{}, signer jose.Signer) (string, error)
- func SignPayload(payload []byte, signer jose.Signer) (string, error)
- func StartServer(ctx context.Context, port string)
- func URLEncodeResponse(resp interface{}, encoder Encoder) (string, error)
- type CookieHandler
- func (c *CookieHandler) CheckCookie(r *http.Request, name string) (string, error)
- func (c *CookieHandler) CheckQueryCookie(r *http.Request, name string) (string, error)
- func (c *CookieHandler) DeleteCookie(w http.ResponseWriter, name string)
- func (c *CookieHandler) SetCookie(w http.ResponseWriter, name, value string) error
- type CookieHandlerOpt
- type Decoder
- type Encoder
- type FormAuthorization
- type RequestAuthorization
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ConcatenateJSON ¶ added in v0.12.0
func FormRequest ¶
func GetHashAlgorithm ¶
func HttpRequest ¶
func MarshalJSON ¶
func MarshalJSON(w http.ResponseWriter, i interface{})
func OpenBrowser ¶ added in v0.6.0
func OpenBrowser(url string)
func SignPayload ¶ added in v0.12.0
func StartServer ¶ added in v0.9.0
func URLEncodeResponse ¶
Types ¶
type CookieHandler ¶
type CookieHandler struct {
// contains filtered or unexported fields
}
func NewCookieHandler ¶
func NewCookieHandler(hashKey, encryptKey []byte, opts ...CookieHandlerOpt) *CookieHandler
func (*CookieHandler) CheckCookie ¶
func (*CookieHandler) CheckQueryCookie ¶
func (*CookieHandler) DeleteCookie ¶
func (c *CookieHandler) DeleteCookie(w http.ResponseWriter, name string)
func (*CookieHandler) SetCookie ¶
func (c *CookieHandler) SetCookie(w http.ResponseWriter, name, value string) error
type CookieHandlerOpt ¶
type CookieHandlerOpt func(*CookieHandler)
func WithDomain ¶
func WithDomain(domain string) CookieHandlerOpt
func WithMaxAge ¶
func WithMaxAge(maxAge int) CookieHandlerOpt
func WithSameSite ¶
func WithSameSite(sameSite http.SameSite) CookieHandlerOpt
func WithUnsecure ¶
func WithUnsecure() CookieHandlerOpt
type FormAuthorization ¶ added in v0.12.0
type RequestAuthorization ¶ added in v0.12.0
func AuthorizeBasic ¶ added in v0.12.0
func AuthorizeBasic(user, password string) RequestAuthorization
Click to show internal directories.
Click to hide internal directories.