flags

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package flags contains all the bitmask based flags used in the database.

Package flags contains all the bitmask based flags used in the database.

Package flags contains all the bitmask based flags used in the database.

Package flags contains all the bitmask based flags used in the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL int32

ACL is a bitmask based flag for ACLs.

const (
	ACLXchgmgrReview ACL = 1 << iota
	ACLXchgmgrAdmin
	ACLXmailchReview
	ACLXmailchAdmin
	ACLXhelp
	ACLXhelpCanAdd
	ACLXhelpCanEdit
	ACLXwebaxs2
	ACLXwebaxs3
	ACLXwebctl
	ACLXwebacl
	ACLXwebusrToaster
	ACLXatCanView
	ACLXatCanEdit
	ACLXdomainLock
	ACLXsuspendUsr
	ACLXunsuspendUsr
	ACLXwebsess
	ACLXcomplaintsAdmRead
	ACLXcomplaintsAdmReply
	ACLXloggingView
	ACLXiprViewOwn
	ACLXiprViewOthers
	ACLXiprModOwn
	ACLXiprModOthers
	ACLXwebusrToasterRdonly
	ACLMiaView
	ACLXtotpDisableOthers
)

ACL flags.

func (*ACL) AddFlag

func (f *ACL) AddFlag(flag ACL)

AddFlag adds the flag.

func (*ACL) HasFlag

func (f *ACL) HasFlag(flag ACL) bool

HasFlag returns true if the flag is set.

func (*ACL) ListFlagNames added in v0.3.1

func (f *ACL) ListFlagNames() []string

ListFlagNames returns a slice of human-readable flag names for all flags that are currently set.

func (*ACL) ListFlags added in v0.3.1

func (f *ACL) ListFlags() []ACL

ListFlags returns a slice of all flags that are currently set.

func (ACL) Name added in v0.3.1

func (f ACL) Name() string

Name returns the human-readable name of the flag.

func (*ACL) RemoveFlag

func (f *ACL) RemoveFlag(flag ACL)

RemoveFlag removes the flag.

func (*ACL) ToggleFlag

func (f *ACL) ToggleFlag(flag ACL)

ToggleFlag toggles the flag.

type Channel added in v0.3.1

type Channel int32

Channel is a bitmask based flag for channels.

const (
	// ChannelNoPurge indicates that the channel should not be purged for inactivity
	ChannelNoPurge Channel = 0x00000001
	// ChannelSpecial indicates that the channel is special (higher privileges)
	ChannelSpecial Channel = 0x00000002
	// ChannelNoRegister indicates that the channel cannot be registered
	ChannelNoRegister Channel = 0x00000004
	// ChannelNeverReg indicates that the channel can never be registered (permanent)
	ChannelNeverReg Channel = 0x00000008
	// ChannelSuspended indicates that the channel is suspended
	ChannelSuspended Channel = 0x00000010
	// ChannelTempSuspended indicates that the channel is temporarily suspended
	ChannelTempSuspended Channel = 0x00000020
	// ChannelCaution indicates that the channel requires caution (admin attention)
	ChannelCaution Channel = 0x00000040
	// ChannelVacation indicates that the channel is in vacation mode
	ChannelVacation Channel = 0x00000080
	// ChannelLocked indicates that the channel is locked (no changes allowed)
	ChannelLocked Channel = 0x00000100
	// ChannelFloatLimit indicates that the channel has floating limits
	ChannelFloatLimit Channel = 0x00000200
	// ChannelMIA indicates that the channel is marked as MIA (Missing In Action)
	ChannelMIA Channel = 0x00000400
	// ChannelJoinLimit indicates that the channel has join limits
	ChannelJoinLimit Channel = 0x00000800

	// ChannelAlwaysOp indicates that users should always get op
	ChannelAlwaysOp Channel = 0x00010000
	// ChannelStrictOp indicates that only certain users can get ops
	ChannelStrictOp Channel = 0x00020000
	// ChannelNoOp indicates that no auto-op is allowed
	ChannelNoOp Channel = 0x00040000
	// ChannelAutoTopic indicates that automatic topic management is enabled
	ChannelAutoTopic Channel = 0x00080000
	// ChannelOpOnly indicates that only ops can perform certain actions (Deprecated)
	ChannelOpOnly Channel = 0x00100000
	// ChannelAutoJoin indicates that the bot should auto-join the channel
	ChannelAutoJoin Channel = 0x00200000
	// ChannelNoForce indicates that forced access is not allowed (Reserved for Planetarion)
	ChannelNoForce Channel = 0x00400000
	// ChannelNoVoice indicates that no auto-voice is allowed
	ChannelNoVoice Channel = 0x00800000
	// ChannelNoTake indicates that the channel cannot be taken over
	ChannelNoTake Channel = 0x01000000
	// ChannelFloodPro indicates that flood protection is enabled
	ChannelFloodPro Channel = 0x02000000
	// ChannelFloodProGLine indicates that flood protection with G-Line is enabled
	ChannelFloodProGLine Channel = 0x04000000
	// ChannelOpLog indicates that operator actions should be logged
	ChannelOpLog Channel = 0x08000000
)

