model

package
v0.0.0-...-74b78a2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package model defines the data types aka the data model used within GoZer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	// Non-optional attributes
	Id           int64
	GUID         string
	HashedSecret string
	// Optional attributes
	OrcId string
}

User encapsulates all identity-related information about a user. That includes the public GUID, the internal database ID, the ORCiD identifier and the hashed secret.

func NewUserWithSecret

func NewUserWithSecret(secret string) (u User, err error)

NewUserWithSecret takes a user-defined secret and creates a new user object with a fresh GUID and the hashed version of the secret.

func (*User) Authorize

func (u *User) Authorize(secret string) error

Authorize checks wether the provided secret matches the hashed secret of a user.

func (*User) Equals

func (a *User) Equals(b *User) bool

Equals compares two user data structures for equality. This function is used to compare user as part of unit tests.

Directories

Path Synopsis
Package ploc defines the message types for the client-server communication and their marshalling functions.
Package ploc defines the message types for the client-server communication and their marshalling functions.

Jump to

Keyboard shortcuts

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