auth

package
v0.29.10 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserGroupAdmin uint8 = iota + 1
	UserGroupBangumiAdmin
	UserGroupWindowAdmin
	UserGroupQuite
	UserGroupBanned

	UserGroupCharacterAdmin
	UserGroupWikiAdmin
	UserGroupNormal
	UserGroupWikiEditor
)
View Source
const CanViewStateClosedTopic = gtime.OneDay * 180
View Source
const CanViewStateDeleteTopic = gtime.OneDay * 365
View Source
const TokenTypeAccessToken = 1
View Source
const TokenTypeOauthToken = 0

Variables

This section is empty.

Functions

func AllowReadCharacter added in v0.22.0

func AllowReadCharacter(u domain.Auth, c model.Character) bool

func AllowReadSubject added in v0.22.0

func AllowReadSubject(u domain.Auth, s model.Subject) bool

func CanViewClosedTopic added in v0.22.0

func CanViewClosedTopic(a domain.Auth) bool

func CanViewDeleteTopic added in v0.22.0

func CanViewDeleteTopic(a domain.Auth) bool

func CanViewTopicContent added in v0.22.0

func CanViewTopicContent(u domain.Auth, topic model.Topic) bool

func ListTopicDisplays added in v0.25.9

func ListTopicDisplays(u domain.Auth) []model.TopicDisplay

ListTopicDisplays 在帖子列表能看到哪些状态的帖子。

func NewMysqlRepo

func NewMysqlRepo(q *query.Query, log *zap.Logger) domain.AuthRepo

func NewService

func NewService(repo domain.AuthRepo, user domain.UserRepo, logger *zap.Logger, c cache.RedisCache) domain.AuthService

func RewriteCommentTree added in v0.23.2

func RewriteCommentTree(comments []model.Comment) []model.Comment

func RewriteCommit added in v0.22.0

func RewriteCommit(t model.Comment) model.Comment

func RewriteSubCommit added in v0.22.0

func RewriteSubCommit(t model.SubComment) model.SubComment

Types

type TokenInfo added in v0.18.0

type TokenInfo struct {
	CreatedAt time.Time `json:"created_at"`
	Name      string    `json:"name"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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