auth

package
v0.0.0-...-22d58df Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLoginReply

func CreateLoginReply() *protos.LoginReply

func CreateLoginRequest

func CreateLoginRequest() *protos.Login

func DeleteUser

func DeleteUser(user, f string) error

func EncryptPassword

func EncryptPassword(p []byte, sf string) ([]byte, error)

func IsAdminUser

func IsAdminUser(name string, users map[string]User) (bool, error)

func IsLoggedIn

func IsLoggedIn(name string, session Session) bool

func IsRegisteredUser

func IsRegisteredUser(u, f string) (bool, error)

func IsRegularUser

func IsRegularUser(name string, users map[string]User) (bool, error)

func IsValidNewUsername

func IsValidNewUsername(name, f string) (bool, error)

func IsValidUserPass

func IsValidUserPass(u string, p []byte, f, sf string) (bool, error)

func RegisterUser

func RegisterUser(name string, pw []byte, f, sf string) error

func SendLoginReply

func SendLoginReply(r *protos.LoginReply, s *transport.ServerSocket) error

func SendLoginRequest

func SendLoginRequest(r *protos.Login, s *transport.ClientSocket) error

func ServiceLoginReply

func ServiceLoginReply(s *transport.ClientSocket) (bool, error)

func ServiceLoginRequests

func ServiceLoginRequests(s *transport.ServerSocket, f, sf string) error

func SetupClientSocket

func SetupClientSocket(address string) *transport.ClientSocket

func SetupServerSocket

func SetupServerSocket(address string) *transport.ServerSocket

Types

type Session

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

func OpenSession

func OpenSession(name string, pass []byte, users map[string]User) (Session, error)

type User

type User struct {
	Username string
	Role     string
	Password []byte
}

Jump to

Keyboard shortcuts

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