rank

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagUser       = "user"
	TagUserPrefix = "usr"
	TagBan        = "ban"
	TagBanPrefix  = "ban"
	TagMod        = "mod"
	TagModPrefix  = "mod"
	TagAdmin      = "admin"
	TagSystem     = "system"
)

Tags for user rank

Variables

This section is empty.

Functions

This section is empty.

Types

type Rank

type Rank map[string]struct{}

Rank represents the set of all user auth tags

func Admin

func Admin() Rank

Admin creates a new Administrator rank

func BaseUser

func BaseUser() Rank

BaseUser creates a new user rank

func FromSlice

func FromSlice(rankSlice []string) Rank

FromSlice creates a new Rank from a list of strings

func FromStringGroup

func FromStringGroup(rankString string) (Rank, error)

FromStringGroup creates a new Group Rank from a string

func FromStringUser

func FromStringUser(rankString string) (Rank, error)

FromStringUser creates a new User Rank from a string

func System

func System() Rank

System creates a new System rank

func (Rank) Add

func (r Rank) Add(other Rank)

Add adds a rank

func (Rank) Has

func (r Rank) Has(tag string) bool

Has checks if a Rank has a tag

func (Rank) HasBan

func (r Rank) HasBan(tag string) bool

HasBan checks if a Rank has a ban tag

func (Rank) HasMod

func (r Rank) HasMod(tag string) bool

HasMod checks if a Rank has a moderator tag

func (Rank) HasUser

func (r Rank) HasUser(tag string) bool

HasUser checks if a Rank has a user tag

func (Rank) Remove

func (r Rank) Remove(other Rank)

Remove removes a rank

func (Rank) Stringify

func (r Rank) Stringify() string

Stringify transforms the rank into an alphabetically ordered, comma delimited string

func (Rank) ToSlice

func (r Rank) ToSlice() []string

ToSlice returns an alphabetically sorted string slice of the rank

Jump to

Keyboard shortcuts

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