Versions in this module Expand all Collapse all v0 v0.3.4 Sep 18, 2024 v0.3.3 Sep 11, 2024 v0.3.2 Sep 9, 2024 v0.3.1 Sep 4, 2024 v0.3.0 Sep 4, 2024 Changes in this version + type GroupUpdateFormdataRequestBody = Group type Service + DbConn database.DB + Logger golog.MyLogger + Server *goHttpEcho.Server type Storage + func GetStorageInstanceOrPanic(dbDriver string, db database.DB, l golog.MyLogger) Storage + ResetPassword func(id int32, passwordHash string, idCurrentUser int) error + type UserChangePasswordFormdataRequestBody = UserLogin + type UserUpdateFormdataRequestBody = User v0.2.1 Apr 3, 2023 Changes in this version + const JWTAuthScopes + var ErrUsernameNotFound = errors.New("username does not exist") + func GetErrorF(errMsg string, err error) error + func RegisterHandlers(router EchoRouter, si ServerInterface) + func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) + type EchoRouter interface + CONNECT func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + type Error struct + Code int32 + Message string + type Group struct + Comment *string + CreateTime time.Time + Creator int32 + Id int32 + InactivationReason *string + InactivationTime *time.Time + IsActive bool + LastModificationTime *time.Time + LastModificationUser *int32 + Name string + type GroupCreateJSONBody = Group + type GroupCreateJSONRequestBody = GroupCreateJSONBody + type GroupList struct + Id int32 + IsActive bool + Name string + type GroupListParams struct + Limit *int32 + type JwtCustomClaims struct + Email string + Id int32 + IsAdmin bool + Name string + Username string + type PGX struct + Conn *pgxpool.Pool + func (db *PGX) Close() + func (db *PGX) Count() (int32, error) + func (db *PGX) Create(u User) (*User, error) + func (db *PGX) CreateGroup(g Group) (*Group, error) + func (db *PGX) Delete(id int32) error + func (db *PGX) DeleteGroup(id int32) error + func (db *PGX) Exist(id int32) bool + func (db *PGX) FindUsername(username string) (int32, error) + func (db *PGX) Get(id int32) (*User, error) + func (db *PGX) GetGroup(id int32) (*Group, error) + func (db *PGX) GetMaxId() (int32, error) + func (db *PGX) IsUserActive(idUser int32) bool + func (db *PGX) IsUserAdmin(idUser int32) bool + func (db *PGX) List(offset, limit int) ([]*UserList, error) + func (db *PGX) ListGroup(offset, limit int) ([]*GroupList, error) + func (db *PGX) ResetPassword(id int32, passwordHash string, idCurrentUser int) error + func (db *PGX) Update(id int32, user User) (*User, error) + func (db *PGX) UpdateGroup(id int32, group Group) (*Group, error) + type ServerInterface interface + GroupCreate func(ctx echo.Context) error + GroupDelete func(ctx echo.Context, groupId int32) error + GroupGet func(ctx echo.Context, groupId int32) error + GroupList func(ctx echo.Context, params GroupListParams) error + GroupUpdate func(ctx echo.Context, groupId int32) error + UserChangePassword func(ctx echo.Context, userId int32) error + UserCreate func(ctx echo.Context) error + UserDelete func(ctx echo.Context, userId int32) error + UserGet func(ctx echo.Context, userId int32) error + UserList func(ctx echo.Context, params UserListParams) error + UserUpdate func(ctx echo.Context, userId int32) error + type ServerInterfaceWrapper struct + Handler ServerInterface + func (w *ServerInterfaceWrapper) GroupCreate(ctx echo.Context) error + func (w *ServerInterfaceWrapper) GroupDelete(ctx echo.Context) error + func (w *ServerInterfaceWrapper) GroupGet(ctx echo.Context) error + func (w *ServerInterfaceWrapper) GroupList(ctx echo.Context) error + func (w *ServerInterfaceWrapper) GroupUpdate(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserChangePassword(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserCreate(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserDelete(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserGet(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserList(ctx echo.Context) error + func (w *ServerInterfaceWrapper) UserUpdate(ctx echo.Context) error + type Service struct + JwtDuration int + JwtSecret []byte + Log golog.MyLogger + Store Storage + func (s Service) GetLogin(ctx echo.Context) error + func (s Service) GetMaxId(ctx echo.Context) error + func (s Service) GetResetPasswordEmail(ctx echo.Context) error + func (s Service) GetResetPasswordToken(ctx echo.Context) error + func (s Service) GetStatus(ctx echo.Context) error + func (s Service) GroupCreate(ctx echo.Context) error + func (s Service) GroupDelete(ctx echo.Context, id int32) error + func (s Service) GroupGet(ctx echo.Context, id int32) error + func (s Service) GroupList(ctx echo.Context, params GroupListParams) error + func (s Service) GroupUpdate(ctx echo.Context, id int32) error + func (s Service) LoginUser(ctx echo.Context) error + func (s Service) ResetPassword(ctx echo.Context) error + func (s Service) SendResetPassword(ctx echo.Context) error + func (s Service) UserChangePassword(ctx echo.Context, userId int32) error + func (s Service) UserCreate(ctx echo.Context) error + func (s Service) UserDelete(ctx echo.Context, userId int32) error + func (s Service) UserGet(ctx echo.Context, userId int32) error + func (s Service) UserList(ctx echo.Context, params UserListParams) error + func (s Service) UserUpdate(ctx echo.Context, userId int32) error + type Storage interface + Close func() + Count func() (int32, error) + Create func(user User) (*User, error) + CreateGroup func(group Group) (*Group, error) + Delete func(id int32) error + DeleteGroup func(id int32) error + Exist func(id int32) bool + FindUsername func(username string) (int32, error) + Get func(id int32) (*User, error) + GetGroup func(id int32) (*Group, error) + GetMaxId func() (int32, error) + IsUserActive func(id int32) bool + IsUserAdmin func(id int32) bool + List func(offset, limit int) ([]*UserList, error) + ListGroup func(offset, limit int) ([]*GroupList, error) + Update func(id int32, user User) (*User, error) + UpdateGroup func(id int32, group Group) (*Group, error) + func GetStorageInstance(dbDriver string, db database.DB, l golog.MyLogger) (Storage, error) + func NewPgxDB(db database.DB, log golog.MyLogger) (Storage, error) + type User struct + BadPasswordCount int32 + Comment *string + CreateTime time.Time + Creator int32 + Email openapi_types.Email + ExternalId *int32 + GroupsId *[]int32 + Id int32 + InactivationReason *string + InactivationTime *time.Time + IsActive bool + IsAdmin bool + IsLocked bool + LastModificationTime *time.Time + LastModificationUser *int32 + Name string + OrgunitId *int32 + PasswordHash string + Phone *string + Username string + type UserCreateJSONBody = User + type UserCreateJSONRequestBody = UserCreateJSONBody + type UserList struct + CreateTime time.Time + Creator int32 + Email openapi_types.Email + Id int32 + IsActive bool + IsAdmin bool + IsLocked bool + Name string + Username string + type UserListParams struct + Limit *int32 + type UserLogin struct + PasswordHash string + Username string