user

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Store is the userstore client
	Store = createClient()
)

Functions

func EncryptedReader

func EncryptedReader(key string, r io.Reader) (*cipher.StreamReader, error)

EncryptedReader wraps r with an OFB cipher stream.

func EncryptedWriter

func EncryptedWriter(key string, w io.Writer) (*cipher.StreamWriter, error)

EncryptedWriter wraps w with an OFB cipher stream.

func IntialiseStore

func IntialiseStore()

IntialiseStore does the setup for the user store starts a goroutine and handles user request in the background

Types

type Access

type Access interface {
	Get(name string) *User
}

Access to the user store

type User

type User struct {
	Username string `json:"name"`
	Mail     string `json:"email"`
	Longname string `json:"displayname"`
	Passwd   []byte `json:"payload"`
	UserType string `json:"type"`
}

User stores a user and its encrypted password

func (*User) DisplayName

func (u *User) DisplayName() string

DisplayName returns the display name

func (*User) Email

func (u *User) Email() string

Email returns the email address

func (User) IsValid

func (u User) IsValid() error

IsValid checks if all needed fields are set

func (*User) Name

func (u *User) Name() string

Name returns the name

func (*User) Password

func (u *User) Password() string

Password decrypts the password

func (*User) SetPassword

func (u *User) SetPassword(pw string)

SetPassword encrypts the password

func (User) String

func (u User) String() string

String implements stringer

func (*User) Type

func (u *User) Type() string

Type returns what kind of user it is

Jump to

Keyboard shortcuts

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