Documentation
¶
Index ¶
- Variables
- func CalcSha265Hash(input string, secret string) string
- func GenerateVerificationCode(length int) string
- func GetRequestIP(r *http.Request) string
- func RecordLinkAccessLog(ctx context.Context, originalLinkHash, ip string) ([]string, error)
- func Start() error
- func VerifyRecaptchaToken(token string) bool
- type Condition
- type EmailClient
- type FilterValue
- type Map
- type Query
- type QueryOperator
- type SupportQueryKey
Constants ¶
This section is empty.
Variables ¶
View Source
var GBReg = regexp.MustCompile(`(?i)([\d.]+)GB$`)
Functions ¶
func CalcSha265Hash ¶
CalcSha265Hash calc hash with sha256
func GenerateVerificationCode ¶ added in v0.1.3
GenerateVerificationCode generate random verification code
func GetRequestIP ¶ added in v0.4.0
GetRequestIP get request ip
func RecordLinkAccessLog ¶ added in v0.4.0
RecordLinkAccessLog record link access log
func VerifyRecaptchaToken ¶
VerifyRecaptchaToken verify google recaptcha token
Types ¶
type Condition ¶
type Condition struct { Key string `parser:"@Ident"` Op string `parser:"@('!'? '=' | '<' '='? | '>' '='? | ':')"` Value *FilterValue `parser:"@@"` }
type EmailClient ¶
type EmailClient struct {
// contains filtered or unexported fields
}
func GetEmailClient ¶ added in v0.1.3
func GetEmailClient() (*EmailClient, error)
func (*EmailClient) AddHtmlContent ¶
func (e *EmailClient) AddHtmlContent(content string) *EmailClient
func (*EmailClient) AddTextContent ¶
func (e *EmailClient) AddTextContent(content string) *EmailClient
func (*EmailClient) NewMessage ¶ added in v0.1.3
func (e *EmailClient) NewMessage(subject string) *EmailClient
func (*EmailClient) Send ¶
func (e *EmailClient) Send(to []string) error
type FilterValue ¶
type Query ¶
type Query struct { Key SupportQueryKey `json:"key"` Operator QueryOperator `json:"operator"` Value any `json:"value"` }
type QueryOperator ¶
type QueryOperator string
const ( OpBetween QueryOperator = "between" OpMatch QueryOperator = ":" OpEquals QueryOperator = "=" OpNotEquals QueryOperator = "!=" OpGreaterThan QueryOperator = ">" OpGreaterOrEqual QueryOperator = ">=" OpLessThan QueryOperator = "<" OpLessOrEqual QueryOperator = "<=" )
type SupportQueryKey ¶
type SupportQueryKey string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.