model

package
v0.0.0-...-8a26db4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func ChangeAccountPassword

func ChangeAccountPassword(username string, oldPassword string, newPassword string) (bool, error)

func ConnectDatabase

func ConnectDatabase(dbPath string) error

func CreateTodo

func CreateTodo(p ProposedTodo) (bool, error)

func CreateUser

func CreateUser(p ProposedUser) (bool, error)

func DeleteTodo

func DeleteTodo(id int) (bool, error)

func DeleteUser

func DeleteUser(username string) (bool, error)

func GetStatusByName

func GetStatusByName(s string) (int, error)

func GetUserStatus

func GetUserStatus(username string) (string, error)

func SetUserStatus

func SetUserStatus(username string, j UserStatus) (bool, error)

Types

type FailureMsg

type FailureMsg struct {
	Error string `json:"error"`
}

type HealthCheck

type HealthCheck struct {
	Db           string `json:"db"`
	DiskSpace    string `json:"diskSpace"`
	DiskWritable string `json:"diskWritable"`
	Health       string `json:"health"`
	Status       int    `json:"status"`
}

type InvalidStatusValue

type InvalidStatusValue struct {
	Err error
}

func (*InvalidStatusValue) Error

func (i *InvalidStatusValue) Error() string

type PasswordChange

type PasswordChange struct {
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`
}

type PasswordHashMismatch

type PasswordHashMismatch struct {
	Err error
}

func (*PasswordHashMismatch) Error

func (p *PasswordHashMismatch) Error() string

type ProposedTodo

type ProposedTodo struct {
	Description string `json:"description"`
}

type ProposedUser

type ProposedUser struct {
	Id       int    `json:"Id"`
	UserName string `json:"userName"`
	Status   string `json:"status" enum:"enabled,disabled"`
	Password string `json:"password"`
}

type SchedulingConflict

type SchedulingConflict struct {
	Err error
}

func (*SchedulingConflict) Error

func (s *SchedulingConflict) Error() string

type Status

type Status struct {
	Id           int    `json:"Id"`
	StatusString string `json:"statusString"`
}

type SuccessMsg

type SuccessMsg struct {
	Message string `json:"message"`
}

type Todo

type Todo struct {
	Id           int    `json:"Id"`
	Description  string `json:"description"`
	Status       string `json:"status"`
	CreationDate string `json:"creationDate"`
}

func GetTodoById

func GetTodoById(id int) (Todo, error)

func GetTodos

func GetTodos() ([]Todo, error)

func UpdateTodo

func UpdateTodo(id int, statusId int) (Todo, error)

type TodoList

type TodoList struct {
	Data []Todo `json:"data"`
}

type User

type User struct {
	Id              int    `json:"Id"`
	UserName        string `json:"userName"`
	FullName        string `json:"fullName"`
	PasswordHash    string `json:"passwordHash"`
	Status          string `json:"status"`
	CreationDate    string `json:"creationDate"`
	LastChangedDate string `json:"lastChangedDate"`
}

func GetUserById

func GetUserById(id int) (User, error)

func GetUserByUserName

func GetUserByUserName(username string) (User, error)

func GetUsers

func GetUsers() ([]User, error)

type UserStatus

type UserStatus struct {
	Status string `json:"status" enum:"enabled,disabled"`
}

type UserStatusMsg

type UserStatusMsg struct {
	Message    string `json:"message"`
	UserStatus string `json:"userStatus" enum:"enabled,disabled"`
}

type UsersList

type UsersList struct {
	Data []User `json:"data"`
}

Jump to

Keyboard shortcuts

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