identity

package
v0.0.0-...-36df34d Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT_GROUP_ID  = GroupId(0)
	EMPTY_GROUP_ID = GroupId(-1)
)
View Source
const (
	ROOT_NAME     = "root"
	ROOT_USER_ID  = UserId(0)
	EMPTY_USER_ID = UserId(-1)
)

Variables

This section is empty.

Functions

func NewUser

func NewUser(
	userId UserId, name string, weakhash string,
	usergroupId GroupId) (*User, *Group, error)

Types

type Group

type Group struct {
	Id          GroupId
	Name        string
	IsUsergroup bool
	Owner       UserId
	Members     map[UserId]bool
}

func NewGroup

func NewGroup(id GroupId, name string, owner UserId, isUsergroup bool) *Group

func (*Group) HasMember

func (this *Group) HasMember(targetUser UserId) bool

type GroupId

type GroupId int

type User

type User struct {
	Id        UserId
	Passhash  string
	Name      string
	Usergroup GroupId
}

func (*User) Auth

func (this *User) Auth(weakhash string) bool

type UserId

type UserId int

Jump to

Keyboard shortcuts

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