types

package
v0.0.0-...-73c9b43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GrpcMatadataResult_Key = "debug"

	GrpcMsgSize = 1024 * 1024 * 1024
)
View Source
const (
	AccessTokenExpire  = int64(1 * 60)      // AccessTokenExpire time
	RefreshTokenExpire = int64(1 * 24 * 60) // RefreshTokenExpire time

	TokenType_Bearer = "Bearer" // TokenType_Bearer

	AccessTokenContextKey  = "access_token"  // AccessTokenContextKey context key
	RefreshTokenContextKey = "refresh_token" // RefreshTokenContextKey context key
	AuthMethodName         = "MethodName"    // AuthMethodName

	Prefix_CredentialKey   = "/SVR/USR/CRED/%s/%s"   // Prefix_CredentialKey used in db service
	Prefix_AccessTokenKey  = "/SVR/USR/TOKEN/ACC/%s" // Prefix_AccessTokenKey used in db service
	Prefix_RefreshTokenKey = "/SVR/USR/TOKEN/REF/%s" // Prefix_RefreshTokenKey used in db service

	Size_RefreshToken = int(6) // Size_RefreshToken
	Size_AccessToken  = int(6) // Size_AccessToken
)
View Source
const (
	// For TinyURL
	TinyURLExpire     = int64(0)           // TinyURLExpire time
	Prefix_TinyURLKey = "/SVR/TINY/URL/%s" // Prefix_TinyURLKey used in db service
)

-----------------------------------------------------------------------

View Source
const (
	PastebinSyntaxRaw      = "raw"
	PastebinSyntaxMarkdown = "markdown"
)

Variables

This section is empty.

Functions

func AccessTokenExpireDuration

func AccessTokenExpireDuration() time.Duration

AccessTokenExpireDuration return the access token expire duration (time.Duration)

func GrpcMatadataDebugOpen

func GrpcMatadataDebugOpen()

GrpcMatadataDebugOpen set true

func GrpcMatadataSetResultFail

func GrpcMatadataSetResultFail(ctx context.Context, rsp interface{})

GrpcMatadataSetResultFail set fail

func IsBase64

func IsBase64(b64 string) bool

IsBase64 base64

func IsEmail

func IsEmail(email string) bool

IsEmail email

func IsPassword

func IsPassword(passwod string) bool

IsPassword password

func IsPhone

func IsPhone(phone string) bool

IsPhone phone

func IsVerifyCode

func IsVerifyCode(verifyCode string) bool

IsVerifyCode verify-code

func RedisAccessTokenKey

func RedisAccessTokenKey(accessToken string) string

RedisAccessTokenKey return the access token key

func RedisCredentialsKey

func RedisCredentialsKey(id, pwd string) string

RedisCredentialsKey return the credentials key

func RedisGetRefreshTokenFromAccessToken

func RedisGetRefreshTokenFromAccessToken(key string) string

RedisGetRefreshTokenFromAccessToken return the access token by refresh token

func RedisRefreshTokenKey

func RedisRefreshTokenKey(refreshToken string) string

RedisRefreshTokenKey return the refresh token key

func RefreshTokenExpireDuration

func RefreshTokenExpireDuration() time.Duration

RefreshTokenExpireDuration return the refresh token expire duration (time.Duration)

func TinyURLExpireDuration

func TinyURLExpireDuration() time.Duration

TinyURLExpireDuration return the access token expire duration (time.Duration)

Types

type Blog

type Blog struct {
	Name    string
	Url     string
	Content string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL