spi

package
v0.0.0-...-bf8fb4d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

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