PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/gnoland/boards/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
gnoland / boards
Files
22 (gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/gnoland/boards/v0
gno
0.9

Files (22)

  • gnomod.tomltoml
  • board.gnogno
  • flag_storage.gnogno
  • id.gnogno
  • permission_set.gnogno
  • permissions.gnogno
  • post_storage.gnogno
  • post.gnogno
  • reply.gnogno
  • repost_storage.gnogno
  • storage.gnogno
  • thread.gnogno
  • board_test.gnogno
  • flag_storage_test.gnogno
  • id_test.gnogno
  • permission_set_test.gnogno
  • post_storage_test.gnogno
  • post_test.gnogno
  • reply_test.gnogno
  • repost_storage_test.gnogno
  • storage_test.gnogno
  • thread_test.gnogno
  • permission_set.gnogno
    1package boards23// PermissionSet defines a type to store any number of permissions.4type PermissionSet []uint6456// NewPermissionSet creates a new PermissionSet containing the given permissions.7func NewPermissionSet(perms ...Permission) PermissionSet {8	if len(perms) == 0 {9		return nil10	}1112	// Find max permission value to calculate slice size.13	// This allows any number of permissions to be assigned in any order.14	var max Permission15	for _, p := range perms {16		if p > max {17			max = p18		}19	}2021	s := make(PermissionSet, int(max)/64+1)22	for _, p := range perms {23		// Calculate the index within the set where the permission should be defined.24		// Each item in the set can contain 64 permissions, for example:25		// - Item 0: permissions 0 to 6326		// - Item 1: permissions 64 to 12727		idx := int(p) / 642829		// Turn on the bit that matches the permission, ranging from bit 0 to 6330		s[idx] |= 1 << (uint(p) % 64)31	}32	return s33}3435// Has checks if a permission is in the set.36func (s PermissionSet) Has(p Permission) bool {37	idx := int(p) / 6438	if idx >= len(s) {39		return false40	}4142	// Check if the bit for the current permission is on43	return s[idx]&(1<<(uint(p)%64)) != 044}4546// IsEmpty reports whether the set contains no permissions.47func (s PermissionSet) IsEmpty() bool {48	for _, v := range s {49		if v != 0 {50			return false51		}52	}53	return true54}55

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.