user

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewEndpoint

func NewEndpoint(userService Service, tokenService sgjwt.TokenService) *Handler

func (*Handler) Authenticate

func (e *Handler) Authenticate(w http.ResponseWriter, r *http.Request)

func (*Handler) Create

func (e *Handler) Create(rw http.ResponseWriter, r *http.Request)

type Service

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

Service contains business logic related to users

func (*Service) Authenticate

func (s *Service) Authenticate(ctx context.Context, username, password string) error

func (*Service) Create

func (s *Service) Create(ctx context.Context, user *User) error

type User

type User struct {
	Login             string `json:"login" valid:"required, length(1|32)"`
	EncryptedPassword []byte `json:"encrypted_password" valid:"-"`
	Password          string `json:"password" valid:"required, length(8|24), printableascii"`
}

User is the representation of supergiant user

Jump to

Keyboard shortcuts

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