Documentation ¶
Index ¶
- Variables
- func ExtractFirstNumber(input []byte) (int32, int, error)
- func GenerateSecrets(length int) (string, error)
- func GenerateTokens(username string, tokenSecret string, refreshTokenSecret string, ...) (string, string, error)
- func GetEnv(key, defaultValue string) string
- func HTTPGet(url string, queryParams map[string]string, timeout time.Duration, ...) (*http.Response, error)
- func HTTPPost(url string, body []byte, headers map[string]string, ctx context.Context, ...) error
- func JoinStrings(strs []string, separator string) string
- func ParseJSON(in string, data interface{}) error
- func ParseQueryParams(r *http.Request, inParams ...types.Param) (map[string]string, error)
- func ParseRequest(r *http.Request, data interface{}) error
- func ParseResponse(resp *http.Response, data interface{}) error
- func ParseTime(ti string) (time.Time, error)
- func RefreshToken(tokenString string, secret string, duration time.Duration) (string, error)
- func SetCookie(w http.ResponseWriter, name string, value string, expires time.Duration, ...)
- func SplitString(str string, separator rune) []string
- func ValidateToken(tokenString string, secret string, username string) (bool, error)
- func WriteError(w http.ResponseWriter, status int, err error)
- func WriteJSON(w http.ResponseWriter, status int, v any) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoToken = fmt.Errorf("no token provided")
Functions ¶
func GenerateSecrets ¶
func GenerateTokens ¶
func JoinStrings ¶
func ParseQueryParams ¶
func ParseRequest ¶
func ParseResponse ¶
func RefreshToken ¶
func SplitString ¶
func ValidateToken ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, status int, err error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.