pyramid

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionInvite       = "invite"
	ActionDrop         = "drop"
	ActionLeave        = "leave"
	ActionDisable      = "disable"
	ActionEnable       = "enable"
	ActionCreateRole   = "createrole"
	ActionEditRole     = "editrole"
	ActionDeleteRole   = "deleterole"
	ActionAssignRole   = "assignrole"
	ActionUnassignRole = "unassignrole"
)

Variables

View Source
var (
	AbsoluteKey nostr.PubKey
	Members     = xsync.NewMapOf[nostr.PubKey, Member]()
	Roles       = xsync.NewMapOf[string, Role]()
)

Functions

func AddAction

func AddAction(type_ Action, author nostr.PubKey, target nostr.PubKey) error

func AddRoleAction added in v1.3.0

func AddRoleAction(type_ Action, author nostr.PubKey, roleID, label, desc, color string, order int) error

func AddRoleAssignmentAction added in v1.3.0

func AddRoleAssignmentAction(type_ Action, author nostr.PubKey, target nostr.PubKey, roleID string) error

func CanInviteMore

func CanInviteMore(pubkey nostr.PubKey) bool

func GetChildren

func GetChildren(parent nostr.PubKey) iter.Seq2[nostr.PubKey, Member]

func GetInviteCount added in v1.0.25

func GetInviteCount(pubkey nostr.PubKey) int

func GetInviters added in v1.0.11

func GetInviters(pubkey nostr.PubKey) []nostr.PubKey

func GetLevel added in v1.0.22

func GetLevel(pubkey nostr.PubKey) int

func GetMaxBlossomUploadSizeFor added in v1.1.0

func GetMaxBlossomUploadSizeFor(pubkey nostr.PubKey) int

func GetMaxInvitesFor added in v1.0.22

func GetMaxInvitesFor(pubkey nostr.PubKey) int

func HasRootUsers

func HasRootUsers() bool

func HasSingleRootAncestor added in v1.0.19

func HasSingleRootAncestor(ancestor nostr.PubKey, target nostr.PubKey) bool

func IsAncestorOf

func IsAncestorOf(ancestor nostr.PubKey, target nostr.PubKey) bool

func IsMember

func IsMember(pubkey nostr.PubKey) bool

func IsParentOf

func IsParentOf(parent nostr.PubKey, target nostr.PubKey) bool

func IsRoot

func IsRoot(pubkey nostr.PubKey) bool

func LoadManagement

func LoadManagement() error

func MemberHasRole added in v1.3.0

func MemberHasRole(pubkey nostr.PubKey, roleID string) bool

Types

type Action

type Action string

type Member added in v1.0.19

type Member struct {
	Parents []nostr.PubKey
	Removed bool
	Roles   []string
}

type Role added in v1.3.0

type Role struct {
	ID          string
	Label       string
	Description string
	Color       string
	Order       int
}

Jump to

Keyboard shortcuts

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