user

package
v1.32.2-hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: BSD-2-Clause Imports: 9 Imported by: 15

Documentation

Index

Constants

View Source
const (
	RoleClinic = "clinic"
)

Variables

This section is empty.

Functions

func ErrorValueStringAsIDNotValid added in v1.27.0

func ErrorValueStringAsIDNotValid(value string) error

func IDValidator added in v1.27.0

func IDValidator(value string, errorReporter structure.ErrorReporter)

func IsValidID added in v1.27.0

func IsValidID(value string) bool

func NewID added in v1.27.0

func NewID() string

func Roles added in v1.31.0

func Roles() []string

func ValidateID added in v1.27.0

func ValidateID(value string) error

Types

type Client added in v1.20.0

type Client interface {
	Get(ctx context.Context, id string) (*User, error)
	Delete(ctx context.Context, id string, deleet *Delete, condition *request.Condition) (bool, error)
}

type Delete added in v1.31.0

type Delete struct {
	Password *string `json:"password,omitempty"`
}

func NewDelete added in v1.31.0

func NewDelete() *Delete

func (*Delete) Parse added in v1.31.0

func (d *Delete) Parse(parser structure.ObjectParser)

func (*Delete) Validate added in v1.31.0

func (d *Delete) Validate(validator structure.Validator)

type User

type User struct {
	UserID        *string    `json:"userid,omitempty" bson:"userid,omitempty"`     // TODO: Rename ID/id
	Username      *string    `json:"username,omitempty" bson:"username,omitempty"` // TODO: Rename Email/email
	PasswordHash  *string    `json:"-" bson:"pwhash,omitempty"`
	Authenticated *bool      `json:"authenticated,omitempty" bson:"authenticated,omitempty"` // TODO: Rename EmaiLVerified/emailVerified
	TermsAccepted *string    `json:"termsAccepted,omitempty" bson:"termsAccepted,omitempty"`
	Roles         *[]string  `json:"roles,omitempty" bson:"roles,omitempty"`
	CreatedTime   *time.Time `json:"createdTime,omitempty" bson:"createdTime,omitempty"`
	ModifiedTime  *time.Time `json:"modifiedTime,omitempty" bson:"modifiedTime,omitempty"`
	DeletedTime   *time.Time `json:"deletedTime,omitempty" bson:"deletedTime,omitempty"`
	Revision      *int       `json:"revision,omitempty" bson:"revision,omitempty"`
}

func (*User) HasRole added in v1.3.0

func (u *User) HasRole(role string) bool

func (*User) Parse added in v1.31.0

func (u *User) Parse(parser structure.ObjectParser)

func (*User) Sanitize added in v1.31.0

func (u *User) Sanitize(details request.Details) error

func (*User) Validate added in v1.31.0

func (u *User) Validate(validator structure.Validator)

type UserArray added in v1.31.0

type UserArray []*User

func (UserArray) Sanitize added in v1.31.0

func (u UserArray) Sanitize(details request.Details) error

Directories

Path Synopsis
store

Jump to

Keyboard shortcuts

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