MCPcopy Create free account
hub / github.com/apache/answer / GetUserVisitCacheInfo

Method GetUserVisitCacheInfo

internal/repo/auth/auth.go:89–98  ·  view source on GitHub ↗

GetUserVisitCacheInfo get user visit cache info

(ctx context.Context, visitToken string)

Source from the content-addressed store, hash-verified

87
88// GetUserVisitCacheInfo get user visit cache info
89func (ar *authRepo) GetUserVisitCacheInfo(ctx context.Context, visitToken string) (accessToken string, err error) {
90 accessToken, exist, err := ar.data.Cache.GetString(ctx, constant.UserVisitTokenCacheKey+visitToken)
91 if err != nil {
92 return "", errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
93 }
94 if !exist {
95 return "", nil
96 }
97 return accessToken, nil
98}
99
100// RemoveUserCacheInfo remove user cache info
101func (ar *authRepo) RemoveUserCacheInfo(ctx context.Context, accessToken string) (err error) {

Callers

nothing calls this directly

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected