utils

package
v0.8.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateAge

func CalculateAge(birthdate, today time.Time) int

CalculateAge calculates the age based on a given birthdate and the current date in the format dd/mm/yy It adjusts for cases where the current date is before the birthday in the current year.

func CalculateAgeWithYOB

func CalculateAgeWithYOB(yob int) int

CalculateAgeWithYOB calculates the age based on the given year of birth (YOB). It subtracts the YOB from the current year to determine the age.

Parameters:

yob: The year of birth as an integer.

Returns:

The calculated age as an integer.

func ConstructName

func ConstructName(firstName, familyName, defaultValue string) string

func IsValidISO639

func IsValidISO639(code string) bool

func IsValidYOb

func IsValidYOb(yob string) bool

IsValidYob checks if the provided yob can be considered valid

Types

type AdminStore

type AdminStore struct {
	FsStore db.Db
	// contains filtered or unexported fields
}

func NewAdminStore

func NewAdminStore(ctx context.Context, fileName string) (*AdminStore, error)

func (*AdminStore) IsAdmin

func (as *AdminStore) IsAdmin(sessionId string) (bool, error)

Checks if the given sessionId is listed as an admin.

Jump to

Keyboard shortcuts

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