Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func GetIntValueFromStr(c context.Context, key string) (int, bool)
- func GetJwtToken(secretKey string, iat, seconds int64, payload string) (string, error)
- func GetJwtTokenFromMap(secretKey string, iat, seconds int64, payload map[string]string) (string, error)
- func GetValue[T any](c context.Context, key string) (T, bool)
- func HashPassword(password string) (string, error)
- func IsInteger(str string) bool
- func LoadClientConfig(content []byte, strict bool) (*v1.ClientCommonConfig, []v1.ProxyConfigurer, []v1.VisitorConfigurer, error)
- func LoadClientConfigNormal(content []byte, strict bool) (*v1.ClientConfig, error)
- func LoadConfigureFromContent(content []byte, c any, strict bool) error
- func LoadContentWithTemplate(content []byte, values *config.Values) ([]byte, error)
- func LoadServerConfig(content []byte, strict bool) (*v1.ServerConfig, error)
- func MD5(input string) string
- func NewBaseFRPClientConfig(serverAddr string, serverPort int, token string) *v1.ClientCommonConfig
- func NewBaseFRPClientUserAuthConfig(serverAddr string, serverPort int, user, token string) *v1.ClientCommonConfig
- func NewBaseFRPServerConfig(port int, token string) *v1.ServerConfig
- func NewBaseFRPServerUserAuthConfig(port int, opts []v1.HTTPPluginOptions) *v1.ServerConfig
- func ParseToken(secretKey, tokenStr string) (u jwt.MapClaims, err error)
- func PemBlockForPrivKey(priv interface{}) *pem.Block
- func PublicKey(priv interface{}) interface{}
- func SHA1(input string) string
- func Str2Int64(str string) int64
- func Str2Int64Default(str string, intVal int64) int64
- func TLSClientCert(caPem []byte) (credentials.TransportCredentials, error)
- func TLSClientCertNoValidate(caPem []byte) (credentials.TransportCredentials, error)
- func TLSServerCert(certPem, keyPem []byte) (credentials.TransportCredentials, error)
- func ToStr(any interface{}) string
- func TransformProxyConfigurerToMap(origin v1.ProxyConfigurer) (key string, r v1.ProxyConfigurer)
- func TransformVisitorConfigurerToMap(origin v1.VisitorConfigurer) (key string, r v1.VisitorConfigurer)
- func ValidateJwtToken(secretKey, token string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func GetJwtToken ¶
@secretKey: JWT 加解密密钥 @iat: 时间戳 @seconds: 过期时间,单位秒 @payload: 数据载体
func GetJwtTokenFromMap ¶
func GetJwtTokenFromMap(secretKey string, iat, seconds int64, payload map[string]string) (string, error)
@secretKey: JWT 加解密密钥 @iat: 时间戳 @seconds: 过期时间,单位秒 @payload: 数据载体
func HashPassword ¶
func LoadClientConfig ¶
func LoadClientConfig(content []byte, strict bool) ( *v1.ClientCommonConfig, []v1.ProxyConfigurer, []v1.VisitorConfigurer, error, )
func LoadClientConfigNormal ¶
func LoadClientConfigNormal(content []byte, strict bool) (*v1.ClientConfig, error)
func LoadContentWithTemplate ¶
func LoadServerConfig ¶
func LoadServerConfig(content []byte, strict bool) (*v1.ServerConfig, error)
func NewBaseFRPClientConfig ¶
func NewBaseFRPClientConfig(serverAddr string, serverPort int, token string) *v1.ClientCommonConfig
func NewBaseFRPClientUserAuthConfig ¶
func NewBaseFRPClientUserAuthConfig(serverAddr string, serverPort int, user, token string) *v1.ClientCommonConfig
func NewBaseFRPServerConfig ¶
func NewBaseFRPServerConfig(port int, token string) *v1.ServerConfig
func NewBaseFRPServerUserAuthConfig ¶
func NewBaseFRPServerUserAuthConfig(port int, opts []v1.HTTPPluginOptions) *v1.ServerConfig
func ParseToken ¶
func PemBlockForPrivKey ¶
func Str2Int64Default ¶
func TLSClientCert ¶
func TLSClientCert(caPem []byte) (credentials.TransportCredentials, error)
func TLSClientCertNoValidate ¶
func TLSClientCertNoValidate(caPem []byte) (credentials.TransportCredentials, error)
func TLSServerCert ¶
func TLSServerCert(certPem, keyPem []byte) (credentials.TransportCredentials, error)
func TransformProxyConfigurerToMap ¶
func TransformProxyConfigurerToMap(origin v1.ProxyConfigurer) (key string, r v1.ProxyConfigurer)
func TransformVisitorConfigurerToMap ¶
func TransformVisitorConfigurerToMap(origin v1.VisitorConfigurer) (key string, r v1.VisitorConfigurer)
func ValidateJwtToken ¶
@secretKey: JWT 加解密密钥 @token: JWT Token 的字符串
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.