Documentation
¶
Index ¶
- Constants
- func ClearSessionId(ctx context.Context, sessionId string, domain string)
- func GetAppId(ctx context.Context) string
- func GetDomain(ctx context.Context) string
- func GetDomainIdentifier(ctx context.Context) string
- func GetHeader(ctx context.Context, key string) string
- func GetHttpHeader(ctx context.Context, key string) string
- func GetSessionId(ctx context.Context) string
- func ReadCookies(ctx context.Context, filter string) []*http.Cookie
- func SetCookie(ctx context.Context, cookies []*http.Cookie)
- func SetHeader(ctx context.Context, key string, value string)
- func SetHttpCode(ctx context.Context, code string)
- func SetHttpHeader(ctx context.Context, key string, value string)
- func SetSessionId(ctx context.Context, sessionId string, domain string)
Constants ¶
View Source
const ( // 客户端侧 XAppIdHeader = "x-app-id" // 服务端侧 XHttpCode = "x-http-code" XForwardedForHeader = "x-forwarded-for" XForwardedHostHeader = "x-forwarded-host" )
View Source
const AuthoneTokenKey = "authone_token"
View Source
const SessionDuration = 2 * time.Hour
View Source
const SessionKey = "_session"
Variables ¶
This section is empty.
Functions ¶
func ClearSessionId ¶
ClearSessionId 清除sessionId
func GetDomainIdentifier ¶
GetDomainIdentifier 获取域名标识
func GetHttpHeader ¶
GetHttpHeader 获取http header
func ReadCookies ¶
ReadCookies parses all "Cookie" values from the header h and returns the successfully parsed Cookies.
if filter isn't empty, only cookies of that name are returned
func SetHttpHeader ¶
SetHttpHeader 设置http header, key为http header的key,如SetCookie
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.