database

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateUser

func ActivateUser(id int) error

func AddOfflinePayment

func AddOfflinePayment(user_id int, date_of_payment Date, end_date Date) error

func AddUser

func AddUser(stripeID, email, name, password string) (int64, error)

func AddUserPermission

func AddUserPermission(userID int, permission_id int) error

func CheckIfCanUserBeAdded

func CheckIfCanUserBeAdded(email, name string) (bool, error)

func CheckIfUserIDExists

func CheckIfUserIDExists(id int) (bool, error)

func CheckIfUserIsProhibited added in v0.2.17

func CheckIfUserIsProhibited(id int) (bool, error)

func CheckPermissionID

func CheckPermissionID(id int) bool

func CheckUserPassword

func CheckUserPassword(id int, password string) bool

func CheckUserPermission

func CheckUserPermission(userID int, permissionID int) bool

func CreateNewPermission

func CreateNewPermission(name, permission string) error

func CreateOfflineTable

func CreateOfflineTable()

func CreatePermissionsTable

func CreatePermissionsTable() error

func CreateTable

func CreateTable()

func DeactivateUser

func DeactivateUser(id int) error

func DeactivateUserByStripeID

func DeactivateUserByStripeID(stripeID string) error

func DeletePermissionWithID

func DeletePermissionWithID(id int) error

func DoesUserHasOfflinePayments

func DoesUserHasOfflinePayments(user_id int) (bool, error)

func Init

func Init()

func ProhibitUser added in v0.2.17

func ProhibitUser(id int) error

func RemoveUserPermission

func RemoveUserPermission(userID int, permission_id int) error

func SetUserStripeID

func SetUserStripeID(id int, stripeID string) error

func UnprohibitUser added in v0.2.17

func UnprohibitUser(id int) error

func VerifyPassword

func VerifyPassword(password, hash string) bool

Types

type Date

type Date struct {
	Day   int
	Month int
	Year  int
}

func DateFromUnix added in v0.2.16

func DateFromUnix(unix int64) Date

func StringToDate added in v0.2.16

func StringToDate(date string) (Date, error)

func (Date) String added in v0.2.19

func (d Date) String() string

type DateInterface added in v0.2.19

type DateInterface interface {
	String(date string) (Date, error)
}

type OfflinePayment

type OfflinePayment struct {
	UserID        int
	DateOfPayment Date
	End_date      Date
}

func GetOfflinePaymentByID

func GetOfflinePaymentByID(user_id int) ([]OfflinePayment, error)

type Permission

type Permission struct {
	ID         int
	Name       string
	Permission string
}

func GetAllUsersPermissions added in v0.2.7

func GetAllUsersPermissions() ([]Permission, error)

func GetPermissionWithID

func GetPermissionWithID(id int) (Permission, error)

func GetPermissionWithName

func GetPermissionWithName(name string) (Permission, error)

func GetPermissionWithPermission

func GetPermissionWithPermission(permission_type_string string) (Permission, error)

func GetPermissions added in v0.2.7

func GetPermissions() ([]Permission, error)

func GetUserPermissions

func GetUserPermissions(userID int) ([]Permission, error)

type User

type User struct {
	ID           int
	StripeID     string
	Email        string
	Name         string
	IsProhibited bool
	IsActive     bool
}

func GetAllUsers

func GetAllUsers() ([]User, error)

func GetUser

func GetUser(id int) (User, error)

func GetUserByEmail

func GetUserByEmail(email string) (User, error)

Jump to

Keyboard shortcuts

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