usergrp

package
v0.0.0-...-9d47661 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNewUser

type AppNewUser struct {
	Name            string   `json:"name" validate:"required"`
	Email           string   `json:"email" validate:"required,email"`
	Roles           []string `json:"roles" validate:"required"`
	Department      string   `json:"department"`
	Password        string   `json:"password" validate:"required"`
	PasswordConfirm string   `json:"passwordConfirm" validate:"eqfield=Password"`
}

AppNewUser contains information needed to create a new user.

func (AppNewUser) Validate

func (appUsr AppNewUser) Validate() error

Validate checks the data in the model is considered clean.

type AppSummary

type AppSummary struct {
	UserID     string  `json:"userId"`
	UserName   string  `json:"userName"`
	TotalCount int     `json:"totalCount"`
	TotalCost  float64 `json:"totalCost"`
}

AppSummary repesents informatin about an individual user and their products.

type AppUpdateUser

type AppUpdateUser struct {
	Name            *string  `json:"name"`
	Email           *string  `json:"email" validate:"omitempty,email"`
	Roles           []string `json:"roles"`
	Department      *string  `json:"department"`
	Password        *string  `json:"password"`
	PasswordConfirm *string  `json:"passwordConfirm" validate:"omitempty,eqfield=Password"`
	Enabled         *bool    `json:"enabled"`
}

AppUpdateUser contains information needed to update a user.

func (AppUpdateUser) Validate

func (appUsr AppUpdateUser) Validate() error

Validate checks the data in the model is considered clean.

type AppUser

type AppUser struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Email        string   `json:"email"`
	Roles        []string `json:"roles"`
	PasswordHash []byte   `json:"-"`
	Department   string   `json:"department"`
	Enabled      bool     `json:"enabled"`
	DateCreated  string   `json:"dateCreated"`
	DateUpdated  string   `json:"dateUpdated"`
}

AppUser represents information about an individual user.

type Handlers

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

Handlers manages the set of user endpoints.

func New

func New(user *user.Core) *Handlers

New constructs a hanlers for the route access.

func (*Handlers) Create

func (h *Handlers) Create(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Create adds a new user to the system.

func (*Handlers) Delete

func (h *Handlers) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Delete removes a user from the system

func (*Handlers) Query

Query returns a list of users with paging.

func (*Handlers) Update

func (h *Handlers) Update(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Update updates a user in the system.

Jump to

Keyboard shortcuts

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