sqliteidm

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

SQLite identity manager for AVFS

CI codecov PkgGoDev Release License

Documentation

Overview

Package sqliteidm is an Identity manager backed by a SQLite database for AVFS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

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

Group is the implementation of avfs.GroupReader.

func (*Group) Gid

func (g *Group) Gid() int

Gid returns the group ID.

func (*Group) Name

func (g *Group) Name() string

Name returns the group name.

type SQLiteIdm

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

func New

func New(db *sql.DB) (*SQLiteIdm, error)

New create a new identity manager.

func (*SQLiteIdm) AdminGroup added in v0.6.0

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

AdminGroup returns the administrator (root) group.

func (*SQLiteIdm) AdminUser added in v0.6.0

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

AdminUser returns the administrator (root) user.

func (*SQLiteIdm) Close

func (idm *SQLiteIdm) Close() error

func (*SQLiteIdm) Features

func (idm *SQLiteIdm) Features() avfs.Features

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

func (*SQLiteIdm) GroupAdd

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

GroupAdd adds a new group.

func (*SQLiteIdm) GroupDel

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

GroupDel deletes an existing group.

func (*SQLiteIdm) HasFeature

func (idm *SQLiteIdm) HasFeature(features avfs.Features) bool

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

func (*SQLiteIdm) LookupGroup

func (idm *SQLiteIdm) 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 (*SQLiteIdm) LookupGroupId

func (idm *SQLiteIdm) 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 (*SQLiteIdm) LookupUser

func (idm *SQLiteIdm) 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 (*SQLiteIdm) LookupUserId

func (idm *SQLiteIdm) 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 (*SQLiteIdm) Type

func (idm *SQLiteIdm) Type() string

Type returns the type of the fileSystem or Identity manager.

func (*SQLiteIdm) UserAdd

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

UserAdd adds a new user.

func (*SQLiteIdm) UserDel

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

UserDel deletes an existing group.

type User

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

User is the implementation of avfs.UserReader.

func (*User) Gid

func (u *User) Gid() int

Gid returns the primary group ID of the user.

func (*User) IsAdmin added in v0.6.0

func (u *User) IsAdmin() bool

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

func (*User) Name

func (u *User) Name() string

Name returns the user name.

func (*User) Uid

func (u *User) Uid() int

Uid returns the user ID.

Jump to

Keyboard shortcuts

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