spi

package
v1.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: Apache-2.0 Imports: 1 Imported by: 21 modules, 54 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 Affiliation

type Affiliation interface {
	GetName() string
	GetPrekey() string
}

Affiliation is the API for a user's affiliation

type AffiliationImpl

type AffiliationImpl struct {
	Name   string `db:"name"`
	Prekey string `db:"prekey"`
}

AffiliationImpl defines a group name and its parent

func (*AffiliationImpl) GetName

func (g *AffiliationImpl) GetName() string

GetName returns the name of the affiliation

func (*AffiliationImpl) GetPrekey

func (g *AffiliationImpl) GetPrekey() string

GetPrekey returns the prekey of the affiliation

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
	Affiliation    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
	GetAffiliation(name string) (Affiliation, error)
	InsertAffiliation(name string, prekey string) error
	DeleteAffiliation(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