Channel flags - based on gnuworld sqlChannel constants.

func (*Channel) AddFlag added in v0.3.1

func (f *Channel) AddFlag(flag Channel)

AddFlag adds the flag.

func (*Channel) HasFlag added in v0.3.1

func (f *Channel) HasFlag(flag Channel) bool

HasFlag returns true if the flag is set.

func (*Channel) ListFlagNames added in v0.3.1

func (f *Channel) ListFlagNames() []string

ListFlagNames returns a slice of human-readable flag names for all flags that are currently set.

func (*Channel) ListFlags added in v0.3.1

func (f *Channel) ListFlags() []Channel

ListFlags returns a slice of all flags that are currently set.

func (Channel) Name added in v0.3.1

func (f Channel) Name() string

Name returns the human-readable name of the flag.

func (*Channel) RemoveFlag added in v0.3.1

func (f *Channel) RemoveFlag(flag Channel)

RemoveFlag removes the flag.

func (*Channel) ToggleFlag added in v0.3.1

func (f *Channel) ToggleFlag(flag Channel)

ToggleFlag toggles the flag.

type ChannelUser added in v0.3.1

type ChannelUser int16

ChannelUser is a bitmask based flag for channel userflags.

const (
	// ChannelUserNone indicates no special user flags - default value
	ChannelUserNone ChannelUser = 0x0
	// ChannelUserOp indicates that default mode should be OP
	ChannelUserOp ChannelUser = 0x1
	// ChannelUserVoice indicates that default mode should be VOICE
	ChannelUserVoice ChannelUser = 0x2
)

Channel userflags (default user permissions) - based on gnuworld constants.

func (*ChannelUser) AddFlag added in v0.3.1

func (f *ChannelUser) AddFlag(flag ChannelUser)

AddFlag adds the flag.

func (*ChannelUser) HasFlag added in v0.3.1

func (f *ChannelUser) HasFlag(flag ChannelUser) bool

HasFlag returns true if the flag is set.

func (*ChannelUser) ListFlagNames added in v0.3.1

func (f *ChannelUser) ListFlagNames() []string

ListFlagNames returns a slice of human-readable flag names for all flags that are currently set.

func (*ChannelUser) ListFlags added in v0.3.1

func (f *ChannelUser) ListFlags() []ChannelUser

ListFlags returns a slice of all flags that are currently set.

func (ChannelUser) Name added in v0.3.1

func (f ChannelUser) Name() string

Name returns the human-readable name of the flag.

func (*ChannelUser) RemoveFlag added in v0.3.1

func (f *ChannelUser) RemoveFlag(flag ChannelUser)

RemoveFlag removes the flag.

func (*ChannelUser) ToggleFlag added in v0.3.1

func (f *ChannelUser) ToggleFlag(flag ChannelUser)

ToggleFlag toggles the flag.

type User

type User int16

User is a bitmask based flag for users.

const (
	// UserGlobalSuspend indicates that the user is globally suspended
	UserGlobalSuspend User = 1 << iota
	// UserLoggedIn is deprecated
	UserLoggedIn
	// UserInvisible indicates that the user is invisible
	UserInvisible
	// UserFraud indicates that the username is fraud
	UserFraud
	// UserNoNotes indicates that the user do not want to be sent notes
	UserNoNotes
	// UserNoPurge do not remove the user for being idle
	UserNoPurge
	// UserNoAdmin indicates that any * authentication is disabled (verify/commands)
	UserNoAdmin
	// UserAlumni indicates that any * privileged is gone, *except* tg he verify; it is like an honorary position
	UserAlumni
	// UserOper indicates that the user is flagged as being an official operator, as for allowing them
	// special accesses such as posting complaints even when system is closed to public.
	UserOper
	// UserNoAdduser prevent anyone adding the username to channels (user-set flag, default disabled)
	UserNoAdduser
	// UserTotpEnabled indicates that TOTP is enabled for the user
	UserTotpEnabled
	// UserTotpAdminIpr indicates that the admin user has IP restrictions
	UserTotpAdminIpr
)

User flags.

func (*User) AddFlag

func (f *User) AddFlag(flag User)

AddFlag adds the flag.

func (*User) HasFlag

func (f *User) HasFlag(flag User) bool

HasFlag returns true if the flag is set.

func (*User) ListFlagNames added in v0.3.1

func (f *User) ListFlagNames() []string

ListFlagNames returns a slice of human-readable flag names for all flags that are currently set.

func (*User) ListFlags added in v0.3.1

func (f *User) ListFlags() []User

ListFlags returns a slice of all flags that are currently set.

func (User) Name added in v0.3.1

func (f User) Name() string

Name returns the human-readable name of the flag.

func (*User) RemoveFlag

func (f *User) RemoveFlag(flag User)

RemoveFlag removes the flag.

func (*User) ToggleFlag

func (f *User) ToggleFlag(flag User)

ToggleFlag toggles the flag.

Jump to

Keyboard shortcuts

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