spi

package
v0.0.0-...-9c6c125 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 1 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group interface {
	GetName() string
	GetParent() string
	GetChildren() ([]Group, error)
}

Group is the API for a group

func NewGroup

func NewGroup(group *GroupInfo) Group

NewGroup returns a group interface

type GroupInfo

type GroupInfo struct {
	Name     string `db:"name"`
	ParentID string `db:"parent_id"`
}

GroupInfo defines a group name and its parent

func (*GroupInfo) GetChildren

func (g *GroupInfo) GetChildren() ([]Group, error)

GetChildren returns all the children of the group

func (*GroupInfo) GetName

func (g *GroupInfo) GetName() string

GetName returns the name of group

func (*GroupInfo) GetParent

func (g *GroupInfo) GetParent() string

GetParent returns the parent of the group

type User

type User interface {
	// Returns the enrollment ID of the user
	GetName() string
	// Login the user with a password
	Login(password string) error
	// Get the complete path for the user's affiliation.
	GetAffiliationPath() []string
	// GetAttribute returns the value for an attribute name
	GetAttribute(name string) string
}

User is the SPI for a user

type UserInfo

type UserInfo struct {
	Name           string
	Pass           string
	Type           string
	Group          string
	Attributes     []api.Attribute
	State          int
	MaxEnrollments int
}

UserInfo contains information about a user

type UserRegistry

type UserRegistry interface {
	GetUser(id string, attrs []string) (User, error)
	GetUserInfo(id string) (UserInfo, error)
	InsertUser(user UserInfo) error
	UpdateUser(user UserInfo) error
	DeleteUser(id string) error
	GetGroup(name string) (Group, error)
	GetRootGroup() (Group, error)
	InsertGroup(name string, parentID string) error
	DeleteGroup(name string) error
}

UserRegistry is the API for retreiving users and groups

Jump to

Keyboard shortcuts

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