Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyReq keyRequest
Functions ¶
func SaveRequestContext ¶
func SaveRequestContext(cxt context.Context, r RequestResponse) context.Context
Types ¶
type JwtClaims ¶
type JwtClaims struct {
Role string `json:"role"`
jwt.RegisteredClaims
}
type JwtService ¶
type JwtService struct {
// contains filtered or unexported fields
}
func NewJwtServer ¶
func NewJwtServer(secretKey string, expireAt int) *JwtService
func (*JwtService) IssueToken ¶
func (j *JwtService) IssueToken(ctx context.Context, sub string, tid string, role Role) (*TokenResponse, error)
func (JwtService) ParseToken ¶
type RequestResponse ¶
func GetRequestContext ¶
func GetRequestContext(cxt context.Context) RequestResponse
func NewRequestResponse ¶
func NewRequestResponse(sub string, tid string) *RequestResponse
type SiteMap ¶
type SiteMap struct {
Slugs []SiteMapData
}
func NewBusinessSiteMap ¶
func NewBusinessSiteMap(slugs []SiteMapData) *SiteMap
type SiteMapData ¶
type TokenResponse ¶
type UID ¶
func DecodeFromBase58 ¶
type Url ¶
type Url struct {
Loc string `xml:"loc"`
LastMod string `xml:"lastmod,omitempty"`
ChangeFreq string `xml:"changefreq,omitempty"`
Priority string `xml:"priority,omitempty"`
}
Url struct định nghĩa 1 URL trong sitemap loc: URL đầy đủ ví dụ https://example.com/all_blog LastMod: Thời gian cập nhật lần cuối ChangeFreq: Tuần suất thay đổi ví dụ: always hourly daily weekly monthly yearly never Priority: Độ ưu tiên khi Search (thường dựa trên bài blog hoặc bài hay nhất trong chủ đề đang tìm)
type Urlset ¶
type Urlset struct {
XMLName xml.Name `xml:"urlset"`
Xmlns string `xml:"xmlns,attr"`
Urls []Url `xml:"url"`
}
Urlset struct theo chuẩn sitemap Khi marshal bằng package Go encoding/xml, nó sẽ tạo: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> XMLName xác định root tag là: <urlset> Xmlns field này là XML attribute => sinh ra xmlns="..." Urls []Url mỗi phần tử sẽ thành: <url>
Click to show internal directories.
Click to hide internal directories.