user

package
v0.0.0-...-c6dfff9 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitUserService

func InitUserService(uc Config) error

func NewInMemoryUserRepository

func NewInMemoryUserRepository() userRepository

func SetUserService

func SetUserService(newUs Service)

Types

type Config

type Config struct {
	Type       string                 `yaml:"type"`
	Properties map[string]interface{} `yaml:"properties,omitempty"`
}

type Password

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

type Service

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

func GetUserService

func GetUserService() Service

func (Service) CreateUser

func (us Service) CreateUser(user User) (User, error)

func (Service) GetUser

func (us Service) GetUser(id string) (user User, exists bool)

func (Service) SetPassword

func (us Service) SetPassword(id, password string) error

func (Service) UpdateUser

func (us Service) UpdateUser(usr User) error

func (Service) ValidatePassword

func (us Service) ValidatePassword(id, password string) (valid bool)

type User

type User struct {
	ID         string            `json:"id,omitempty"`
	Realm      string            `json:"realm,omitempty"`
	Roles      []string          `json:"roles,omitempty"`
	Properties map[string]string `json:"properties,omitempty"`
}

func (*User) SetProperty

func (u *User) SetProperty(prop, val string)

type ValidatePasswordResult

type ValidatePasswordResult struct {
	Valid bool `json:"valid,omitempty"`
}

Jump to

Keyboard shortcuts

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