auth

package
v0.11.2770-beta Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2015 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NO_SUCH_USER          = exception.NewW("No such user")
	AUTH_FAILED           = exception.NewW("Auth failed")
	UNIMPLEMENTED_AUTHSYS = exception.NewW("Unimplemented authsys")
	INVALID_AUTH_CONF     = exception.NewW("Invalid Auth config")
	INVALID_AUTH_PARAMS   = exception.NewW("Invalid Auth params")
)

Functions

This section is empty.

Types

type AuthSys

type AuthSys interface {
	Authenticate(user, passwd string) (bool, error)
	AddUser(user *User) error
	UserInfo(user string) (*User, error)
}

func GetAuthSysImpl

func GetAuthSysImpl(proto string) (AuthSys, error)

func NewFileAuthSys

func NewFileAuthSys(path string) (AuthSys, error)

type FileAuthSys

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

func (*FileAuthSys) AddUser

func (a *FileAuthSys) AddUser(user *User) error

func (*FileAuthSys) Authenticate

func (a *FileAuthSys) Authenticate(user, passwd string) (bool, error)

func (*FileAuthSys) UserInfo

func (a *FileAuthSys) UserInfo(user string) (*User, error)

type User

type User struct {
	Name string
	Pass string
}

Jump to

Keyboard shortcuts

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