memidm

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package memidm implements an in memory identity manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemGroup added in v0.3.2

type MemGroup struct {
	// contains filtered or unexported fields
}

MemGroup is the implementation of avfs.GroupReader.

func (*MemGroup) Gid added in v0.3.2

func (g *MemGroup) Gid() int

Gid returns the group ID.

func (*MemGroup) Name added in v0.3.2

func (g *MemGroup) Name() string

Name returns the group name.

type MemIdm

type MemIdm struct {
	// contains filtered or unexported fields
}

MemIdm implements an in memory identity manager using the avfs.IdentityMgr interface.

func New

func New() *MemIdm

New creates a new identity manager.

func NewWithOptions added in v0.3.2

func NewWithOptions(opts *Options) *MemIdm

NewWithOptions creates a new identity manager using Options.

func (*MemIdm) AdminGroup added in v0.3.2

func (idm *MemIdm) AdminGroup() avfs.GroupReader

AdminGroup returns the administrator (root) group.

func (*MemIdm) AdminUser added in v0.3.2

func (idm *MemIdm) AdminUser() avfs.UserReader

AdminUser returns the administrator (root) user.

func (*MemIdm) Features added in v0.2.0

func (*MemIdm) Features() avfs.Features

Features returns the set of features provided by the file system or identity manager.

func (*MemIdm) GroupAdd

func (idm *MemIdm) GroupAdd(name string) (avfs.GroupReader, error)

GroupAdd adds a new group.

func (*MemIdm) GroupDel

func (idm *MemIdm) GroupDel(name string) error

GroupDel deletes an existing group.

func (*MemIdm) HasFeature added in v0.2.0

func (idm *MemIdm) HasFeature(feature avfs.Features) bool

HasFeature returns true if the file system or identity manager provides a given features.

func (*MemIdm) LookupGroup

func (idm *MemIdm) LookupGroup(name string) (avfs.GroupReader, error)

LookupGroup looks up a group by name. If the group cannot be found, the returned error is of type UnknownGroupError.

func (*MemIdm) LookupGroupId

func (idm *MemIdm) LookupGroupId(gid int) (avfs.GroupReader, error)

LookupGroupId looks up a group by groupid. If the group cannot be found, the returned error is of type UnknownGroupIdError.

func (*MemIdm) LookupUser

func (idm *MemIdm) LookupUser(name string) (avfs.UserReader, error)

LookupUser looks up a user by username. If the user cannot be found, the returned error is of type UnknownUserError.

func (*MemIdm) LookupUserId

func (idm *MemIdm) LookupUserId(uid int) (avfs.UserReader, error)

LookupUserId looks up a user by userid. If the user cannot be found, the returned error is of type UnknownUserIdError.

func (*MemIdm) OSType added in v0.3.2

func (idm *MemIdm) OSType() avfs.OSType

OSType returns the operating system type of the identity manager.

func (*MemIdm) Type

func (*MemIdm) Type() string

Type returns the type of the Identity manager.

func (*MemIdm) UserAdd

func (idm *MemIdm) UserAdd(name, groupName string) (avfs.UserReader, error)

UserAdd adds a new user.

func (*MemIdm) UserDel

func (idm *MemIdm) UserDel(name string) error

UserDel deletes an existing group.

type MemUser added in v0.3.2

type MemUser struct {
	// contains filtered or unexported fields
}

MemUser is the implementation of avfs.UserReader.

func (*MemUser) Gid added in v0.3.2

func (u *MemUser) Gid() int

Gid returns the primary group ID of the user.

func (*MemUser) IsAdmin added in v0.3.2

func (u *MemUser) IsAdmin() bool

IsAdmin returns true if the user has administrator (root) privileges.

func (*MemUser) Name added in v0.3.2

func (u *MemUser) Name() string

Name returns the user name.

func (*MemUser) Uid added in v0.3.2

func (u *MemUser) Uid() int

Uid returns the user ID.

type Options added in v0.3.2

type Options struct {
	OSType avfs.OSType // OSType defines the operating system type.
}

Options defines the initialization options of MemIdm.

Jump to

Keyboard shortcuts

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