account

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

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Me(c *gin.Context)
	Update(c *gin.Context)
}

func NewApi

func NewApi(store Store, actionLogger logger.ActionLogger) API

type EditRequest

type EditRequest struct {
	ID                     string          `json:"-"`
	Password               string          `json:"password"`
	UILanguage             string          `json:"ui_language"`
	UIGroupsNavigationType string          `json:"ui_groups_navigation_type"`
	UITheme                string          `json:"ui_theme"`
	DefaultView            string          `json:"defaultview"`
	UITours                map[string]bool `json:"ui_tours"`
}

type Store

type Store interface {
	GetOneBy(ctx context.Context, id string) (*User, error)
	Update(ctx context.Context, r EditRequest) (*User, error)
}

func NewStore

func NewStore(db mongo.DbClient, passwordEncoder password.Encoder, authorProvider author.Provider) Store

type User

type User struct {
	user.User   `bson:",inline"`
	Permissions []role.Permission `bson:"permissions" json:"permissions"`
	UITours     map[string]bool   `bson:"ui_tours" json:"ui_tours"`
}

type Validator

type Validator interface {
	ValidateEditRequest(ctx context.Context, sl validator.StructLevel)
}

func NewValidator

func NewValidator(dbClient mongo.DbClient) Validator

Jump to

Keyboard shortcuts

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