users

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package users implements operations for user data manipulation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(a, b models.User) bool

Equals returns true if both users have same nickname, password and mac address.

func PublicSlice

func PublicSlice(u []models.User) []models.UserPublicData

PublicSlice returns new slice with only public user data, created from given slice containing full user data.

func StrictEquals

func StrictEquals(a, b models.User) bool

StrictEquals returns true if both users have same values assigned to every field.

func Update

func Update(old models.User, c *Changes) models.User

Update applies given changes to given user model and returns new user model.

Types

type Changes

type Changes struct {
	Nickname string
	Password []byte
	Online   *bool
}

Changes represents possible changes that can be applied to models.User

Jump to

Keyboard shortcuts

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