Documentation ¶
Overview ¶
- メールアドレスの存在チェック - IPアドレスがブロックリストに存在するかチェック
Index ¶
- func AdminOnly(ctx context.Context, db *database.Database, userId string) error
- func ChaeckBlock(ctx context.Context, db *database.Database, ip string, mail string) (bool, error)
- func CheckAdminMail(mail string) bool
- func CheckExistMail(ctx context.Context, db *database.Database, mail string) (bool, error)
- func CheckExpired(entry *models.Period) bool
- func CheckOTP(passcode string, cert *models.Certification, secret *string) (bool, bool)
- func CheckUsername(ctx context.Context, db *database.Database, userName string) (bool, error)
- func GetMailByUserID(ctx context.Context, db *database.Database, userID string) (string, error)
- func ParseUserData(r *http.Request) ([]byte, error)
- func ProOnly(ctx context.Context, db *database.Database, userId string) error
- func UACHToJson(r *http.Request) ([]byte, error)
- func UserAgentToJson(userAgent string) ([]byte, error)
- type Cert
- type UserAgent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChaeckBlock ¶
IPアドレス、メールアドレスがブロックリストに存在しているのかを確認する 存在している場合、trueが返る
func CheckExistMail ¶
certification内に同じメールアドレスが存在するかチェックします 存在している場合、そのメールアドレスを使用しているユーザがいることになります
同じメールアドレスで複数のアカウントを持つことはできません
func CheckUsername ¶
ユーザ名が存在するかチェックする
func GetMailByUserID ¶
ユーザIDからメールアドレスを取得する
func UserAgentToJson ¶
userAgentを解析し、json形式で返します
Types ¶
type Cert ¶
type Cert struct { Writer http.ResponseWriter Request *http.Request SessionToken string RefreshToken string UserId string AccessID string Ip string }
func (*Cert) RefreshLogin ¶
refresh tokenからログインする
type UserAgent ¶
type UserAgent struct { Name string `json:"name"` Version string `json:"version"` OS string `json:"os"` OSVersion string `json:"os_version"` Device string `json:"device"` Mobile bool `json:"mobile"` Tablet bool `json:"tablet"` Desktop bool `json:"desktop"` Bot bool `json:"bot"` URL string `json:"url"` String string `json:"string"` }
func ParseUserAgentJson ¶
UserAgentToJsonのjsonを構造体に戻します
Click to show internal directories.
Click to hide internal directories.