auth

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionKey = "AuthCacheVersion"
	MaxTagsKey = "AuthCacheMaxTags"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewAuthCache

func NewAuthCache(filePath string) *Cache

func (*Cache) AddTag

func (c *Cache) AddTag(tagId string, tagInfo *types.IdTagInfo)

AddTag Add a tag to the global authorization cache.

func (*Cache) DumpTags

func (c *Cache) DumpTags()

func (*Cache) IsTagAuthorized

func (c *Cache) IsTagAuthorized(tagId string) bool

IsTagAuthorized Check if the tag exists in the global authorization cache, the status of the tag is "Accepted" and if it has not expired yet.

func (*Cache) LoadAuthFile

func (c *Cache) LoadAuthFile()

LoadAuthFile loads tags from the cache file

func (*Cache) RemoveCachedTags

func (c *Cache) RemoveCachedTags()

RemoveCachedTags Remove all Tags from the global authorization cache.

func (*Cache) RemoveTag

func (c *Cache) RemoveTag(tagId string)

RemoveTag Remove a tag from the global authorization cache.

func (*Cache) SetMaxCachedTags

func (c *Cache) SetMaxCachedTags(number int)

SetMaxCachedTags Set the maximum number of Tags allowed in the global authorization cache.

Jump to

Keyboard shortcuts

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